-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit command
Generate a commit message from the staged diff and, after you confirm,
run git commit. This is the only CommitBrief command that writes to git —
every review path is read-only. It never auto-stages and never edits files;
it commits only what you already staged, and only on your confirmation (or
--yes).
commitbrief commit [--type <format>] [--generate <N>] [--yes] [provider flags]
Takes no positional arguments. The scope is always the staged index, so the
--staged / --unstaged scope flags do not apply.
- Reads the staged diff (errors if nothing is staged).
- Prints the detected staged files.
- Runs the pre-send
.commitbrief/**guard, the secret scan, and the cost preflight on the diff — exactly as a review does. - Asks the configured provider for the commit message(s) in a single call.
- Shows the message (or a selector for
--generate N) and asks to confirm, pre-selected on Yes. - On Yes (or
--yes), runsgit commitand prints git's summary line.
The message is passed to git via git commit -F - (stdin), so multi-line
bodies commit verbatim. Commit hooks run normally (no --no-verify); a
failing pre-commit hook surfaces as an error.
| Flag | Default | Description |
|---|---|---|
-t, --type <format> |
plain (or commit.type) |
Message format. One of plain, conventional, conventional+body, gitmoji, subject+body. |
-g, --generate <N> |
1 (or commit.generate) |
Produce N alternatives (1–10) and pick one in an arrow-key selector. A single provider call generates all N. |
--provider, --model, --cli
|
from config | Select the backend, identical to a review. |
--yes |
off | Commit the first suggestion with no prompt (non-interactive). Does not bypass the secret scan or cost preflight. |
--no-cost-check, --allow-secrets, --no-cache
|
off | Same meaning as on a review. |
--show-prompt |
off | Print the exact prompt that would be sent, then exit (no provider call). |
Defaults resolve flag > config > built-in. The commit.type and
commit.generate config keys set the defaults when the flags are omitted.
--type |
Output |
|---|---|
plain (default) |
A single short imperative subject line, no type prefix. |
conventional |
type(scope): subject (Conventional Commits). Subject only. |
conventional+body |
Conventional subject plus a generated body. |
gitmoji |
An emoji matching the change, then a short subject. |
subject+body |
A subject line plus a generated body. |
Messages are always written in English, regardless of --lang (which
still controls the CLI's own strings).
Committing needs a confirmation that can only be shown on a TTY. On a
non-TTY (piped or CI) without --yes, commit errors before spending
anything. Pass --yes to commit the first suggestion unattended. Even with
--yes, a detected secret (non-TTY) or an over-threshold cost estimate
still aborts.
# Suggest a plain message, confirm, commit.
commitbrief commit
# Conventional Commit with a generated body.
commitbrief commit -t conventional+body
# Offer four alternatives and choose one.
commitbrief commit -g 4
# Use a specific backend for this commit only.
commitbrief commit --provider openai --model gpt-5.4-mini
# Non-interactive: commit the first suggestion.
commitbrief commit --yes
# See the prompt without calling a provider.
commitbrief commit --show-promptThe --suggest-commit review flag is a read-only sibling:
it prints one Conventional Commit message after a review and never
touches git. commit is the standalone, write-capable command with format
and alternative-count options. Both are supported.
-
Review — the read-only review path and
--suggest-commit. -
Configuration files — the
commit.*keys. -
Secret scanner / Cost preflight — the
pre-send guards
commitshares with reviews. - Global flags — flags shared with every command.
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