// docs · v1.x

Environment variables

The environment variables that override CommitBrief config keys, plus the few that change runtime behavior, and the precedence between flags, environment, and config.

Updated September 23, 2026

CommitBrief reads a small set of environment variables — mostly provider API keys, plus a few that adjust runtime behavior. Where a variable overrides a config key, the variable wins for that run; it never writes the key back to a config file.

VariableEffectConfig key
ANTHROPIC_API_KEYAnthropic API credential — overrides providers.anthropic.api_key in config.providers.anthropic.api_key
OPENAI_API_KEYOpenAI API credential — overrides providers.openai.api_key in config.providers.openai.api_key
GEMINI_API_KEYGoogle Gemini API credential — overrides providers.gemini.api_key in config.providers.gemini.api_key
DEEPSEEK_API_KEYDeepSeek API credential — overrides providers.deepseek.api_key in config.providers.deepseek.api_key
MISTRAL_API_KEYMistral API credential — overrides providers.mistral.api_key in config.providers.mistral.api_key
COHERE_API_KEYCohere API credential — overrides providers.cohere.api_key in config.providers.cohere.api_key
OLLAMA_HOSTOllama base URL — overrides providers.ollama.base_url in config UNCONDITIONALLY, even if you set base_url explicitly.providers.ollama.base_url
COMMITBRIEF_PROVIDERSelects the active provider for this run — overrides provider in config.provider
COMMITBRIEF_MODELSelects the active provider's model for this run — overrides providers.<name>.model in config.providers.<name>.model

Precedence

For a setting reachable both ways, the order is the same one every other CommitBrief flag follows:

command-line flag  →  environment variable  →  config file  →  built-in default

An environment variable is a good fit for CI (set once at the job or org level) and for secrets you don’t want written into a config file. .commitbrief/config.yml is repo-local and not committed by default, because .commitbrief/ is added to .gitignore, but an environment variable keeps a secret out of any file at all. A flag still wins if you pass one explicitly on that run.

The one exception to “flag wins” is color: NO_COLOR and COMMITBRIEF_NO_COLOR turn color off even when you pass --color always.

Variables outside the table

The table above lists the variables that override a config key. A few more are read for behavior that has no config key to point at:

  • COMMITBRIEF_CONFIG — path of the user-level config file, used instead of ~/.commitbrief/config.yml. A relative path is resolved against the current directory.
  • NO_COLOR — when set to any non-empty value, turns color off, overriding --color always.
  • COMMITBRIEF_NO_COLOR — CommitBrief-specific equivalent of NO_COLOR.
  • LANG / LC_ALL — not used for language selection: language is config-driven (--lang, then repo config, then user config, then English).

See also

  • Configuration — the full config file and every config key, including the ones the table above overrides.
  • Providers — per-provider setup, including which API key variable each one reads.