Gemini CLI Extension: Code Review — Quality Checks
Gemini CLI extension for automated code review. Analyzes code quality, suggests improvements, and checks coding standards.
What it is
This is a Gemini CLI extension that adds automated code review capabilities to your terminal workflow. It analyzes code quality, checks adherence to coding standards, and suggests improvements. The extension leverages Gemini models to provide contextual feedback on code changes.
It is designed for developers who want quick quality feedback without leaving the terminal. Useful for pre-commit checks, pull request preparation, or learning better coding patterns.
How it saves time or tokens
Manual code review is slow and inconsistent. This extension automates the first pass, catching style violations, potential bugs, and complexity issues before a human reviewer sees the code. By running locally in the CLI, it avoids round-trips to web interfaces. The estimated token cost per review is around 500 tokens, making it efficient for frequent use.
How to use
- Install the Gemini CLI and configure your API key.
- Add the code review extension to your Gemini CLI configuration.
- Run the review command against your changed files or a specific file path.
- Read the output and apply suggested changes.
# Install Gemini CLI
npm install -g @google/gemini-cli
# Configure API key
gemini auth login
# Run code review on a file
gemini review src/main.ts
# Review staged changes
gemini review --staged
# Review with specific focus
gemini review --focus security src/auth.ts
Example
A typical review output:
[WARN] src/main.ts:42 - Variable 'data' is reassigned but could be const
[ERROR] src/main.ts:78 - Potential null dereference: 'user.name' accessed without null check
[STYLE] src/main.ts:91 - Function exceeds 50 lines, consider extracting helper
[OK] src/utils.ts - No issues found
Summary: 1 error, 1 warning, 1 style suggestion across 2 files
Related on TokRepo
- Coding tools — More AI-assisted development tools
- Automation tools — Workflow automation for developers
Common pitfalls
- The extension requires a valid Gemini API key. Free-tier rate limits may throttle frequent use.
- Large files produce verbose output. Use file-specific or staged-only mode to keep reviews focused.
- Review suggestions are AI-generated and may not always align with your project conventions. Treat them as a second opinion, not gospel.
- The extension does not execute code. It cannot catch runtime errors, only static patterns.
- Network connectivity is required for each review call since it sends code to the Gemini API.
- Review the official documentation before deploying to production to ensure compatibility with your specific environment and requirements.
Frequently Asked Questions
The extension supports any language that Gemini models can analyze, including TypeScript, JavaScript, Python, Go, Java, Rust, and C++. Quality of suggestions varies by language, with mainstream languages getting better coverage.
No. The extension sends code to the Gemini API for analysis, so an active internet connection is required. This also means your code is transmitted to Google servers during review.
Each review consumes roughly 500 tokens depending on file size. With Gemini free tier, you get a generous daily quota. For heavy use, a paid API plan keeps reviews uninterrupted.
Yes. You can pass a --focus flag to prioritize areas like security, performance, or style. You can also provide a custom ruleset file that defines your project-specific coding standards.
ESLint and Prettier enforce deterministic rules (formatting, syntax). The Gemini review extension provides semantic analysis: it catches logic issues, suggests refactoring patterns, and explains why a change matters. They complement each other.
Citations (3)
- Google Gemini CLI GitHub— Gemini CLI provides terminal-based AI capabilities
- Google AI for Developers— Gemini models support code analysis and generation
- Google Cloud Code Review Docs— Static analysis complements AI-powered code review
Related on TokRepo
Source & Thanks
Created by Google. Licensed under Apache 2.0. gemini-cli-extensions/code-review Part of Gemini CLI — ⭐ 99,400+
Discussion
Related Assets
/babysit — Auto-Respond to PR Review Comments
Open-source slash command that watches a PR for review comments and auto-pushes fixes. Inspired by Boris Cherny's /babysit pattern.
/loop — Local Recurring Task Scheduler (Boris-Style)
Open-source slash command for recurring local Claude Code tasks with a 3-day safety cap. Inspired by Boris Cherny's /loop scheduler.
/batch — Parallel Worktree Migration Slash Command
Open-source slash command that splits a migration across parallel git worktrees. Inspired by Boris Cherny's /batch worktree pattern.