The .env file
npm start reads a file called .env in the repository root. The repository ships .env.example, which you copy:
cp .env.example .env.env is gitignored. Never commit it, since it holds your API keys.
How it is read
Section titled “How it is read”- Lines are
KEY=value. Lines starting with#are comments. - Anything already set in your shell wins over the file.
npm startpasses the file to Node with--env-file-if-exists=.env, so a missing file is not an error.- Values with spaces or JSON go on one line, for example
KNETIK_MODULE_CONFIG={"content-creator":{"brandVoice":"Plain, warm and specific."}}.
What .env.example sets
Section titled “What .env.example sets”KNETIK_MODE=localOPENROUTER_API_KEY=KNETIK_DEFAULT_MODEL=openrouter/anthropic/claude-sonnet-5.5KNETIK_AI_SEARCH=openrouterKNETIK_AI_MAX_IMAGES_PER_RUN=4| Setting | Why |
|---|---|
KNETIK_MODE=local |
One person, this machine. See Local mode. |
OPENROUTER_API_KEY |
Required. Your key for model calls through OpenRouter. |
KNETIK_DEFAULT_MODEL |
The model agents use, as openrouter/<OpenRouter model id>. |
KNETIK_AI_SEARCH |
Web search. openrouter needs no extra account; web results are billed on top of the model call. |
KNETIK_AI_MAX_IMAGES_PER_RUN |
A cap on images per run while you experiment. Default 8. |
Optional lines, commented out by default, set a cheaper model for single calls in code stages (KNETIK_AI_CHAT_MODEL), an image model (KNETIK_AI_IMAGE), the search model (KNETIK_AI_SEARCH_MODEL), Brave Search instead (KNETIK_AI_SEARCH=brave with BRAVE_API_KEY), per-module settings (KNETIK_MODULE_CONFIG) and the port (PORT).
Each of these is explained in AI and model configuration and the full environment variable reference.
Run npm run check:env after editing, so a typo fails there and not in the middle of a run.