Skip to main content

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.

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.
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

VariableDescription
OPENCODE_LOG_LEVELSet the log verbosity. Accepted values: DEBUG, INFO, WARN, ERROR. Equivalent to the --log-level flag.
OPENCODE_PRINT_LOGSSet to any non-empty value to print log output to stderr. Equivalent to --print-logs.
OPENCODE_PURESet to any non-empty value to disable all external plugins. Equivalent to --pure.
OPENCODE_SERVER_PASSWORDBasic auth password for bolt serve and bolt web. All connecting clients must provide this password.
OPENCODE_SERVER_USERNAMEBasic auth username for bolt serve and bolt web (default: opencode when unset).
OPENCODE_CONFIGOverride the path to the config file that Bolt loads. Bolt will not search the default locations when this is set.
OPENCODE_CONFIG_DIROverride the config directory. Bolt will look for config files in this directory instead of the default OS config directory.
OPENCODE_CONFIG_CONTENTProvide 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_PATHPath 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 — no bolt 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.
Set provider API keys in your shell profile (e.g. ~/.zshrc, ~/.bashrc) or in a .env file loaded by your shell. You can also reference them from the config file using the ${VAR_NAME} syntax in a provider.*.apiKey field so that keys are never stored in plaintext.
Common provider variables:
VariableProvider
ANTHROPIC_API_KEYAnthropic (Claude)
OPENAI_API_KEYOpenAI (GPT, o-series)
GOOGLE_GENERATIVE_AI_API_KEYGoogle (Gemini)
OPENROUTER_API_KEYOpenRouter
AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEYAmazon Bedrock
AZURE_OPENAI_API_KEYAzure OpenAI
Run bolt models --verbose to see which environment variable each configured provider expects.

Usage examples

# Enable debug logging for a single run
OPENCODE_LOG_LEVEL=DEBUG bolt run "why is the auth test failing?"

# Run without any plugins to rule out plugin interference
OPENCODE_PURE=1 bolt

# Start a public server with basic auth
OPENCODE_SERVER_PASSWORD=mysecret bolt serve --hostname 0.0.0.0 --port 4096

# Provide config inline (useful in CI)
OPENCODE_CONFIG_CONTENT='{"model":"anthropic/claude-opus-4-5"}' \
  ANTHROPIC_API_KEY=sk-ant-xxx \
  bolt run "generate a changelog for this release"

Build docs developers (and LLMs) love