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

CommitBrief docs · v1.x · Reference

Canonical URL: https://commitbrief.com/docs/1.x/environment-variables/

---

import EnvVarTable from "../../../src/components/surface/EnvVarTable.astro";

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.

<EnvVarTable />

## 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](/docs/1.x/configuration) — the full config file and
  every config key, including the ones the table above overrides.
- [Providers](/docs/1.x/providers) — per-provider setup, including
  which API key variable each one reads.