Skip to content

check:env

Terminal window
npm run check:env

It reads the same .env that npm start reads and checks it. Nothing is started and nothing is changed.

  • Your Node version is 22.19 or newer.
  • .env exists and every line can be read.
  • KNETIK_DEFAULT_MODEL is set, and OPENROUTER_API_KEY is set when any model, image or search setting uses OpenRouter.
  • KNETIK_AI_SEARCH is openrouter or brave, and has the key it needs (OPENROUTER_API_KEY or BRAVE_API_KEY).
  • Model ids are real. They are checked against the model library’s own catalog: KNETIK_DEFAULT_MODEL, KNETIK_AI_CHAT_MODEL, KNETIK_AI_SEARCH_MODEL and KNETIK_AI_IMAGE. A typo fails here instead of in the middle of a run.
  • KNETIK_MODULE_CONFIG is valid JSON.
  • KNETIK_STUB_MODEL=1 is not set, since it forces the scripted model.
  • Your OpenRouter key works: one call to OpenRouter reads the key’s status (and, when the key has a limit, the credit left).

It prints a note when KNETIK_MODE=local is not set.

Flag Effect
--no-key-check Skip the one network call to OpenRouter

On success it prints a summary: mode, the agent model, the code-call model, images, search, images per run, and a masked key (the first and last few characters only). It also reminds you to build first if apps/server/dist/server.mjs does not exist.

Example output
Your .env looks good.
mode local
agents openrouter/anthropic/claude-sonnet-5.5
code calls openrouter/anthropic/claude-sonnet-5.5 (same)
images off (modules that draw images will say so)
search openrouter (web results are billed by OpenRouter on top of the model)
images/run 4 at most
key sk-or-…xyz

On failure it lists what to fix and exits with a non-zero status.