Open Code Review: Let AI Handle Your First Pass at Code Reviews
You know that feeling when you open a PR and immediately spot something obvious? Missing error handling. A logic gap. A formatting nitpick that’s clearly a copy-paste leftover. You could leave a comment, but it feels like noise.
What if the machine caught those things before you even opened the diff?
Open Code Review is a new open source CLI tool from Alibaba that does exactly that. It reads your Git diff, feeds it to an LLM (like GPT-4 or DeepSeek), and spits out structured, context-aware review comments. No dashboard. No plugin. Just your terminal.
What It Does
Under the hood, open-code-review is dead simple:
- You run the CLI (either standalone or in a CI/CD pipeline).
- It grabs the current Git diff (uncommitted changes or a specific commit range).
- It sends that diff to a configured LLM with a prompt designed to catch bugs, style issues, and logical errors.
- It outputs the review comments in a clean, markdown-friendly format.
The output groups comments by file, each with a category like "bug risk," "improvement suggestion," or "style nit." You can pipe it to a file, a PR comment endpoint, or just read it in your terminal.
Why It’s Cool
It doesn’t try to replace your reviewer. That’s the key. The tool is intentionally positioned as a first pass. Think of it as a linter on steroids. It catches the kind of boring, repetitive issues that make human reviewers zone out, so the actual review conversation can focus on architecture, trade-offs, and design.
A few specific things I like:
- It works with any Git project. No platform lock-in. Use it with GitHub, GitLab, or a bare repo on your laptop.
- Multiple model backends. Supports OpenAI, DeepSeek, and local models via Ollama. You can pick the cheapest or most private option depending on your needs.
- Prompt is customizable. You can tweak the system prompt to match your team’s style guide or focus on specific languages.
- No config hell. A single
OPENAI_API_KEYor equivalent, and you’re good. The tool infers the diff from your current branch state.
The implementation is straightforward Rust (it’s fast), but the design philosophy is what stands out. It respects that you work in Git, not in a web UI.
How to Try It
Installation is one command if you have Rust installed:
cargo install open-code-review
Or grab the binary from the GitHub releases page.
Then, in any Git repo:
export OPENAI_API_KEY="sk-..."
open-code-review
It’ll print the AI’s review to stdout. Want to review a specific commit range? open-code-review --commit-range HEAD~3..HEAD. Want to output to a file? --output review.md.
For CI integrations, they have examples for GitHub Actions and GitLab CI in the repo readme. It’s plug-and-play.
Final Thoughts
I’ve been using this on my side projects for a week. The results are… honest. Sometimes it catches a real bug I missed. Sometimes it bikesheds about variable naming. That’s fine. The mental model is: run it before you submit a PR to catch the dumb stuff, and before you review someone else’s PR to offload the obvious comments.
Is it a game changer? No. But it’s a genuinely useful tool that respects your workflow. If you’ve ever wanted an AI that helps rather than replaces, this is worth a spin.
Found this on @githubprojects
Repository: https://github.com/alibaba/open-code-review