A fast CLI for Gerrit Code Review, built in Rust. Talks to the Gerrit REST API and wraps common workflows into git-style commands.
One-liner (Linux & macOS):
curl -fsSL https://raw.githubusercontent.com/KonradStanski/gerrit-cli/main/install.sh | shOr install to a custom directory:
GERRIT_INSTALL_DIR=~/.local/bin curl -fsSL https://raw.githubusercontent.com/KonradStanski/gerrit-cli/main/install.sh | shFrom source (requires Rust toolchain):
cargo install --git https://github.com/KonradStanski/gerrit-cli gerrit-cliManual download: grab a binary from the latest release.
# Point gerrit at your server
gerrit config init
# List open changes for the current repo
gerrit ls
# Show details of a specific change
gerrit show 12345
# Checkout a change locally
gerrit checkout 12345
# Push your current branch for review
gerrit push
# Post a Code-Review +1
gerrit review 12345 --code-review 1 --message "LGTM"| Command | Alias | Description |
|---|---|---|
gerrit ls |
changes |
List/query changes on the Gerrit server |
gerrit show <change> |
Show full change details | |
gerrit checkout <change> |
co |
Fetch and checkout a change locally |
gerrit push |
Push current branch for review (refs/for/<branch>) |
|
gerrit comments <change> |
View messages on a change | |
gerrit review <change> |
Post a review with scores | |
gerrit submit <change> |
Submit a change for merging | |
gerrit abandon <change> |
Abandon a change | |
gerrit projects |
List projects on the Gerrit server | |
gerrit clone <project> |
Clone a project with hooks pre-configured | |
gerrit install-hooks |
Install Gerrit commit-msg hook into current repo | |
gerrit config |
Manage CLI configuration |
# All open changes for the current project
gerrit ls
# Filter by owner and branch
gerrit ls --owner self --branch main
# Custom query
gerrit ls --query "status:open label:Code-Review+2"
# Limit results
gerrit ls -n 10# Clone a project (SSH, default port 29418)
gerrit clone my/project
# Clone into a specific directory
gerrit clone my/project my-dir
# Clone over HTTPS instead of SSH
gerrit clone my/project --http# List all projects
gerrit projects
# Filter by regex
gerrit projects --filter "my-team/"
# Limit results
gerrit projects -n 20# Checkout latest patchset
gerrit checkout 12345
# Checkout a specific patchset
gerrit checkout 12345 --patchset 3
# Checkout into a named branch
gerrit checkout 12345 --branch my-feature# Push for review on the auto-detected target branch
gerrit push
# Push to a specific branch
gerrit push --branch develop
# Push with topic and reviewers
gerrit push --topic my-feature --reviewers alice,bob
# Push as work-in-progress
gerrit push --wip# Code-Review +2
gerrit review 12345 --code-review 2
# Verified +1 with a message
gerrit review 12345 --verified 1 --message "Tests pass"# Show change messages (review comments, CI results, etc.)
gerrit comments 12345
# Show inline file comments
gerrit comments 12345 --inline# Install the Gerrit commit-msg hook into the current repo
gerrit install-hooksThe commit-msg hook is also installed automatically when you run gerrit checkout or gerrit clone.
Config lives at ~/.config/gerrit-cli/config.toml. Run gerrit config init for interactive setup, or set values directly:
gerrit config set remotes.myserver.url https://review.example.com
gerrit config set remotes.myserver.username jdoe
gerrit config set default.remote myserverShow current config:
gerrit config showPasswords are resolved in order:
GERRIT_PASSWORDenvironment variablegit credential fill(works with credential helpers,.netrc, macOS Keychain, etc.)
The password is never stored in the config file. Use your OS credential manager or a .netrc entry:
machine review.example.com login jdoe password your-http-password
If no URL is configured, gerrit-cli will try to detect the Gerrit server from your git remote URL. This works for most setups where the remote points at the Gerrit host.
The project name is also auto-detected from the remote, so gerrit ls works without any flags inside a cloned repo.
The repo is a Cargo workspace with two crates:
gerrit-api— Pure Rust library for the Gerrit REST API. No CLI concerns. Can be used independently in other tools.gerrit-cli— Thegerritbinary. Depends ongerrit-api.
MIT