This reference is derived from current code paths in:

  • packages/coding-agent/src/**
  • packages/ai/src/** (provider/auth resolution used by coding-agent)
  • packages/utils/src/** and packages/tui/src/** where those vars directly affect coding-agent runtime

It documents only active behavior.

Resolution model and precedence

Most runtime lookups use $env from @oh-my-pi/pi-utils (packages/utils/src/env.ts).

$env loading order:

  1. Existing process environment (Bun.env)
  2. Project .env ($PWD/.env) for keys not already set
  3. Agent .env (~/.omp/agent/.env, respecting PI_CONFIG_DIR / PI_CODING_AGENT_DIR) for keys not already set
  4. Config-root .env (~/.omp/.env, respecting PI_CONFIG_DIR) for keys not already set
  5. Home .env (~/.env) for keys not already set

Additional rule inside each .env file: OMP_* keys are mirrored to PI_* keys in that parsed file.


1) Model/provider authentication

These are consumed via getEnvApiKey() (packages/ai/src/stream.ts) unless noted otherwise.

Core provider credentials

VariableUsed forRequired whenNotes / precedence
ANTHROPIC_OAUTH_TOKENAnthropic API authUsing Anthropic with OAuth token authTakes precedence over ANTHROPIC_API_KEY for provider auth resolution
ANTHROPIC_API_KEYAnthropic API authUsing Anthropic without OAuth tokenFallback after ANTHROPIC_OAUTH_TOKEN
ANTHROPIC_FOUNDRY_API_KEYAnthropic via Azure Foundry / enterprise gatewayCLAUDE_CODE_USE_FOUNDRY enabledTakes precedence over ANTHROPIC_OAUTH_TOKEN and ANTHROPIC_API_KEY when Foundry mode is enabled
OPENAI_API_KEYOpenAI authUsing OpenAI-family providers without explicit apiKey argumentUsed by OpenAI Completions/Responses providers
GEMINI_API_KEYGoogle Gemini authUsing google provider modelsPrimary key for Gemini provider mapping
GOOGLE_API_KEYGemini image tool auth fallbackUsing gemini_image tool without GEMINI_API_KEYUsed by coding-agent image tool fallback path
GROQ_API_KEYGroq authUsing Groq models
CEREBRAS_API_KEYCerebras authUsing Cerebras models
FIREWORKS_API_KEYFireworks authUsing Fireworks models
FIREPASS_API_KEYFire Pass authUsing Fire Pass models
TOGETHER_API_KEYTogether authUsing together provider
AIMLAPI_API_KEYAIML API authUsing aimlapi providerOpenAI-compatible AIML API endpoint at https://api.aimlapi.com/v1
HUGGINGFACE_HUB_TOKENHugging Face authUsing huggingface providerPrimary Hugging Face token env var
HF_TOKENHugging Face authUsing huggingface providerFallback when HUGGINGFACE_HUB_TOKEN is unset
SYNTHETIC_API_KEYSynthetic authUsing Synthetic models
NVIDIA_API_KEYNVIDIA authUsing nvidia provider
NANO_GPT_API_KEYNanoGPT authUsing nanogpt provider
VENICE_API_KEYVenice authUsing venice provider
LITELLM_API_KEYLiteLLM authUsing litellm providerOpenAI-compatible LiteLLM proxy key
LM_STUDIO_API_KEYLM Studio auth (optional)Using lm-studio provider with authenticated hostsLocal LM Studio usually runs without auth; any non-empty token works when a key is required
OLLAMA_API_KEYOllama auth (optional)Using ollama provider with authenticated hostsLocal Ollama usually runs without auth; any non-empty token works when a key is required
LLAMA_CPP_API_KEYllama.cpp auth (optional)Using llama.cpp provider with authenticated hostsLocal llama.cpp usually runs without auth; any non-empty token works when a key is configured
XIAOMI_API_KEYXiaomi MiMo authUsing xiaomi provider
XIAOMI_TOKEN_PLAN_AMS_API_KEYXiaomi MiMo Token Plan auth (AMS)Using xiaomi-token-plan-ams provider
XIAOMI_TOKEN_PLAN_CN_API_KEYXiaomi MiMo Token Plan auth (CN)Using xiaomi-token-plan-cn provider
XIAOMI_TOKEN_PLAN_SGP_API_KEYXiaomi MiMo Token Plan auth (SGP)Using xiaomi-token-plan-sgp provider
MOONSHOT_API_KEYMoonshot authUsing moonshot provider
XAI_API_KEYxAI authUsing xAI models or as fallback for xai-oauth
XAI_OAUTH_TOKENxAI OAuth/SuperGrok authUsing xai-oauth providerTakes precedence over XAI_API_KEY for xai-oauth
OPENROUTER_API_KEYOpenRouter authUsing OpenRouter modelsAlso used by image tool when preferred/auto provider is OpenRouter
MISTRAL_API_KEYMistral authUsing Mistral models
ZAI_API_KEYz.ai authUsing z.ai modelsAlso used by z.ai web search provider
ZHIPU_API_KEYZhipu Coding Plan authUsing zhipu-coding-plan provider
UMANS_AI_CODING_PLAN_API_KEYUmans AI Coding Plan authUsing umans provider
MINIMAX_API_KEYMiniMax authUsing minimax provider
MINIMAX_CODE_API_KEYMiniMax Code authUsing minimax-code provider
MINIMAX_CODE_CN_API_KEYMiniMax Code CN authUsing minimax-code-cn provider
OPENCODE_API_KEYOpenCode authUsing opencode-go / opencode-zen models
QIANFAN_API_KEYQianfan authUsing qianfan provider
QWEN_OAUTH_TOKENQwen Portal authUsing qwen-portal with OAuth tokenTakes precedence over QWEN_PORTAL_API_KEY
QWEN_PORTAL_API_KEYQwen Portal authUsing qwen-portal with API keyFallback after QWEN_OAUTH_TOKEN
ZENMUX_API_KEYZenMux authUsing zenmux providerUsed for ZenMux OpenAI and Anthropic-compatible routes
VLLM_API_KEYvLLM auth/discovery opt-inUsing vllm provider (local OpenAI-compatible servers)Any non-empty value works for no-auth local servers
CURSOR_ACCESS_TOKENCursor provider authUsing Cursor provider
AI_GATEWAY_API_KEYVercel AI Gateway authUsing vercel-ai-gateway provider
CLOUDFLARE_AI_GATEWAY_API_KEYCloudflare AI Gateway authUsing cloudflare-ai-gateway providerBase URL must be configured as https://gateway.ai.cloudflare.com/v1/<account>/<gateway>/anthropic
ALIBABA_CODING_PLAN_API_KEYAlibaba Coding Plan authUsing alibaba-coding-plan provider
DEEPSEEK_API_KEYDeepSeek authUsing DeepSeek models
KILO_API_KEYKilo authUsing Kilo models
OLLAMA_CLOUD_API_KEYOllama Cloud authUsing ollama-cloud provider
WAFER_SERVERLESS_API_KEYWafer Serverless authUsing wafer-serverless providerPay-as-you-go Wafer SKU; validated against https://pass.wafer.ai/v1/models
GITLAB_TOKENGitLab Duo authUsing gitlab-duo provider

GitHub/Copilot tokens

VariableUsed forNotes
COPILOT_GITHUB_TOKENGitHub Copilot provider authGeneric GitHub tokens are not used here
GH_TOKENGitHub API auth in web scraperWeb scraper fallback after GITHUB_TOKEN
GITHUB_TOKENGitHub API auth in web scraperWeb scraper checks this before GH_TOKEN

Auth broker / auth gateway (remote credential vault)

When the broker is enabled, the local SQLite credential store is bypassed and all OAuth refresh / access tokens live on the broker host. See auth-broker-gateway.md for the full protocol, CLI surface, and 5-min/15-s usage cache layering.

VariableUsed forRequired whenNotes / precedence
OMP_AUTH_BROKER_URLBase URL of the remote auth-broker (e.g. https://broker.tailnet:8765); selects broker modeResolving credentials through a broker; also required by omp auth-gateway serve (the gateway is itself a broker client)Wins over auth.broker.url in config.yml. When set with no resolvable token, resolveAuthBrokerConfig() hard-errors instead of falling back to local SQLite.
OMP_AUTH_BROKER_TOKENBearer token sent on every broker endpoint except /v1/healthzOMP_AUTH_BROKER_URL is set and no token is available from auth.broker.token or <config-dir>/auth-broker.tokenResolution: this env → auth.broker.token ($ENV_NAME indirection supported) → <config-dir>/auth-broker.token (mode 0600). <config-dir> is ~/.omp/ (respecting PI_CONFIG_DIR).
OMP_AUTH_BROKER_SNAPSHOT_TTL_MSFreshness window for the encrypted local broker snapshot cacheOptional in broker modeDefault 3600000 (1 h). Freshness is based on broker snapshot.generatedAt; 0 disables cache reads/writes and forces the old blocking fetch every startup.
OMP_AUTH_BROKER_SNAPSHOT_CACHEPath to the encrypted local broker snapshot cacheOptional in broker modeDefaults to ~/.omp/cache/auth-broker-snapshot.enc (or XDG cache equivalent). Useful for tests, ephemeral hosts, or relocating the 0600 cache file.

The gateway has no dedicated env vars — it inherits OMP_AUTH_BROKER_*. Its own inbound bearer token lives at <config-dir>/auth-gateway.token and is managed via omp auth-gateway token.


2) Provider-specific runtime configuration

Anthropic Foundry Gateway (Azure / enterprise proxy)

When CLAUDE_CODE_USE_FOUNDRY is enabled, Anthropic requests switch to Foundry mode:

  • Base URL resolves from FOUNDRY_BASE_URL (fallback remains model/default base URL if unset).
  • API key resolution for provider anthropic becomes: ANTHROPIC_FOUNDRY_API_KEYANTHROPIC_OAUTH_TOKENANTHROPIC_API_KEY.
  • ANTHROPIC_CUSTOM_HEADERS is parsed as comma/newline-separated key: value pairs and merged into request headers. They are also forwarded when ANTHROPIC_BASE_URL points to a non-Anthropic host (e.g. a corporate API gateway), so enterprise gateways requiring proprietary auth headers work without enabling Foundry mode.
  • TLS client/server material can be injected from env values: NODE_EXTRA_CA_CERTS, CLAUDE_CODE_CLIENT_CERT, CLAUDE_CODE_CLIENT_KEY. Each accepts either:
    • a filesystem path to PEM content, or
    • inline PEM (including escaped \n sequences).
VariableValue typeBehavior
CLAUDE_CODE_USE_FOUNDRYBoolean-like string (1, true, yes, on)Enables Foundry mode for Anthropic provider
FOUNDRY_BASE_URLURL stringAnthropic endpoint base URL in Foundry mode
ANTHROPIC_FOUNDRY_API_KEYToken stringUsed for Authorization: Bearer <token>
ANTHROPIC_CUSTOM_HEADERSHeader list stringExtra headers; format header-a: value, header-b: value or newline-separated. Also forwarded outside Foundry whenever ANTHROPIC_BASE_URL is non-Anthropic.
NODE_EXTRA_CA_CERTSPEM path or inline PEMExtra CA chain for server certificate validation
CLAUDE_CODE_CLIENT_CERTPEM path or inline PEMmTLS client certificate
CLAUDE_CODE_CLIENT_KEYPEM path or inline PEMmTLS client private key (must be paired with cert)

Amazon Bedrock

VariableDefault / behavior
AWS_REGIONPrimary region source
AWS_DEFAULT_REGIONFallback if AWS_REGION unset
AWS_PROFILEEnables named profile auth path
AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEYEnables IAM key auth path
AWS_BEARER_TOKEN_BEDROCKHighest-precedence bearer token auth path; skips AWS profile/credential-chain lookup when set
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI / AWS_CONTAINER_CREDENTIALS_FULL_URIMarks Bedrock as available in provider detection (credential resolution itself covers env keys, profiles/SSO/credential_process, then IMDSv2)
AWS_WEB_IDENTITY_TOKEN_FILE + AWS_ROLE_ARNMarks Bedrock as available in provider detection (same caveat as the ECS variables above)
AWS_BEDROCK_SKIP_AUTHIf 1, injects dummy credentials (proxy/non-auth scenarios)
HTTPS_PROXY / HTTP_PROXYHonored via Bun’s native fetch proxy support (the provider no longer ships an AWS SDK / proxy-agent transport)
NO_PROXYExcludes matching hosts from Bun’s native proxy routing

Region fallback in provider code: options.regionAWS_REGIONAWS_DEFAULT_REGIONus-east-1.

Azure OpenAI Responses

VariableDefault / behavior
AZURE_OPENAI_API_KEYRequired unless API key passed as option
AZURE_OPENAI_API_VERSIONDefault v1
AZURE_OPENAI_BASE_URLDirect base URL override
AZURE_OPENAI_RESOURCE_NAMEUsed to construct base URL: https://<resource>.openai.azure.com/openai/v1
AZURE_OPENAI_DEPLOYMENT_NAME_MAPOptional mapping string: modelId=deploymentName,model2=deployment2

Base URL resolution: option azureBaseUrl → env AZURE_OPENAI_BASE_URL → option/env resource name → model.baseUrl.

Google Vertex AI

VariableRequired?Notes
GOOGLE_CLOUD_PROJECTYes (unless passed in options)Primary project ID source
GCP_PROJECTFallbackAlternate project ID source
GCLOUD_PROJECTFallbackAlternate project ID source
GOOGLE_CLOUD_PROJECT_IDOAuth login helper onlyUsed by Gemini CLI OAuth project discovery
GOOGLE_VERTEX_LOCATIONYes (unless passed in options)Primary Vertex location source
GOOGLE_CLOUD_LOCATIONFallbackAlternate Vertex location source
VERTEX_LOCATIONFallbackAlternate Vertex location source
GOOGLE_CLOUD_API_KEYConditionalDirect Vertex API-key auth; otherwise ADC fallback can authenticate when project and location are set
GOOGLE_APPLICATION_CREDENTIALSConditionalIf set, file must exist; otherwise ADC fallback path is checked (~/.config/gcloud/application_default_credentials.json)

Kimi

VariableDefault / behavior
KIMI_CODE_OAUTH_HOSTPrimary OAuth host override
KIMI_OAUTH_HOSTFallback OAuth host override
KIMI_CODE_BASE_URLOverrides Kimi usage endpoint base URL (usage/kimi.ts)

OAuth host chain: KIMI_CODE_OAUTH_HOSTKIMI_OAUTH_HOSThttps://auth.kimi.com.

Gemini CLI compatibility

VariableDefault / behavior
PI_AI_GEMINI_CLI_VERSIONOverrides Gemini CLI user-agent version tag (0.35.3 if unset)

OpenAI Codex responses (feature/debug controls)

VariableBehavior
PI_CODEX_DEBUG1/true enables Codex provider debug logging
PI_CODEX_WEBSOCKET1/true enables websocket transport preference
PI_OPENAI_STATEFULOverrides the stateful-chaining default for the platform OpenAI Responses API (previous_response_id, forces store: true): on by default against api.openai.com, off elsewhere
PI_CODEX_WEBSOCKET_IDLE_TIMEOUT_MSPositive integer override (default 300000)
PI_CODEX_WEBSOCKET_RETRY_BUDGETNon-negative integer override (default 5)
PI_CODEX_WEBSOCKET_RETRY_DELAY_MSPositive integer base backoff override (default 500)
PI_OPENAI_STREAM_FIRST_EVENT_TIMEOUT_MSPositive integer OpenAI first-event timeout override
PI_OPENAI_STREAM_IDLE_TIMEOUT_MSPositive integer OpenAI stream idle timeout override

Cursor provider debug

VariableBehavior
DEBUG_CURSOREnables provider debug logs; 2/verbose for detailed payload snippets
DEBUG_CURSOR_LOGOptional file path for JSONL debug log output

Prompt cache compatibility switch

VariableBehavior
PI_CACHE_RETENTIONIf long, enables long retention where supported (anthropic, openai-responses, Bedrock retention resolution)

3) Web search subsystem

Search provider credentials

VariableUsed by
EXA_API_KEYExa search provider and Exa MCP tools
BRAVE_API_KEYBrave search provider
PERPLEXITY_API_KEYPerplexity search provider API-key mode
PERPLEXITY_COOKIESPerplexity cookie-auth search mode
TAVILY_API_KEYTavily search provider
ZAI_API_KEYz.ai search provider (also checks stored OAuth in agent.db)
OPENAI_API_KEY / Codex OAuth in DBCodex search provider availability/auth
PI_CODEX_WEB_SEARCH_MODELCodex search provider model override
MOONSHOT_SEARCH_API_KEY / KIMI_SEARCH_API_KEYKimi/Moonshot search provider env auth
MOONSHOT_SEARCH_BASE_URL / KIMI_SEARCH_BASE_URLKimi/Moonshot search endpoint override
KAGI_API_KEYKagi search provider
JINA_API_KEYJina search provider
PARALLEL_API_KEYParallel search provider
SEARXNG_ENDPOINT, SEARXNG_TOKENSearXNG endpoint and optional bearer token
SEARXNG_BASIC_USERNAME, SEARXNG_BASIC_PASSWORDSearXNG HTTP Basic Auth credentials

SearXNG also reads the equivalent searxng.endpoint, searxng.token, searxng.basicUsername, and searxng.basicPassword settings from ~/.omp/agent/config.yml; environment variables are fallbacks.

Anthropic web search auth chain

searchAnthropic() resolves credentials in this order:

  1. ANTHROPIC_SEARCH_API_KEY
  2. authStorage.getApiKey("anthropic") fallback credentials (runtime/config overrides, stored API-key credentials, stored OAuth credentials, then generic Anthropic env fallback: ANTHROPIC_FOUNDRY_API_KEY in Foundry mode, otherwise ANTHROPIC_OAUTH_TOKEN / ANTHROPIC_API_KEY)

For either credential path, base URL resolution is:

  1. ANTHROPIC_SEARCH_BASE_URL
  2. FOUNDRY_BASE_URL when CLAUDE_CODE_USE_FOUNDRY is enabled
  3. ANTHROPIC_BASE_URL
  4. https://api.anthropic.com

Related vars:

VariableDefault / behavior
ANTHROPIC_SEARCH_API_KEYAPI key used exclusively for the Anthropic web search provider. Highest-priority search auth; overrides ANTHROPIC_API_KEY / OAuth / Foundry for search calls without affecting chat completions.
ANTHROPIC_SEARCH_BASE_URLBase URL used exclusively for the Anthropic web search provider. Applied to either ANTHROPIC_SEARCH_API_KEY or fallback Anthropic credentials; overrides ANTHROPIC_BASE_URL (and FOUNDRY_BASE_URL in Foundry mode) for search calls.
ANTHROPIC_SEARCH_MODELSearch model override. Defaults to claude-haiku-4-5.
ANTHROPIC_BASE_URLGeneric fallback base URL for Anthropic requests when no search-specific base URL is set.

Use ANTHROPIC_SEARCH_BASE_URL (optionally with ANTHROPIC_SEARCH_API_KEY) to keep chat routed through an enterprise gateway (ANTHROPIC_BASE_URL or CLAUDE_CODE_USE_FOUNDRY=true) while pointing web search at a direct Anthropic endpoint, or vice versa.

Perplexity OAuth flow behavior flag

VariableBehavior
PI_AUTH_NO_BORROWIf set, disables macOS native-app token borrowing path in Perplexity login flow

4) Python tooling and kernel runtime

VariableDefault / behavior
PI_PYBoolean-like override for the Python eval backend: truthy (1/true/yes/on) enables, any other value disables; unset defers to the eval.py setting (default enabled)
PI_JSSame boolean-like override for the JavaScript eval backend; unset defers to the eval.js setting (default enabled)
PI_PYTHON_SKIP_CHECKIf 1, skips Python interpreter availability checks (subprocess runner still starts on demand)
PI_PYTHON_INTEGRATIONIf 1, opts gated integration tests in (e.g. python-runner.integration.test.ts) into running against real Python
PI_PYTHON_IPC_TRACEIf 1, logs NDJSON frames exchanged with the Python runner subprocess
VIRTUAL_ENVHighest-priority venv path for Python runtime resolution

Extra conditional behavior:

  • If BUN_ENV=test or NODE_ENV=test, Python availability checks are treated as OK and warming is skipped.
  • Python env filtering denies common API keys and allows safe base vars + LC_, XDG_, PI_ prefixes.

5) Agent/runtime behavior toggles

VariableDefault / behavior
PI_SMOL_MODELEphemeral model-role override for smol (CLI --smol takes precedence)
PI_SLOW_MODELEphemeral model-role override for slow (CLI --slow takes precedence)
PI_PLAN_MODELEphemeral model-role override for plan (CLI --plan takes precedence)
PI_NO_TITLEIf set (any non-empty value), disables auto session title generation on first user message
PI_TINY_DEVICEONNX execution provider for local tiny models; overrides the providers.tinyModelDevice setting (default: CPU; supports cpu, gpu, metal/webgpu, auto, cuda, dml, coreml, wasm, webnn, webnn-gpu, webnn-cpu, webnn-npu)
PI_TINY_DTYPEONNX quantization/precision for local tiny models; overrides the providers.tinyModelDtype setting (default: each model’s shipped dtype, currently q4; supports auto, fp32, fp16, q8, int8, uint8, q4, bnb4, q4f16, q2, q2f16, q1, q1f16)
PI_NO_INTERLEAVED_THINKINGIf 1, disables Anthropic interleaved thinking budget behavior and uses output-token inflation for older thinking mode
NULL_PROMPTIf true, system prompt builder returns empty string
PI_BLOCKED_AGENTBlocks a specific subagent type in task tool
PI_SUBPROCESS_CMDOverrides subagent spawn command (omp / omp.cmd resolution bypass)
PI_TASK_MAX_OUTPUT_BYTESMax captured output bytes per subagent (default 500000)
PI_TASK_MAX_OUTPUT_LINESMax captured output lines per subagent (default 5000)
PI_TIMINGIf set (any non-empty value), prints a hierarchical timing-span tree to stderr via logger.printTimings(). In interactive mode the tree prints once the agent is ready (before the TUI starts); in print mode it prints after the whole prompt batch completes. Print-mode prompts are wrapped in print:prompt:initial / print:prompt:next spans so each user message shows up as its own row. PI_TIMING=x exits the process with code 0 right after printing in interactive mode (use to measure cold startup only). PI_TIMING=full lists every module-load entry instead of just the top N.
PI_DEBUG_STARTUPIf set (any non-empty value), streams one synchronous [startup] <phase>:start / :done marker line to stderr as each startup phase begins/ends — including command-module imports (cli:load:<name>) and the native addon extraction/dlopen (native:*). Unlike PI_TIMING (which prints only once startup completes), the markers survive a hard hang: the last line on stderr names the phase the process is stuck in. Combine with PI_TIMING freely; markers and the span tree share the same phase names.
PI_PACKAGE_DIROverrides package asset base dir resolution (docs/, examples/, CHANGELOG.md)
PI_DISABLE_LSPMUXIf 1, disables lspmux detection/integration and forces direct LSP server spawning
PI_RPC_EMIT_TITLEBoolean-like flag enabling title events in RPC mode
SMITHERY_URLSmithery web URL override (default https://smithery.ai)
SMITHERY_API_URLSmithery API base URL override (default https://api.smithery.ai)
SMITHERY_API_KEYSmithery API key for managed MCP auth lookup
PUPPETEER_EXECUTABLE_PATHBrowser tool Chromium executable override
LITELLM_BASE_URLLiteLLM proxy base URL fallback (http://localhost:4000/v1 if unset); explicit providers.litellm.baseUrl / models.yml config wins
LM_STUDIO_BASE_URLDefault implicit LM Studio discovery base URL override (http://127.0.0.1:1234/v1 if unset)
OLLAMA_BASE_URLDefault implicit Ollama discovery base URL override (OLLAMA_HOST if unset, then http://127.0.0.1:11434)
OLLAMA_HOSTOllama host used for implicit Ollama discovery when OLLAMA_BASE_URL is unset; accepts Ollama-style values such as 127.0.0.1:11434 or http://host:11434
OLLAMA_CONTEXT_LENGTHPositive integer context-window override for implicit Ollama discovery; affects OMP context budgeting only and does not change Ollama’s runtime num_ctx
LLAMA_CPP_BASE_URLDefault implicit Llama.cpp discovery base URL override (http://127.0.0.1:8080 if unset)
PI_EDIT_VARIANTForces edit tool variant when valid (patch, replace, hashline, apply_patch)
PI_FORCE_IMAGE_PROTOCOLForces supported image protocol (kitty, iterm2/iterm, sixel, none) where used
PI_ALLOW_SIXEL_PASSTHROUGHAllows SIXEL passthrough when PI_FORCE_IMAGE_PROTOCOL=sixel
PI_NO_PTYIf 1, disables interactive PTY path for bash tool
OMP_MCP_TIMEOUT_MSOverrides MCP client request timeout (ms) for every MCP server. 0 disables client-side timeouts (AbortSignal never fires). Invalid (negative or non-numeric) values are ignored with a warning and the per-server config or default (30000) is used.

PI_NO_PTY is also set internally when CLI --no-pty is used.


6) Storage and config root paths

These are consumed via @oh-my-pi/pi-utils/dirs and affect where coding-agent stores data.

VariableDefault / behavior
PI_CONFIG_DIRConfig root dirname under home (default .omp)
PI_CODING_AGENT_DIRFull override for agent directory (default ~/<PI_CONFIG_DIR or .omp>/agent)
PWDUsed when matching canonical current working directory in path helpers

7) Shell/tool execution environment

(From packages/utils/src/procmgr.ts and coding-agent bash tool integration.)

VariableBehavior
PI_BASH_NO_CISuppresses automatic CI=true injection into spawned shell env
CLAUDE_BASH_NO_CILegacy alias fallback for PI_BASH_NO_CI
PI_BASH_NO_LOGINDisables login-shell mode; shell args become ['-c'] instead of ['-l','-c']
CLAUDE_BASH_NO_LOGINLegacy alias fallback for PI_BASH_NO_LOGIN
PI_SHELL_PREFIXOptional command prefix wrapper
CLAUDE_CODE_SHELL_PREFIXLegacy alias fallback for PI_SHELL_PREFIX
VISUALPreferred external editor command
EDITORFallback external editor command

Current implementation: PI_BASH_NO_LOGIN/CLAUDE_BASH_NO_LOGIN are active; when either is set, getShellArgs() returns ['-c'].


8) UI/theme/session detection (auto-detected env)

These are read as runtime signals; they are usually set by the terminal/OS rather than manually configured.

VariableUsed for
COLORTERM, TERM, WT_SESSIONColor capability detection (theme color mode)
COLORFGBGTerminal background light/dark auto-detection
TERM_PROGRAM, TERM_PROGRAM_VERSION, TERMINAL_EMULATORTerminal identity in system prompt/context
TMUX_PANE, CMUX_SURFACE_ID, KITTY_WINDOW_ID, TERM_SESSION_ID, WT_SESSIONStable per-terminal session breadcrumb IDs
SHELL, ComSpec, TERM_PROGRAM, TERMSystem info diagnostics
APPDATA, XDG_CONFIG_HOMElspmux config path resolution
HOMEPath shortening in MCP command UI

9) TUI runtime flags (shared package, affects coding-agent UX)

VariableBehavior
PI_NOTIFICATIONSoff / 0 / false suppress desktop notifications
PI_TUI_WRITE_LOGIf set, logs TUI writes to file
PI_HARDWARE_CURSORIf 1, enables hardware cursor mode
PI_NO_SYNC_OUTPUTIf set (any non-empty value), disables DEC 2026 synchronized-output wrappers while keeping TUI autowrap guards
PI_NO_DECCARAIf set (truthy), disables Kitty DECCARA rectangular-SGR background fills (forces padded-string rendering)
PI_DEBUG_REDRAWIf 1, enables redraw debug logging
PI_FORCE_IMAGE_PROTOCOLForces terminal image protocol detection (kitty, iterm2/iterm, sixel, none)
PI_TUI_RESIZE_IN_PLACE1/true force in-place resize (no alt-screen borrow, no ED3 rewrap); 0/false force the alt-screen fast path. Default-on for Warp, which re-reports its size on alt-screen toggles

10) Commit generation controls

VariableBehavior
PI_COMMIT_TEST_FALLBACKIf true (case-insensitive), force commit fallback generation path
PI_COMMIT_NO_FALLBACKIf true, disables fallback when agent returns no proposal
PI_COMMIT_MAP_REDUCEIf false, disables map-reduce commit analysis path
DEBUGIf set, commit agent error stack traces are printed

Security-sensitive variables

Treat these as secrets; do not log or commit them:

  • Provider/API keys and OAuth/bearer credentials (all *_API_KEY, *_TOKEN, OAuth access/refresh tokens)
  • Cloud credentials (AWS_*, GOOGLE_APPLICATION_CREDENTIALS path may expose service-account material)
  • Search/provider auth vars (EXA_API_KEY, BRAVE_API_KEY, PERPLEXITY_API_KEY, Anthropic search keys)
  • Foundry mTLS material (CLAUDE_CODE_CLIENT_CERT, CLAUDE_CODE_CLIENT_KEY, NODE_EXTRA_CA_CERTS when it points to private CA bundles)

Python runtime also explicitly strips many common key vars before spawning kernel subprocesses (packages/coding-agent/src/eval/py/runtime.ts).