commitbrief

module
v1.21.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: GPL-3.0

README

CommitBrief

Local LLM code review CLI for git diffs — review staged/unstaged changes, any git diff range, or a GitHub PR, right in your terminal.

CI Latest release License

Run a "second pair of eyes" review on your staged changes, a specific file, a single commit, or a PR-style three-dot range — without leaving the terminal. Output is rendered as colored markdown in the terminal, plain markdown to a file, or strict JSON for tooling — your choice.

Why

A real reviewer is the gold standard, but they aren't always available the moment you stage a change. CommitBrief gives you a quick, structured read on your diff before another human (or your future self) sees it — local-first (review output stays on your machine; the diff goes only to the provider you pick, or nowhere at all with Ollama), provider-agnostic, cache aware on unchanged diffs, and steerable with a repo's own COMMITBRIEF.md review rules.

Quick Start

Install CommitBrief with one of the methods under Installation, then:

commitbrief setup   # pick a provider, paste your API key, run a ping
commitbrief init    # write a starter COMMITBRIEF.md
commitbrief         # review your staged changes

Walkthrough with sample output: Run your first review.

Installation

brew install CommitBrief/tap/commitbrief                          # macOS / Linux
scoop bucket add commitbrief https://github.com/CommitBrief/scoop-bucket
scoop install commitbrief                                         # Windows
go install github.com/CommitBrief/commitbrief/cmd/commitbrief@latest

Pre-built binaries are attached to each tagged release. Full install paths, package-manager setup, and commitbrief upgrade: see Installation.

Usage

commitbrief                                # review your staged changes
commitbrief diff HEAD                      # review working tree vs HEAD
commitbrief diff main...feature/x          # review a PR
commitbrief --unstaged --dir app/Models    # narrow any scope to a directory

Shipped providers: anthropic, openai, gemini, ollama (native API/local), deepseek, mistral, cohere (OpenAI-compatible), openai-compatible (any endpoint you point it at), and claude-cli, gemini-cli, codex-cli (reuse a local CLI subscription, no extra API key). Models, context windows, and per-token pricing: Providers.

Documentation

The full documentation is the source of truth for everything below the front door:

Project Status

Stable. The stable line is an API freeze: CLI flag surface, the JSON schema (--json), COMMITBRIEF.md/OUTPUT.md formats, and the public config keys follow strict semver — breaking changes only ship in the next major line. Details: Compatibility. Upgrading across a major version? See the migration notes in CHANGELOG.md.

Contributing

See CONTRIBUTING.md for the build/test flow, and the org-wide guide for licensing and PR conventions. Bug reports and questions are welcome in Issues and Discussions.

Security

Do not report vulnerabilities in public issues. Use private vulnerability reporting; the full process is in the security policy.

License

GPL-3.0-or-later. Provider SDK dependencies are Apache-2.0 or MIT; the full audit is make license-check.

Directories

