Skip to content

The command line

The same review runs anywhere Python 3.12+ does:

Terminal window
pipx install codemop # or: uv tool install codemop
export ANTHROPIC_API_KEY=sk-ant-...
codemop review owner/repo#123 # a pull request (GITHUB_TOKEN or `gh auth login` for private repos)
codemop review owner/repo#123 --post # ...and post the review on it
git diff main | codemop review - # your local changes

It prints each issue with its file and line, the reason, and a fix where it has one, then the tokens used and an estimated cost; --json prints it for scripts. codemop review --help lists every option, including --provider, --model and --no-context. A commit already reviewed with --post isn’t reviewed (or paid for) again.

With a local model (Ollama): no API key, no cost per review, and the code never leaves your computer. It’s slower, and small models review less well.

Terminal window
ollama pull qwen2.5-coder:7b
codemop review owner/repo#123 --provider ollama --model qwen2.5-coder:7b

Ollama gives models a 4,096-token context window by default, which is too small: set OLLAMA_CONTEXT_LENGTH=16384 for the Ollama server and restart it. CodeMop checks the token count Ollama reports back, and stops with an error rather than review a fragment.