Skip to main content

An AI-powered Agent and CLI for Gerrit Code Review

Project description

🤖 Gerrit Agent

AI-Powered Code Review Assistant for Gerrit

PyPI version License: MIT Python 3.10+

Transform your Gerrit code reviews with AI-powered analysis using Claude Code, Gemini CLI, and other advanced Code Agents.

FeaturesUsage ModesDocumentationContributing


📖 Overview

Gerrit Agent transforms Gerrit code reviews with AI-powered analysis. Get automated, intelligent code reviews through Claude Code Plugin, standalone CLI, or Gemini integration - with multi-agent analysis, confidence scoring, and inline comment posting.

Key Features:

  • 🤖 Multi-Agent Reviews - 3 specialized analyzers (CLAUDE.md compliance, git patterns, documentation)
  • 🎯 Smart Filtering - Confidence scoring shows only high-quality findings (≥80%)
  • 💬 Direct Integration - Posts inline comments to Gerrit with your approval
  • Modern CLI - GitHub CLI-like interface for all Gerrit operations
  • 🔌 Multiple Modes - Claude Code Plugin, standalone CLI, or Gemini extension

🎯 Usage Modes

💻 Standalone CLI

GitHub CLI-like interface for Gerrit operations (list, view, checkout, review). This is the foundation of the project - all other modes are built on top of this CLI.

Installation:

# Install from PyPI
pip install gerrit-agent

# Or install from source
git clone https://github.com/madroidmaq/gerrit-agent.git
cd gerrit-agent
pip install -e .

Configuration:

Set up your Gerrit credentials (required for all usage modes):

# Method 1: Environment variables (recommended)
export GERRIT_URL=https://gerrit.example.com
export GERRIT_USERNAME=your_username
export GERRIT_TOKEN=your_http_token  # Recommended: HTTP password from Gerrit settings

# Method 2: Or use password instead of token
export GERRIT_PASSWORD=your_password  # Less secure, use token when possible

💡 Getting your token: Go to Gerrit → Settings → HTTP Credentials → Generate Password

📝 For persistent config: Copy .env.example to .env and edit with your credentials

Common Commands:

# List changes
gerrit list --owner me --status open
gerrit list --reviewer me --limit 20

# View change details
gerrit show 12345                   # View change info
gerrit show 12345 --diff            # View with full diff

# Checkout change locally
gerrit checkout 12345               # Creates local branch for review

# Post reviews
gerrit review 12345 --code-review +2 -m "LGTM!"
gerrit review 12345 --code-review -1 -m "Needs fixes"

📚 Full CLI reference →


🤖 Claude Code Plugin

AI-powered code reviews with multi-agent analysis and confidence scoring, built on top of the Standalone CLI. Recommended for the best experience.

Prerequisites:

  • Install the gerrit-agent CLI tool (see Standalone CLI above)
  • Configure Gerrit credentials using environment variables (see CLI configuration above)

Installation:

# Option 1: Using commands (recommended)
/plugin marketplace add madroidmaq/gerrit-agent
/plugin install gerrit@gerrit-agent

# Option 2: Using UI
# Run: /plugin marketplace add madroidmaq/gerrit-agent
# Then select: Browse and install plugins → gerrit-agent → gerrit → Install now

Usage:

Method Command Description
Command /gerrit:review 12345 Direct review command (recommended)
Natural language "Review Gerrit change 12345" Triggers gerrit-reviewer skill

What happens during review:

  • 🤖 Three specialized agents analyze your code (compliance, git patterns, documentation)
  • 🎯 Smart filtering shows only high-confidence findings (≥80%)
  • 💬 Posts inline comments to Gerrit (with your approval)

📚 Full plugin documentation →


🧠 Gemini CLI Extension

Natural language code reviews with "Principal Software Engineer" persona, powered by Google's Gemini.

Prerequisites:

Ensure you've configured Gerrit credentials as described in Standalone CLI Configuration above.

Installation:

# Link the extension to Gemini CLI
gemini extensions link https://github.com/madroidmaq/gerrit-agent/gemini-cli-extensions

Usage:

# Use natural language to review changes
gemini "Review change 12345"
gemini "Check the latest changes in project XYZ"

📚 Full documentation →


📚 Documentation


🤝 Contributing

Contributions welcome! See Issues for planned features.

git clone https://github.com/madroidmaq/gerrit-agent.git && cd gerrit-agent
uv sync --extra dev && uv run pytest

📄 License

MIT License - see LICENSE file.


Built with Click, Rich, httpx, Pydantic

If you find this helpful, please ⭐ star the repo!

Report BugRequest Feature

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gerrit_agent-0.1.0.tar.gz (91.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gerrit_agent-0.1.0-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file gerrit_agent-0.1.0.tar.gz.

File metadata

  • Download URL: gerrit_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 91.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for gerrit_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f003c7763152f01c2dbdd6d856a70ad5b3c957fd9c0ca109bc6bd8f1229e15b8
MD5 7eddf3eab0d993be59dc5d2efcb65677
BLAKE2b-256 fecf48049418d187d5d6dd65afb606654793ff5946a7216638821aaf023f2d2d

See more details on using hashes here.

File details

Details for the file gerrit_agent-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gerrit_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be87f6903bb4cfa0a282d4fd4da804a2ea2b109a874c5517b982bf6ad5fb3d0c
MD5 09a0a29ab94b4436a8cb922d209e767e
BLAKE2b-256 5b75312b0f54a4e99a8b5fcdf1d0d6338ed4f9b1c2d6b3074506cf31cbbaca7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page