Environment variables let you configure Bolt without touching any config files — useful in CI pipelines, Docker containers, and shared environments where you cannot commit credentials. They are read once at startup and cannot be changed while Bolt is running.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/bolt-builder/bolt-cli/llms.txt
Use this file to discover all available pages before exploring further.
The Bolt runtime reads
OPENCODE_* environment variables directly. The BOLT_* names listed in the README are convenience aliases documented for discoverability, but the underlying engine resolves the OPENCODE_* names. Use OPENCODE_* names for maximum compatibility.Reference
| Variable | Description |
|---|---|
OPENCODE_LOG_LEVEL | Set the log verbosity. Accepted values: DEBUG, INFO, WARN, ERROR. Equivalent to the --log-level flag. |
OPENCODE_PRINT_LOGS | Set to any non-empty value to print log output to stderr. Equivalent to --print-logs. |
OPENCODE_PURE | Set to any non-empty value to disable all external plugins. Equivalent to --pure. |
OPENCODE_SERVER_PASSWORD | Basic auth password for bolt serve and bolt web. All connecting clients must provide this password. |
OPENCODE_SERVER_USERNAME | Basic auth username for bolt serve and bolt web (default: opencode when unset). |
OPENCODE_CONFIG | Override the path to the config file that Bolt loads. Bolt will not search the default locations when this is set. |
OPENCODE_CONFIG_DIR | Override the config directory. Bolt will look for config files in this directory instead of the default OS config directory. |
OPENCODE_CONFIG_CONTENT | Provide the entire config as an inline JSON string. Useful in CI where writing files is impractical. Takes the highest precedence among config sources (overrides all files). |
OPENCODE_GIT_BASH_PATH | Path to Git Bash’s bin directory on Windows, used to locate Unix utilities like less. |
Provider API keys
Bolt discovers provider credentials from environment variables automatically — nobolt providers login step required. Each provider looks for a specific environment variable, and Bolt will use it if the variable is set, regardless of what is stored in auth.json.
Common provider variables:
| Variable | Provider |
|---|---|
ANTHROPIC_API_KEY | Anthropic (Claude) |
OPENAI_API_KEY | OpenAI (GPT, o-series) |
GOOGLE_GENERATIVE_AI_API_KEY | Google (Gemini) |
OPENROUTER_API_KEY | OpenRouter |
AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY | Amazon Bedrock |
AZURE_OPENAI_API_KEY | Azure OpenAI |
bolt models --verbose to see which environment variable each configured provider expects.