CommitBrief:本地 LLM 代码审查 CLI,支持 git diff 与 GitHub PR
CommitBrief/commitbrief
CommitBrief 是一款本地 LLM 代码审查 CLI,可在终端审查暂存/未暂存改动、任意 git diff 范围或 GitHub PR,输出支持彩色 markdown、markdown 文件或严格 JSON。
Local LLM code review CLI for git diffs — review staged/unstaged changes, any git diff range, or a GitHub PR, right in your terminal.
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), 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:
- Which command do I need? — decision table across the whole command surface
- Output formats — Cards, JSON schema, Markdown
- Review pull requests and Gate CI on findings
- MCP server — let an AI agent self-review
- Policy gate — declarative
.commitbrief/policy.yml - Configuration and Filtering scope
- Credential audit — leaks
- FAQ / Troubleshooting
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.
来源:GitHub · github.com