Skip to content

Environment Variables

Environment variables override config file values. Provider API keys should be set via env vars (not stored in config files).

This reference is curated rather than exhaustive. It focuses on high-traffic and operator-relevant variables, including patterned families below.

Use environment variables for credentials, CI overrides, and temporary local changes. Prefer TOML for durable project behavior. When both exist, confirm the effective value from the TUI, CLI diagnostics, or the provider-specific error message before changing more than one layer.

VariableDescription
BMO_SSE_HEARTBEAT_INTERVAL_SECONDSInteger override for options.sse_heartbeat_interval_seconds (see internal/config/defaults_helpers.go + config schema)
BMO_MCP_EXTRA_HEADERSJSON object of extra HTTP headers merged into every HTTP/SSE MCP client and HTTP extension (same merge as applyMCPHeadersFromEnv in internal/config/load.go)
BMO_MCP_HEADERS_<ID>Per-server header JSON; <ID> is the config key with - and . replaced by _, uppercased (e.g. my-serverBMO_MCP_HEADERS_MY_SERVER)
BMO_MCP_BEARER_TOKEN_<ID>Per-server Authorization: Bearer … override using the same <ID> normalization as BMO_MCP_HEADERS_*

See MCP server for when headers apply and approval semantics.

VariableDescription
BMO_LOG_STDERRWhen set to a true boolean, mirror log output to stderr in addition to the log rotator (internal/log/log.go)
VariableProvider
ANTHROPIC_API_KEYAnthropic Claude
BMO_ANTHROPIC_API_KEYAnthropic Claude (BMO-specific override)
OPENAI_API_KEYOpenAI
BMO_OPENAI_API_KEYOpenAI (BMO-specific override)
OPENROUTER_API_KEYOpenRouter (non-BMO name; same logical key)
BMO_OPENROUTER_API_KEYOpenRouter (BMO-prefixed override, wins over OPENROUTER_API_KEY when both are set)
BMO_ZAI_API_KEYZAI provider
XIAOMI_API_KEYXiaomi MiMo providers (type = "xiaomi" or Xiaomi-compatible base URLs)

For Bedrock, Vertex, and Azure — configure credentials via the standard provider-specific mechanisms (AWS credentials, GCP ADC, Azure CLI). Bedrock also honors BMO-prefixed AWS overrides such as BMO_AWS_ACCESS_KEY_ID, BMO_AWS_SECRET_ACCESS_KEY, BMO_AWS_REGION, BMO_AWS_PROFILE, and BMO_AWS_BEARER_TOKEN_BEDROCK. For Bedrock bearer-token access that should survive across shells without plaintext config, store the token as the provider key with bmo auth bedrock token <provider> --token-stdin; BMO writes a keychain:<provider> sentinel when durable credential storage is available.

