Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment Variables

The config file is the recommended way to configure meka. Environment variables are useful as overrides – for example, in CI pipelines, containers, or when you want to temporarily switch providers without editing your config.

Environment variables override config file values but are overridden by CLI flags.

meka-Specific Variables

VariableDescriptionExample
MEKA_PROVIDERLLM provider nameopenai-api, claude-api, claude-oauth
MEKA_MODELModel identifiergpt-4o, claude-sonnet-4-20250514
MEKA_PERMISSIONDefault permission modenone, read, write
MEKA_INSTRUCTIONSReplace [prompt].instructions for this run. Equivalent to --instructions. Used by the mekabox container wrapper to tell the agent it can install packages freely.Be terse.
MEKA_CONFIG_DIROverride the default config directory. Points at the meka directory itself (contains config.toml and skills/). The only isolation knob that works on every platform — dirs::config_dir() ignores $XDG_CONFIG_HOME on macOS/Windows./tmp/meka-test/meka
MEKA_DATA_DIROverride the default data directory (where sessions.db lives). Same cross-platform escape hatch — dirs::data_dir() ignores $XDG_DATA_HOME on macOS/Windows. Useful for tests, portable installs, and per-project session isolation./tmp/meka-test/data/meka

MCP Variables

VariableDescriptionDefault
MEKA_MCP_TOOL_TIMEOUTPer-call timeout for MCP tools, in milliseconds. Applies to every remote tool invocation; on timeout meka cancels the request and returns an error to the model.600000 (600s)

Provider API Keys

VariableUsed When
OPENAI_API_KEYProvider is openai-api
CLAUDE_API_KEYProvider is claude-api

OAuth Authentication

VariableDescription
CLAUDE_OAUTH_TOKENOAuth access token for the claude-oauth provider
OPENAI_CODEX_TOKENOAuth access token for the openai-codex provider
CODEX_CLIENT_IDOverride the default OpenAI OAuth client ID for the openai-codex setup wizard (rarely needed)

On first use, the OAuth token is saved to the database and loaded automatically on subsequent launches. Setting the env var again replaces the stored token.

Provider Base URL

VariableDescription
OPENAI_BASE_URLCustom base URL for the OpenAI-compatible endpoint

Logging

meka uses the tracing framework. The log level can be controlled with:

VariableDescriptionExample
RUST_LOGStandard Rust log filtermeka=debug, meka=trace

If RUST_LOG is not set, the verbosity flag (-v, -vv, -vvv) controls the level:

FlagLevel
(none)warn
-vinfo
-vvdebug
-vvvtrace

Logs are written to stderr so they do not interfere with agent output.