AI code reviews.
Right in your terminal.
A provider-agnostic, local-first CLI that reviews your staged changes, a historic range, or a whole GitHub pull request —before your colleagues do. Zero telemetry. No server.
CommitBrief is an open-source AI code review CLI that reviews git diffs — staged changes, a commit range, or a GitHub pull request — from your terminal, a git hook, or CI. You choose the provider: ten are supported, including fully local models through Ollama. It sends no telemetry and is licensed GPL-3.0-or-later.
works with every provider you already pay for
Built like a real CLI.
Not a SaaS in disguise.
Local LLM code review through Ollama needs no API key and no account.
Four guarantees we won't compromise on. Read the sourceon GitHub.
Privacy-first & local-only
No telemetry, no analytics endpoint, no account. Config is plain YAML on disk. Pair with Ollama for a fully offline review loop — no API key, no network egress.
Project rules in plain markdown
Drop a COMMITBRIEF.md next to your README. No DSL, no YAML schema — just the words you'd say in a code review, used as the system prompt.
Engineered for cheap tokens
SHA-256 response cache skips reviews you've already run. Provider prompt caching (Anthropic, OpenAI, Gemini) cuts repeated input cost.--verbose tells you what you saved.
Truly provider-agnostic
Swap between ten providers — seven API backends plus subprocess wrappers around Claude Code, Gemini CLI, and OpenAI Codex — withcommitbrief providers use or per-run--provider. Keep an alternate configured so a 429 is one command away.
From zero to first review
before your coffee finishes brewing.
Run commitbrief setup, optionallycommitbrief init, thencommitbrief; to put AI review in a pre-commit hook, add commitbrief install-hook.
Pick provider, paste key
An interactive wizard cycles through Anthropic, OpenAI, Gemini, DeepSeek, Mistral, Cohere, and Ollama; pings the provider to confirm the key works.
Optional: your own rules
Embedded defaults ship in the binary, so day-one runs work without this step. init writes COMMITBRIEF.md + an OUTPUT.md template you can edit.
Review before you commit
Default scope is your staged diff. Reach any historic range via commitbrief diff <args>, select a set of commits with --author/--start-date/--text, or review a whole PR with commitbrief remote pr <id> — it posts inline comments and a verdict back to GitHub. Gate CI with commitbrief guard against a policy file, or expose the same review to an agent over MCP with commitbrief mcp. Two commands never call a model at all: commitbrief leaks audits your tree and git history for committed credentials, and commitbrief map draws the commit graph so you can see what a filter selected. Output in terminal, plain markdown, or strict JSON.
Your rules file,
on a token diet.
commitbrief compress shrinks your COMMITBRIEF.md review rules file, so each review that reaches the provider sends fewer input tokens.
Three embedded prompts rewrite COMMITBRIEF.md into a denser, equivalent instruction set. Backs up the original under.commitbrief/backups/, applies atomically, and refuses to overwrite when the result isn't actually smaller.
Questions, answered.
What is CommitBrief?
CommitBrief is a Go CLI that runs LLM-powered code reviews on git
diffs — staged, unstaged, or any historic range git diff understands
via the commitbrief diff <args> subcommand (single commit, branch
vs target, PR-style three-dot range, etc.). It runs locally; the only
network egress is to the provider you chose.
It is not a SaaS, a dashboard, a GitHub App, or a bot. There is no account, no server-side state, and no telemetry.
Is CommitBrief free? What license does it use?
Yes. The CLI is free and open source under GPL-3.0-or-later, hosted at github.com/CommitBrief/commitbrief. There’s no subscription, no seat license, and no paid tier.
The only cost is whatever your chosen LLM provider charges per token — and that’s $0 with Ollama (your own local model) or a CLI-tool-backed provider that reuses a subscription you already have.
Can I run it fully offline?
Yes — pick Ollama as the provider. The CLI then talks only to
http://localhost:11434 (or whatever you’ve configured); no API key
is required and no diff leaves your machine.
CommitBrief itself never makes outbound network calls on its own
beyond the provider you chose, except for commands you run that
explicitly talk to GitHub (commitbrief upgrade and remote pr).
There is no telemetry endpoint, no auto-update check, no analytics
beacon.
Is my code sent to the LLM provider? What exactly leaves my machine?
Only what the review needs: the diff text, your COMMITBRIEF.md
rules and — if present — the constraints from architecture.json
(together they form the prompt) — sent directly over HTTPS to the
provider you configured. OUTPUT.md is a local render template
and is never sent. There is no CommitBrief server in between.
A pre-send secret scanner
blocks credential-shaped strings before that call goes out, and
picking Ollama keeps everything on your machine — zero third-party
egress. The -cli providers (claude-cli, gemini-cli, codex-cli)
are different: they hand the prompt to the host CLI you already have
installed, which sends it to its own vendor (Anthropic, Google or
OpenAI). With --with-context, the host CLI may also read and send
surrounding project files. Run commitbrief --staged --show-prompt to see the exact
payload before anything is sent — no provider call, no cost.
How is this different from my editor's AI assistant?
An editor assistant reviews what’s near the cursor, inside one IDE,
against whatever model that tool ships with. CommitBrief reviews the
whole diff — staged changes, a commit range, or a PR — against rules
you declare once in COMMITBRIEF.md, with a provider you pick per
repo, so the same review runs identically from your terminal, a git
hook, or CI.
Neither replaces a human reviewer’s intent-level judgment — “does this function solve the right problem” stays a person’s call. CommitBrief is a pre-check before that person (or your future self) looks at the change.
Catch the bug before
your colleague does.
One install. No account. Free forever — because it's open source.
Add AI code review to GitHub Actions withCommitBrief/commitbrief-action, or gate any CI system with --fail-on.