Skip to content

Config command

Muhammet Şafak edited this page May 30, 2026 · 5 revisions

Home / Commands / config

commitbrief config

Read or write individual configuration values without hand-editing YAML. Three subcommands:

commitbrief config show
commitbrief config get <key>
commitbrief config set <key> <value> [--local]

config show

Prints the merged effective configuration as YAML to stdout, with API keys masked. The output is the result of layering global + repo-local + environment variables in the canonical order; it does not necessarily match what is on disk in any single file.

$ commitbrief config show
version: 1
provider: anthropic
providers:
  anthropic:
    api_key: sk-ant-…abcd
    model: claude-opus-4-8
  ...

config get <key>

Print a single value addressed by dotted path. Takes one positional argument. Exits non-zero on unknown keys.

Examples (all valid):

commitbrief config get provider
commitbrief config get providers.anthropic.model
commitbrief config get output.lang
commitbrief config get cache.ttl_days
commitbrief config get cache.max_size_mb
commitbrief config get command.default
commitbrief config get guard.secret_scan
commitbrief config get cost.warn_threshold_usd

The known dotted paths are listed under Configuration files.

config set <key> <value>

Write a single value with type coercion and validation. Takes two positional arguments: the dotted-path key and the new value.

commitbrief config set provider openai
commitbrief config set providers.anthropic.api_key sk-ant-xxxx
commitbrief config set providers.gemini.model gemini-2.5-flash
commitbrief config set output.lang tr
commitbrief config set cache.ttl_days 14
commitbrief config set cache.max_size_mb 50
commitbrief config set cache.enabled false
# command.default's value starts with `-`, so pass `--` first (or just
# edit config.yml directly — often easier for a string of flags):
commitbrief config set -- command.default "--unstaged --cli gemini"
commitbrief config set guard.secret_scan true
commitbrief config set cost.warn_threshold_usd 2.5

Booleans accept true|false, yes|no, 1|0, on|off.

Numeric fields validate range (e.g. cache.ttl_days and cache.max_size_mb cannot be negative). An invalid value surfaces the validation error and does not modify the file.

Note

cache.max_size_mb returned as a real key in v1.3.0 (size-bounded eviction; 0 = unlimited). It had been removed in v0.9.1 as dead config; the v1.3.0 key is read on the Put path. Unknown keys still error, e.g. unknown field "bogus" in cache (allowed: enabled, ttl_days, max_size_mb).

Flag Notes
--local Write to <repo>/.commitbrief/config.yml. Requires being inside a git repo.

set operates on the on-disk file directly so merged-in state from one scope does not promote to another. First-time writes start from a config.Default() skeleton.

Examples

# Inspect everything that's currently in effect.
commitbrief config show

# Lower the cost-preflight threshold to 10 cents.
commitbrief config set cost.warn_threshold_usd 0.10

# Turn the secret scanner off for a repo where it false-positives.
commitbrief config set --local guard.secret_scan false

# Switch model for the active provider.
commitbrief config set providers.anthropic.model claude-sonnet-4-6

See also

Clone this wiki locally