Resolution order
omp resolves env vars through a layered .env chain. The first source that defines a key wins:
-
The existing process environment.
-
$PWD/.env— the project’s.envin the directory omp was launched from. -
~/.omp/agent/.env— or$PI_CODING_AGENT_DIR/.env/$PI_CONFIG_DIR/agent/.envif those are set. -
~/.omp/.env— honouringPI_CONFIG_DIR. -
~/.env— your home.env.
Inside each .env file, keys written as OMP_FOO are mirrored to PI_FOO, so old configs from the OMP_* era still work without renaming. Settings in ~/.omp/agent/config.yml override built-in defaults; CLI flags override both. See CLI reference for the flag list.
Env vars are read at startup. After editing
~/.envor a project.env, restart omp.
Treat anything ending in
_API_KEY,_TOKEN, or_OAUTH_TOKENas a secret. Never commit.envfiles; never paste them into chat logs.chmod 600any.envfile containing credentials.
.env file format
One KEY=value per line, # for comments, quotes optional but recommended for values containing spaces or shell metacharacters. No interpolation, no export keyword required.
# ~/.omp/.env — applies to every project
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
PI_SLOW_MODEL="openai/gpt-5.3-codex:high"
PI_NO_PTY=1Runtime knobs
The flags people reach for most often. Each has a higher-priority CLI flag or settings key; the env var is the lowest-friction way to set one for a shell session or CI job.
| Variable | What it does |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |
| PI_CODING_AGENT_DIR | Move the agent data directory off ~/.omp/agent — useful on shared boxes or when isolating profiles. |
| PI_CONFIG_DIR | Rename the config root under $HOME (default .omp). Agent dir becomes ~/<PI_CONFIG_DIR>/agent unless PI_CODING_AGENT_DIR is also set. |
| PI_PACKAGE_DIR | Point package asset resolution (docs, examples, changelog) at a custom install path — handy on Nix/Guix. |
| PI_SMOL_MODEL | Pin the smol role for the session. CLI --smol wins if both are set. |
| PI_SLOW_MODEL | Pin the slow/reasoning role. CLI --slow wins. |
| PI_PLAN_MODEL | Pin the plan role. CLI --plan wins. |
| PI_NO_PTY | Set to 1 to disable the PTY path of the bash tool. Equivalent to --no-pty. |
| PI_PY | Gate the Python backend of the eval tool: truthy (1/true/yes/on) enables, any other value disables; unset defers to the eval.py setting (default enabled). |
| PI_JS | Companion gate for the JavaScript backend of eval (eval.js setting). |
| OMP_GITHUB_CACHE_DB | Override the SQLite cache file backing pr:// and issue://. Default ~/.omp/cache/github-cache.db. |
| OMP_AUTORESEARCH_DB_DIR | Override the directory holding the autoresearch SQLite database. |
| VISUAL, EDITOR | Preferred external editor and fallback, used by Ctrl+G. |
| PUPPETEER_EXECUTABLE_PATH | Tell the browser tool which Chromium binary to launch. | |
Provider credentials
One key per provider you want to use. For Anthropic, OpenAI Codex, GitHub Copilot, Kimi, Cursor, and Qwen Portal, interactive /login writes OAuth credentials to ~/.omp/agent/agent.db and is usually less hassle than managing API keys. See Providers for the full OAuth matrix and login flows.
| Provider | Env var(s) | Notes |
|---|---|---|
| Anthropic | ANTHROPIC_OAUTH_TOKEN, ANTHROPIC_API_KEY | OAuth token wins over API key. |
| Anthropic Foundry | ANTHROPIC_FOUNDRY_API_KEY | Used when CLAUDE_CODE_USE_FOUNDRY is on. |
| OpenAI | OPENAI_API_KEY | Also used by OpenAI Responses and Codex resolution. |
| OpenAI Codex | OPENAI_CODEX_OAUTH_TOKEN | OAuth via /login preferred. |
| Google (Gemini) | GEMINI_API_KEY | Image tool falls back to GOOGLE_API_KEY. |
| Google Vertex | GOOGLE_CLOUD_API_KEY | Otherwise ADC + project/location; see Cloud providers below. |
| Amazon Bedrock | multiple | See Cloud providers below. |
| Azure OpenAI | AZURE_OPENAI_API_KEY | See Cloud providers below. |
| Groq | GROQ_API_KEY | |
| Cerebras | CEREBRAS_API_KEY | |
| Fireworks | FIREWORKS_API_KEY | |
| Together | TOGETHER_API_KEY | |
| Hugging Face | HUGGINGFACE_HUB_TOKEN → HF_TOKEN | First non-empty wins. |
| Synthetic | SYNTHETIC_API_KEY | |
| NVIDIA | NVIDIA_API_KEY | |
| NanoGPT | NANO_GPT_API_KEY | |
| Venice | VENICE_API_KEY | Allows unauthenticated access. |
| LiteLLM | LITELLM_API_KEY | OpenAI-compatible LiteLLM proxy. |
| LM Studio | LM_STUDIO_API_KEY (optional) | Local servers usually need no auth. |
| Ollama | OLLAMA_API_KEY (optional) | |
| Ollama Cloud | OLLAMA_CLOUD_API_KEY | |
| llama.cpp | LLAMA_CPP_API_KEY (optional) | |
| vLLM | VLLM_API_KEY | Any non-empty value for no-auth local servers. |
| Xiaomi MiMo | XIAOMI_API_KEY | |
| Moonshot | MOONSHOT_API_KEY | |
| Kimi Code | KIMI_API_KEY | OAuth via /login is the common path. |
| xAI | XAI_API_KEY | |
| OpenRouter | OPENROUTER_API_KEY | Also used by image tool when routed through OpenRouter. |
| Mistral | MISTRAL_API_KEY | |
| Z.AI | ZAI_API_KEY | Also drives the z.ai web-search provider. |
| MiniMax | MINIMAX_API_KEY | |
| MiniMax Code | MINIMAX_CODE_API_KEY | |
| MiniMax Code CN | MINIMAX_CODE_CN_API_KEY | |
| OpenCode Go / Zen | OPENCODE_API_KEY | Shared key for both routes. |
| Qianfan | QIANFAN_API_KEY | |
| Qwen Portal | QWEN_OAUTH_TOKEN → QWEN_PORTAL_API_KEY | OAuth token wins. |
| Cursor | CURSOR_ACCESS_TOKEN | OAuth via /login recommended. |
| ZenMux | ZENMUX_API_KEY | Covers ZenMux’s OpenAI and Anthropic-compatible routes. |
| DeepSeek | DEEPSEEK_API_KEY | |
| Kilo Gateway | KILO_API_KEY | Allows unauthenticated access. |
| Alibaba Coding Plan | ALIBABA_CODING_PLAN_API_KEY | |
| Vercel AI Gateway | AI_GATEWAY_API_KEY | Also accepts VERCEL_AI_GATEWAY_API_KEY for catalog discovery. |
| Cloudflare AI Gateway | CLOUDFLARE_AI_GATEWAY_API_KEY | Base URL form https://gateway.ai.cloudflare.com/v1/<account>/<gateway>/anthropic. |
| GitLab Duo | GITLAB_TOKEN | |
| GitHub Copilot | COPILOT_GITHUB_TOKEN | Generic GH_TOKEN / GITHUB_TOKEN are not used for Copilot (the web scraper reads those). |
| Auth broker (remote) | OMP_AUTH_BROKER_URL, OMP_AUTH_BROKER_TOKEN | Point omp at a remote credential vault instead of ~/.omp/agent/agent.db. URL enables broker mode; token authenticates the client. See Providers. |
Cloud providers
Anthropic Foundry & mTLS
Reach for this when your organisation fronts Anthropic with an Azure Foundry or enterprise gateway that needs custom headers or a client certificate. Setting CLAUDE_CODE_USE_FOUNDRY flips the Anthropic provider into Foundry mode for both streaming and search.
| Variable | Behavior |
|---|---|
CLAUDE_CODE_USE_FOUNDRY | Boolean-like switch (1, true, yes, on). |
FOUNDRY_BASE_URL | Anthropic endpoint base URL in Foundry mode. |
ANTHROPIC_FOUNDRY_API_KEY | Bearer token for Foundry-mode requests. |
ANTHROPIC_CUSTOM_HEADERS | Extra headers, name: value entries comma- or newline-separated. |
NODE_EXTRA_CA_CERTS | Extra CA chain — PEM file path or inline PEM (escaped \n supported). |
CLAUDE_CODE_CLIENT_CERT, CLAUDE_CODE_CLIENT_KEY | mTLS client certificate and matching private key (must be paired). |
Anthropic resolution with Foundry enabled becomes ANTHROPIC_FOUNDRY_API_KEY → ANTHROPIC_OAUTH_TOKEN → ANTHROPIC_API_KEY; otherwise OAuth token then API key.
Amazon Bedrock
Region resolves options.region → AWS_REGION → AWS_DEFAULT_REGION → us-east-1.
| Variable | Behavior |
|---|---|
AWS_REGION, AWS_DEFAULT_REGION | Primary region, then fallback. |
AWS_PROFILE | Named-profile auth path. |
AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY | Plain IAM keys. |
AWS_BEARER_TOKEN_BEDROCK | Bedrock API-key (bearer token) auth. |
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, AWS_CONTAINER_CREDENTIALS_FULL_URI | Mark Bedrock as available in provider detection (resolution itself covers env keys, profiles/SSO/credential_process, then IMDSv2). |
AWS_WEB_IDENTITY_TOKEN_FILE + AWS_ROLE_ARN | Mark Bedrock as available in provider detection (same caveat as the ECS variables above). |
AWS_BEDROCK_SKIP_AUTH | If 1, injects dummy credentials for proxy / no-auth setups. |
HTTPS_PROXY, HTTP_PROXY, NO_PROXY | Honored via Bun’s native fetch proxy support. |
Azure OpenAI Responses
Base URL resolves option → AZURE_OPENAI_BASE_URL → AZURE_OPENAI_RESOURCE_NAME → the model’s default.
| Variable | Behavior |
|---|---|
AZURE_OPENAI_API_KEY | Required unless an API key is passed as an option. |
AZURE_OPENAI_API_VERSION | Default v1. |
AZURE_OPENAI_BASE_URL | Direct base URL override. |
AZURE_OPENAI_RESOURCE_NAME | Builds https://<resource>.openai.azure.com/openai/v1. |
AZURE_OPENAI_DEPLOYMENT_NAME_MAP | Mapping string: modelId=deployment,modelB=deploymentB. |
Google Vertex AI
| Variable | Behavior |
|---|---|
GOOGLE_CLOUD_PROJECT, GCLOUD_PROJECT | Project ID, then fallback. |
GOOGLE_CLOUD_LOCATION | Region; required for ADC auth (no default). |
GOOGLE_CLOUD_API_KEY | Direct Vertex API-key auth; skips ADC. |
GOOGLE_APPLICATION_CREDENTIALS | Path to ADC JSON; falls back to ~/.config/gcloud/application_default_credentials.json. |
GOOGLE_CLOUD_PROJECT_ID | OAuth login helper only — used by Gemini CLI project discovery. |
Web search
Credentials and endpoint overrides for built-in web-search providers. Some keys (e.g. Z.AI, Anthropic search) are also read by the corresponding model provider.
| Variable | Used by |
|---|---|
EXA_API_KEY | Exa search and Exa MCP tools. |
BRAVE_API_KEY | Brave search. |
PERPLEXITY_API_KEY | Perplexity API-key mode. |
PERPLEXITY_COOKIES | Perplexity cookie-auth mode. |
TAVILY_API_KEY | Tavily. |
KAGI_API_KEY | Kagi. |
JINA_API_KEY | Jina. |
PARALLEL_API_KEY | Parallel. |
ANTHROPIC_SEARCH_API_KEY, ANTHROPIC_SEARCH_BASE_URL, ANTHROPIC_SEARCH_MODEL | Overrides for the Anthropic web-search backend. Default model: claude-haiku-4-5. |
ANTHROPIC_BASE_URL | Generic Anthropic base URL used by the search fallback path. |
MOONSHOT_SEARCH_API_KEY / KIMI_SEARCH_API_KEY | Kimi / Moonshot search provider. |
MOONSHOT_SEARCH_BASE_URL / KIMI_SEARCH_BASE_URL | Kimi / Moonshot search endpoint override. |
PI_CODEX_WEB_SEARCH_MODEL | Codex search provider model override. |
SEARXNG_ENDPOINT, SEARXNG_TOKEN | SearXNG endpoint and optional bearer token. |
SEARXNG_BASIC_USERNAME, SEARXNG_BASIC_PASSWORD | SearXNG HTTP Basic Auth. |
PI_AUTH_NO_BORROW | Disables the macOS native-app token-borrowing path used by Perplexity login. |
Eval & Python kernel
| Variable | Behavior |
|---|---|
PI_PY | Backend gate (see Runtime knobs). |
PI_JS | Companion gate for the JavaScript backend. |
PI_PYTHON_SKIP_CHECK | Skip Python availability probes (the runner still starts on demand). |
PI_PYTHON_INTEGRATION | If 1, opts gated integration tests in against a real Python install. |
PI_PYTHON_IPC_TRACE | If 1, logs NDJSON frames exchanged with the Python runner. |
VIRTUAL_ENV | Highest-priority venv path for Python runtime resolution. |
When BUN_ENV=test or NODE_ENV=test, Python availability checks are treated as OK and warming is skipped. The Python runner strips common API-key vars from its subprocess env and only forwards LC_, XDG_, and PI_ prefixes plus a safe base set.
Subagent caps
| Variable | Behavior |
|---|---|
PI_TASK_MAX_OUTPUT_BYTES | Max captured output bytes per subagent (default 500000). |
PI_TASK_MAX_OUTPUT_LINES | Max captured output lines per subagent (default 5000). |
PI_BLOCKED_AGENT | Block a specific subagent type in the task tool. |
PI_SUBPROCESS_CMD | Override the subagent spawn command (bypasses omp / omp.cmd lookup). |
Behaviour toggles
| Variable | Behavior |
|---|---|
PI_NO_TITLE | Skip auto-generated session titles on first user message. |
NULL_PROMPT | If true, the system prompt builder returns an empty string. Useful for debugging or running raw models. |
PI_EDIT_VARIANT | Force an edit-tool variant: patch, replace, hashline, apply_patch. |
PI_CACHE_RETENTION | If long, enables long prompt-cache retention where supported (Anthropic, OpenAI Responses, Bedrock). |
PI_DISABLE_LSPMUX | If 1, disables lspmux integration and forces direct LSP server spawning. |
PI_RPC_EMIT_TITLE | Emit title events in RPC mode. |
Performance & debug
| Variable | Behavior |
|---|---|
PI_TIMING | Any non-empty value prints accumulated startup/tool timings to stderr — once startup completes (before the TUI starts) in interactive mode, after the prompt batch in -p print mode. x prints them and exits with status 0; full adds every module-load span. In print mode each prompt is wrapped as print:prompt:initial / print:prompt:next. |
DEBUG_CURSOR | Cursor provider debug logs; 2/verbose for payload snippets. |
DEBUG_CURSOR_LOG | Optional JSONL log file path for the Cursor debug stream. |
PI_CODEX_DEBUG | OpenAI Codex provider debug logging. |
PI_CODEX_WEBSOCKET | Toggle websocket transport for the Codex provider. |
PI_CODEX_WEBSOCKET_IDLE_TIMEOUT_MS | Override idle timeout (default 300000). |
PI_CODEX_WEBSOCKET_RETRY_BUDGET | Override retry budget (default 5). |
PI_CODEX_WEBSOCKET_RETRY_DELAY_MS | Override base backoff (default 500). |
PI_OPENAI_STREAM_IDLE_TIMEOUT_MS | Override the OpenAI stream idle timeout. |
PI_AI_GEMINI_CLI_VERSION | Override the Gemini CLI user-agent version tag. |
Local server discovery
| Variable | Default |
|---|---|
LM_STUDIO_BASE_URL | http://127.0.0.1:1234/v1 |
OLLAMA_BASE_URL | http://127.0.0.1:11434 |
LLAMA_CPP_BASE_URL | http://127.0.0.1:8080 |
KIMI_CODE_OAUTH_HOST → KIMI_OAUTH_HOST | OAuth host override; defaults to https://auth.kimi.com. |
KIMI_CODE_BASE_URL | Kimi usage endpoint base URL. |
SMITHERY_URL, SMITHERY_API_URL | Smithery web (https://smithery.ai) and API (https://api.smithery.ai) bases. |
Shell execution
How the bash tool wraps the user’s shell when running commands. Each PI_* key has a legacy CLAUDE_* alias that still works.
| Variable | Behavior |
|---|---|
PI_BASH_NO_CI | Suppress the automatic CI=true injection into spawned shells. |
PI_BASH_NO_LOGIN | Drop login-shell mode — shell args become ['-c'] instead of ['-l','-c']. |
PI_SHELL_PREFIX | Optional command-prefix wrapper applied to every shell invocation. |
CLAUDE_BASH_NO_CI, CLAUDE_BASH_NO_LOGIN, CLAUDE_CODE_SHELL_PREFIX | Legacy aliases for the three above. |
PI_NO_PTY | Disable the PTY path of the bash tool (also set internally by --no-pty). |
TUI runtime
Terminal-side knobs. Most are auto-detected; set these only when the defaults misbehave.
| Variable | Behavior |
|---|---|
PI_NOTIFICATIONS | off / 0 / false suppresses desktop notifications. |
PI_FORCE_IMAGE_PROTOCOL | Force a terminal image protocol: kitty, iterm2/iterm, sixel, none. |
PI_ALLOW_SIXEL_PASSTHROUGH | Allow SIXEL passthrough when PI_FORCE_IMAGE_PROTOCOL=sixel. |
PI_HARDWARE_CURSOR | If 1, enable hardware cursor mode. |
PI_TUI_WRITE_LOG | Log all TUI writes to a file. |
PI_DEBUG_REDRAW | Enable redraw debug logging. |
Commit pipeline
The /commit slash command and the underlying commit agent honour these toggles. Mostly used during development of the commit pipeline itself.
| Variable | Behavior |
| ------------------------- | ------------------------------------------------------------------------------------- | --- |
| PI_COMMIT_TEST_FALLBACK | If true, force the heuristic fallback path instead of asking the agent. |
| PI_COMMIT_NO_FALLBACK | If true, leave the proposal empty when the agent doesn’t produce one (no fallback). |
| PI_COMMIT_MAP_REDUCE | If false, disable the map-reduce analysis path for large diffs. |
| DEBUG | If set, the commit agent prints its full error stack on failure. | \n |