-
-
Notifications
You must be signed in to change notification settings - Fork 0
Environment variables
Home / Configuration / Environment variables
CommitBrief reads the following environment variables. They override the matching keys in the merged YAML config, and are themselves overridden by explicit CLI flags.
| Variable | Effect |
|---|---|
ANTHROPIC_API_KEY |
Sets providers.anthropic.api_key. |
OPENAI_API_KEY |
Sets providers.openai.api_key. |
GEMINI_API_KEY |
Sets providers.gemini.api_key. |
OLLAMA_HOST |
Sets providers.ollama.base_url. Useful when Ollama runs on a non-default host or port. |
These are read once at startup via config.ApplyEnv. Empty values
are ignored (a present-but-empty env var does not clear a config
value).
| Variable | Effect |
|---|---|
COMMITBRIEF_PROVIDER |
Sets config.provider. Equivalent to --provider. |
COMMITBRIEF_MODEL |
Sets providers.<active-provider>.model. Equivalent to --model. Requires COMMITBRIEF_PROVIDER or a config.provider already set; applies to whichever provider is active. |
| Variable | Effect |
|---|---|
COMMITBRIEF_CONFIG |
Absolute path to the user-level config file; replaces the default ~/.commitbrief/config.yml lookup. Useful for ephemeral CI environments, reproducible tests, and per-shell config overrides. |
| Variable | Effect |
|---|---|
LANG |
No longer drives language (changed in v1.6.0, ADR-0021). Language is config-driven: --lang → repo output.lang → user output.lang → English. LANG may still affect non-language locale behavior in other libraries. |
| Variable | Effect |
|---|---|
NO_COLOR |
When set (to anything non-empty), disables ANSI color output everywhere — overrides --color=always and the output.color config field. Standard convention from https://no-color.org. |
COMMITBRIEF_NO_COLOR |
Same effect as NO_COLOR but scoped to CommitBrief specifically. Useful when you want global NO_COLOR=1 off but CommitBrief's output without colors. |
Each value is determined by the first non-empty source in this order (lowest precedence first; later sources override earlier ones):
-
config.Default()skeleton (built into the binary). - User-level YAML (
~/.commitbrief/config.ymlor$COMMITBRIEF_CONFIG). - Repo-local YAML (
<repo>/.commitbrief/config.yml). - Environment variables (this page).
- CLI flags (
--provider,--model,--lang,--color).
So commitbrief --provider=openai --staged overrides
COMMITBRIEF_PROVIDER=anthropic for that one invocation; both
override anything in config.yml.
For clarity — these are NOT environment-variable-driven:
- API key for
claude-cli/gemini-cli: the host CLI manages its own credentials; CommitBrief just shells out to it. - Custom cache directory: hardcoded to
<repo>/.commitbrief/cache/. - Custom config directory: only the file location is overridable
via
COMMITBRIEF_CONFIG; the parent of the file is computed.
- Configuration files — the YAML these env vars override.
- Global flags — flags that override env vars.
-
Localization —
LANGand locale handling. - Providers — provider credential variables.
Home · Installation · Quick start · Troubleshooting · GitHub repo · Issues
CommitBrief — local, LLM-powered code review for git diffs. This wiki documents only what ships in the binary.
Getting started
Commands · reviewing
Commands · summarizing
Commands · committing
Commands · setup
Commands · integration
Commands · inspect
Commands · maintenance
Configuration
Providers
Output
Operations
Reference