VariableDescription
BMO_GLOBAL_CONFIGOverride the global config directory; BMO reads bmo.toml (or an existing bmo.json) inside it
BMO_GLOBAL_DATAOverride path to global data directory
BMO_AGENT_BACKENDRuntime backend: native by default; agent_sdk_go only in binaries built with -tags=agent_sdk_go. Legacy adk_go input is rejected as unsupported.
BMO_SANDBOX_MODEFile write mode: direct or staged
BMO_SKILLS_DIROverride skills directory path
BMO_SHOW_LOGOShow/hide BMO logo at startup (true/false)
BMO_DISABLE_DEFAULT_PROVIDERSIgnore all built-in provider defaults
BMO_DISABLE_PROVIDER_AUTO_UPDATEDisable automatic provider config updates
BMO_CORE_UTILSEnable core utility tools override
VariableDescription
BMO_ENABLE_METRICSOpt into pseudonymous usage metrics
BMO_DISABLE_METRICSForce-disable metrics (overrides enable_metrics)
DO_NOT_TRACKStandard opt-out signal (also disables metrics)
VariableDescription
BMO_OTEL_ENABLEDEnable OpenTelemetry tracing
BMO_OTEL_ENDPOINTOTLP HTTP endpoint (e.g. localhost:4318 or http://localhost:4318/v1/traces)
BMO_LANGFUSE_ENABLEDEnable Langfuse tracing
BMO_LANGFUSE_HOSTLangfuse host URL
BMO_LANGFUSE_PUBLIC_KEYLangfuse public key
BMO_LANGFUSE_SECRET_KEYLangfuse secret key
VariableDescription
BMO_STAGED_WORKFLOW_ENABLEDEnable staged plan→execute workflow
BMO_REQUIRE_APPROVAL_BEFORE_EXECUTERequire /approve before execution phase
BMO_REQUIRE_VALIDATION_BEFORE_ACCEPTRequire validation before accepting changes
BMO_VALIDATION_COMMANDCommand to run as validation step
BMO_VALIDATION_TIMEOUT_SECONDSTimeout for validation command
BMO_AUTO_DEBUGEnable auto-debug loop
BMO_CHANGE_CONTRACT_ENABLEDEnable change-contract capture for file-mutating runs
BMO_PROMPT_ENHANCEREnable prompt enhancer
BMO_WORKTREE_ISOLATIONEnable sub-agent worktree isolation
BMO_ENABLE_PROCESS_LIFECYCLE_TOOLSRegister process lifecycle tools for agent sessions (see Tools)
VariableDescription
BMO_PRUNING_ENABLEDEnable dynamic context pruning
BMO_PRUNING_TYPE_INJECT_FOR_READType-inject strategy for read-heavy pruning
BMO_PRUNING_SUPERSEDE_WRITESRemove superseded write tool calls
BMO_PRUNING_DEDUP_BY_SIGNATUREDeduplicate messages by content signature
BMO_PRUNING_PURGE_ERRORSPurge error messages during pruning
BMO_PRUNING_PURGE_ERRORS_TURNSNumber of turns after which errors are pruned
BMO_PRUNING_TURN_PROTECTION_TURNSRecent turns to protect from pruning
VariableDescription
BMO_MEMORY_USER_NAMESPACEFallback namespace for user-level persistent memory entries when no authenticated principal is available
VariableDescription
BMO_OPENAI_COMPAT_ENABLEDEnable OpenAI-compatible API endpoint. Canonical config: options.openai_compat (legacy [experimental].openai_compat is normalized into options).
BMO_OPENAI_COMPAT_TOOL_POLICYTool policy for OpenAI-compat mode
BMO_OPENAI_COMPAT_MODEL_OVERRIDE_POLICYControl whether OpenAI-compat requests may override the configured model
BMO_OPENAI_COMPAT_REQUEST_TIMEOUT_SECONDSRequest timeout for the OpenAI-compat HTTP handler
BMO_OPENAI_COMPAT_HEARTBEAT_INTERVAL_SECONDSHeartbeat cadence for long-running OpenAI-compat streaming responses
BMO_OPENAI_COMPAT_IDLE_TIMEOUT_SECONDSIdle timeout for long-running OpenAI-compat requests
BMO_PTY_OBSERVER_ENABLEDEnable PTY observer API. Canonical config: options.pty_observer (legacy [experimental].pty_observer is normalized into options).
BMO_PTY_OBSERVER_ALLOW_REMOTE_SPAWNAllow PTY observer remote clients to request spawn operations instead of read-only observation
BMO_TEAMS_SERVER_URLRemote teams API base URL
BMO_TEAMS_TOKENAuth token for remote teams API
BMO_DISABLE_ANTHROPIC_CACHEWhen true, BMO does not attach Anthropic ephemeral cache_control to the last tool. See Prompt caching for behavior, tradeoffs, and provider notes.
VariableDescription
BMO_TUI_SLASH_OPENS_COMMANDSWhether / in empty input opens commands modal
BMO_TUI_SHOW_LANDING_HINTSShow or hide the initial landing guidance and numbered quick-start choices
VariableDescription
BMO_PROFILEEnable pprof HTTP endpoint at localhost:6060