Path Synopsis
cmd
commitbrief command
internal
alias
Package alias installs a shell alias (e.g.
Package alias installs a shell alias (e.g.
arch
Package arch is a one-way reader of a sibling tool's (archlint, github.com/muhammetsafak/archlint) public architecture.json config.
Package arch is a one-way reader of a sibling tool's (archlint, github.com/muhammetsafak/archlint) public architecture.json config.
baseline
Package baseline implements signal control SC1 (ADR-0027): a user-private, per-developer record of already-accepted findings so that repeat runs surface only NEW issues instead of re-dumping the whole brownfield backlog every time.
Package baseline implements signal control SC1 (ADR-0027): a user-private, per-developer record of already-accepted findings so that repeat runs surface only NEW issues instead of re-dumping the whole brownfield backlog every time.
cli
clipboard
Package clipboard pushes a text payload onto the host's system clipboard.
Package clipboard pushes a text payload onto the host's system clipboard.
doctor
Package doctor provides a pipeline health check surface for the `commitbrief doctor` subcommand.
Package doctor provides a pipeline health check surface for the `commitbrief doctor` subcommand.
eval
Package eval is CommitBrief's review-quality eval harness (ADR-0018).
Package eval is CommitBrief's review-quality eval harness (ADR-0018).
flaky
Package flaky is CommitBrief's deterministic, static flaky-test anti-pattern detector (ADR-0022).
Package flaky is CommitBrief's deterministic, static flaky-test anti-pattern detector (ADR-0022).
git
graph
Package graph lays a commit list out onto terminal columns ("lanes") so a renderer can draw the DAG the way `git log --graph` does (ADR-0037).
Package graph lays a commit list out onto terminal columns ("lanes") so a renderer can draw the DAG the way `git log --graph` does (ADR-0037).
leaks
Package leaks scans a repository for credential-shaped content (ADR-0036).
Package leaks scans a repository for credential-shaped content (ADR-0036).
logo
Package logo renders a terminal version of the CommitBrief web logo.
Package logo renders a terminal version of the CommitBrief web logo.
mcp
Package mcp implements a minimal Model Context Protocol (MCP) server over the stdio transport using JSON-RPC 2.0 (ADR-0028).
Package mcp implements a minimal Model Context Protocol (MCP) server over the stdio transport using JSON-RPC 2.0 (ADR-0028).
meta
Package meta turns the live binary into a machine-readable inventory of the CLI surface: providers, commands, flags, configuration keys and the MCP review tool's arguments.
Package meta turns the live binary into a machine-readable inventory of the CLI surface: providers, commands, flags, configuration keys and the MCP review tool's arguments.
policy
Package policy implements the declarative merge-policy gate behind the `commitbrief guard` command (ADR-0029).
Package policy implements the declarative merge-policy gate behind the `commitbrief guard` command (ADR-0029).
provider/claude-cli
Package claudecli registers a CLI-tool-backed provider that drives Anthropic's Claude Code (`claude`) binary as the review engine.
Package claudecli registers a CLI-tool-backed provider that drives Anthropic's Claude Code (`claude`) binary as the review engine.
provider/clireview
Package clireview is the shared implementation of CLI-tool-backed review providers.
Package clireview is the shared implementation of CLI-tool-backed review providers.
provider/codex-cli
Package codexcli registers a CLI-tool-backed provider that drives OpenAI's Codex CLI (`codex`) binary as the review engine.
Package codexcli registers a CLI-tool-backed provider that drives OpenAI's Codex CLI (`codex`) binary as the review engine.
provider/cohere
Package cohere implements the Provider interface against Cohere's OpenAI-compatibility endpoint (https://api.cohere.ai/compatibility/v1), reusing the openai-go SDK — no new dependency.
Package cohere implements the Provider interface against Cohere's OpenAI-compatibility endpoint (https://api.cohere.ai/compatibility/v1), reusing the openai-go SDK — no new dependency.
provider/deepseek
Package deepseek implements the Provider interface against DeepSeek's OpenAI-compatible Chat Completions API.
Package deepseek implements the Provider interface against DeepSeek's OpenAI-compatible Chat Completions API.
provider/gemini-cli
Package geminicli registers a CLI-tool-backed provider that drives Google's Gemini CLI (`gemini`) binary as the review engine.
Package geminicli registers a CLI-tool-backed provider that drives Google's Gemini CLI (`gemini`) binary as the review engine.
provider/mistral
Package mistral implements the Provider interface against Mistral's OpenAI-compatible Chat Completions API (https://api.mistral.ai/v1), reusing the openai-go SDK — no new dependency.
Package mistral implements the Provider interface against Mistral's OpenAI-compatible Chat Completions API (https://api.mistral.ai/v1), reusing the openai-go SDK — no new dependency.
provider/openai-compatible
Package openaicompat implements the Provider interface against any endpoint that speaks the OpenAI Chat Completions protocol (vLLM, LM Studio, OpenRouter, a corporate gateway, ...).
Package openaicompat implements the Provider interface against any endpoint that speaks the OpenAI Chat Completions protocol (vLLM, LM Studio, OpenRouter, a corporate gateway, ...).
remote
Package remote drives GitHub operations (currently PR review) through the user's `gh` CLI.
Package remote drives GitHub operations (currently PR review) through the user's `gh` CLI.
suppress
Package suppress implements signal control SC2 (ADR-0027): inline, in-source suppression of a single finding via a visible, reasoned comment marker on (or directly above) the offending line.
Package suppress implements signal control SC2 (ADR-0027): inline, in-source suppression of a single finding via a visible, reasoned comment marker on (or directly above) the offending line.
tokens
Package tokens carries the shared token-count heuristic used by every provider's EstimateTokens implementation plus the internal/diff and internal/compress consumers.
Package tokens carries the shared token-count heuristic used by every provider's EstimateTokens implementation plus the internal/diff and internal/compress consumers.
ui
upgrade
Package upgrade implements `commitbrief upgrade`: detecting how the running binary was installed, asking GitHub Releases whether a newer version exists, and either delegating to the owning package manager or replacing a manually installed binary in place.
Package upgrade implements `commitbrief upgrade`: detecting how the running binary was installed, asking GitHub Releases whether a newer version exists, and either delegating to the owning package manager or replacing a manually installed binary in place.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL