A Rust-based Git plugin that generates Git Flow–style commit messages from your staged diff using a local llama.cpp model.
See the codeGit Commit Analyzer is a Rust-based Git plugin that generates Conventional Commits messages from your staged diff using a local llama.cpp model. The CLI summarises large diffs, validates model output, and falls back to deterministic messages when needed.
llama_cpp_sys_2 to run GGUF models without any remote API calls./no_think for fast structured output).<type>(<scope>): <subject> and retries/falls back when they don't.macOS users can install via Homebrew with pre-built binaries (no Rust compilation required):
brew tap zh30/tap
brew install git-ca
This installs a pre-built binary for your platform:
No Rust toolchain or compilation needed! The binary is automatically downloaded from GitHub Releases.
Note: If you encounter a version mismatch error, try:
brew update
brew upgrade git-ca
Or install from source:
brew install --build-from-source git-ca
Linux builds are temporarily disabled due to compilation issues. Windows builds are available via GitHub Releases but not distributed via Homebrew.
Download the appropriate binary for your platform from Releases:
# macOS (Apple Silicon)
curl -L -o git-ca.tar.gz https://github.com/zh30/git-commit-analyzer/releases/download/v2.0.12/git-ca-2.0.12-apple-darwin-arm64.tar.gz
tar -xzf git-ca.tar.gz
sudo mv git-ca /usr/local/bin/
chmod +x /usr/local/bin/git-ca
Note: Linux builds are temporarily disabled. Windows builds are available via GitHub Releases.
If you prefer to build from source:
git clone https://github.com/zh30/git-commit-analyzer.git
cd git-commit-analyzer
cargo build --release
sudo cp target/release/git-ca /usr/local/bin/
bash -c "$(curl -fsSL https://sh.zhanghe.dev/install-git-ca.sh)"
On first run the CLI will:
Probe system memory and recommend a model tier:
small (Qwen3-0.6B) — low-RAM / older machines, ~4K contextdefault (Qwen3-1.7B) — balanced, ~8K contextquality (Qwen3-4B) — higher quality when memory allows, ~16K contextScan for models in common directories:
./models (project directory)~/.cache/git-ca/models (Linux/macOS)~/.local/share/git-ca/models (Linux alt)~/Library/Application Support/git-ca/models (macOS)Download a tier model automatically if none found (Q4 GGUF from Hugging Face into ~/.cache/git-ca/models/).
Prompt interactively when multiple models/tiers are available:
git ca model # Interactive selector (tiers + local GGUFs)
git ca model pull # Auto-download recommended tier
git ca model pull quality # Force a specific tier
git add <files>
git ca
For each invocation:
git ca model — Interactive model / tier selectorgit ca model pull [small|default|quality|<repo>] — Download a tier or custom HF GGUF repogit ca language — Choose English or Simplified Chinese promptsgit ca doctor — Hardware profile + model loading smoke testgit ca --version — Display version informationOptional git config overrides:
git config --global commit-analyzer.model-tier default # small | default | quality
git config --global commit-analyzer.context 8192 # token context length
cargo fmt
cargo clippy -- -D warnings
cargo test
cargo run -- git ca # try against staged changes
Key modules:
src/main.rs — CLI orchestration, diff summariser, fallback generator.src/llama.rs — llama.cpp session management.Fully automated release via GitHub Actions:
git tag v1.1.2 && git push origin v1.1.2homebrew-tap repositorybrew install git-caNote: Linux builds are temporarily disabled due to compilation issues. Windows builds are available via GitHub Releases but not distributed via Homebrew.
See DEPLOY.md for complete release documentation.
Pull requests are welcome. Please include:
cargo fmt / cargo clippy -- -D warnings / cargo test outputs,README*.md, AGENTS.md, DEPLOY.md) when behaviour changes,git ca verification if applicable.Released under the MIT License. See LICENSE for details.
87 commits
Rust
88.2%
Shell
10.5%
Ruby
1.2%
A Rust-based Git plugin that generates Git Flow–style commit messages from your staged diff using a local llama.cpp model.
See the codeGit Commit Analyzer is a Rust-based Git plugin that generates Conventional Commits messages from your staged diff using a local llama.cpp model. The CLI summarises large diffs, validates model output, and falls back to deterministic messages when needed.
llama_cpp_sys_2 to run GGUF models without any remote API calls./no_think for fast structured output).<type>(<scope>): <subject> and retries/falls back when they don't.macOS users can install via Homebrew with pre-built binaries (no Rust compilation required):
brew tap zh30/tap
brew install git-ca
This installs a pre-built binary for your platform:
No Rust toolchain or compilation needed! The binary is automatically downloaded from GitHub Releases.
Note: If you encounter a version mismatch error, try:
brew update
brew upgrade git-ca
Or install from source:
brew install --build-from-source git-ca
Linux builds are temporarily disabled due to compilation issues. Windows builds are available via GitHub Releases but not distributed via Homebrew.
Download the appropriate binary for your platform from Releases:
# macOS (Apple Silicon)
curl -L -o git-ca.tar.gz https://github.com/zh30/git-commit-analyzer/releases/download/v2.0.12/git-ca-2.0.12-apple-darwin-arm64.tar.gz
tar -xzf git-ca.tar.gz
sudo mv git-ca /usr/local/bin/
chmod +x /usr/local/bin/git-ca
Note: Linux builds are temporarily disabled. Windows builds are available via GitHub Releases.
If you prefer to build from source:
git clone https://github.com/zh30/git-commit-analyzer.git
cd git-commit-analyzer
cargo build --release
sudo cp target/release/git-ca /usr/local/bin/
bash -c "$(curl -fsSL https://sh.zhanghe.dev/install-git-ca.sh)"
On first run the CLI will:
Probe system memory and recommend a model tier:
small (Qwen3-0.6B) — low-RAM / older machines, ~4K contextdefault (Qwen3-1.7B) — balanced, ~8K contextquality (Qwen3-4B) — higher quality when memory allows, ~16K contextScan for models in common directories:
./models (project directory)~/.cache/git-ca/models (Linux/macOS)~/.local/share/git-ca/models (Linux alt)~/Library/Application Support/git-ca/models (macOS)Download a tier model automatically if none found (Q4 GGUF from Hugging Face into ~/.cache/git-ca/models/).
Prompt interactively when multiple models/tiers are available:
git ca model # Interactive selector (tiers + local GGUFs)
git ca model pull # Auto-download recommended tier
git ca model pull quality # Force a specific tier
git add <files>
git ca
For each invocation:
git ca model — Interactive model / tier selectorgit ca model pull [small|default|quality|<repo>] — Download a tier or custom HF GGUF repogit ca language — Choose English or Simplified Chinese promptsgit ca doctor — Hardware profile + model loading smoke testgit ca --version — Display version informationOptional git config overrides:
git config --global commit-analyzer.model-tier default # small | default | quality
git config --global commit-analyzer.context 8192 # token context length
cargo fmt
cargo clippy -- -D warnings
cargo test
cargo run -- git ca # try against staged changes
Key modules:
src/main.rs — CLI orchestration, diff summariser, fallback generator.src/llama.rs — llama.cpp session management.Fully automated release via GitHub Actions:
git tag v1.1.2 && git push origin v1.1.2homebrew-tap repositorybrew install git-caNote: Linux builds are temporarily disabled due to compilation issues. Windows builds are available via GitHub Releases but not distributed via Homebrew.
See DEPLOY.md for complete release documentation.
Pull requests are welcome. Please include:
cargo fmt / cargo clippy -- -D warnings / cargo test outputs,README*.md, AGENTS.md, DEPLOY.md) when behaviour changes,git ca verification if applicable.Released under the MIT License. See LICENSE for details.
87 commits
Rust
88.2%
Shell
10.5%
Ruby
1.2%