6 releases (3 breaking)

Uses new Rust 2024

new 0.13.1 Feb 17, 2026
0.12.2 Feb 12, 2026
0.5.0 Dec 24, 2025

#841 in Command line utilities

MIT license

525KB
11K SLoC

gcop-rs

License: MIT Crates.io Downloads CI

AI-powered Git CLI — generate commit messages, review code, manage workflows, all from your terminal. Written in Rust.

Rust rewrite inspired by gcop by Undertone0809.

中文文档 | Documentation

Features

  • AI Commit Messages — Generate conventional commits via Claude, OpenAI, Gemini, or Ollama
  • Code Review — AI-powered review with security & performance insights
  • Monorepo Support — Auto-detect Cargo, Pnpm, Npm, Lerna, Nx, Turbo workspaces and infer commit scope
  • Git Aliases — Shortcuts like git c, git r, git acp for streamlined workflow
  • Git Hookprepare-commit-msg hook for seamless editor integration
  • Custom Providers — Any OpenAI/Claude-compatible API (DeepSeek, custom endpoints, etc.)
  • Custom Prompts — Template variables for commit & review prompt customization
  • Project Config — Per-repo .gcop/config.toml overrides user config
  • GPG Signing — Full support via native git
  • Beautiful CLI — Spinner animations, streaming output, colored text, interactive menus

Quick Start

1. Install

# Homebrew (macOS/Linux)
brew tap AptS-1547/tap
brew install gcop-rs

# pipx (Python users)
pipx install gcop-rs

# cargo-binstall (prebuilt binary, no compilation)
cargo binstall gcop-rs

# cargo install (from source)
cargo install gcop-rs

See Installation Guide for more options.

2. Configure

gcop-rs init

The interactive wizard creates your config file and optionally installs git aliases.

Or set up manually — use gcop-rs config edit to open your config in the system editor:

[llm]
default_provider = "claude"

[llm.providers.claude]
api_key = "sk-ant-your-key-here"
model = "claude-sonnet-4-5-20250929"

Config locations: ~/.config/gcop/ (Linux), ~/Library/Application Support/gcop/ (macOS), %APPDATA%\gcop\config\ (Windows).

Environment overrides: GCOP__LLM__PROVIDERS__CLAUDE__API_KEY, etc. See Configuration Guide.

3. Use

git add .
gcop-rs commit            # Generate AI commit message → review → commit
gcop-rs review changes    # AI review of working tree changes

# Or with aliases (after gcop-rs alias):
git c                     # = gcop-rs commit
git acp                   # Add all → AI commit → push

The commit workflow is interactive — after generation, you can accept, edit, retry, or retry with feedback (e.g. "use Chinese", "be more concise") to refine the result.

Commands

Command Description
gcop-rs commit Generate AI commit message for staged changes
gcop-rs review <target> Review changes / commit <hash> / range <a..b> / file <path>
gcop-rs init Interactive configuration setup
gcop-rs config edit Edit config with post-save validation
gcop-rs config validate Validate config & test provider connection
gcop-rs alias Install / list / remove git aliases
gcop-rs stats Repository commit statistics
gcop-rs hook install Install prepare-commit-msg hook
gcop-rs hook uninstall Remove the hook

Global flags: -v verbose, --provider <name> override, --format text|json|markdown, --dry-run.

See Command Reference for full details.

Git Aliases

Install with gcop-rs alias or during gcop-rs init.

Alias Action
git c AI commit
git r AI review changes
git s Repository stats
git ac Add all + AI commit
git cp AI commit + push
git acp Add all + AI commit + push
git gconfig Edit gcop-rs config
git p Push
git pf Force push (--force-with-lease)
git undo Undo last commit (keep staged)

Manage: --list, --force, --remove --force. See Aliases Guide.

Documentation

Requirements

  • Git 2.0+
  • API key for at least one provider (Claude, OpenAI, Gemini), or local Ollama
  • Rust 1.88.0+ (only if building from source)

License

MIT — see LICENSE.

Credits

This project is a Rust rewrite inspired by gcop by Undertone0809. The core concept of AI-powered commit message generation originated from that project.

Authors: AptS-1547, AptS-1738, uaih3k9x

Dependencies

~42–65MB
~1M SLoC