grit-msg is a fast cross-platform Rust CLI that generates Conventional Commit messages from staged Git diffs using the Groq API.
- Reads staged changes with
git diff --cached - Summarizes large diffs to fit model context limits
- Interactive safety prompt:
y / n / copy - Copies generated message to clipboard (
copy) - Secure key storage with keyring, plus resilient local fallback
git- A Groq API key: https://console.groq.com/keys
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/besingamkb/grit-msg/main/install.sh | bashWindows (PowerShell):
irm https://raw.githubusercontent.com/besingamkb/grit-msg/main/install.ps1 | iexOptional version pin:
VERSION=v0.1.1 curl -fsSL https://raw.githubusercontent.com/besingamkb/grit-msg/main/install.sh | bashIf grit-msg is not found after install, add the bin directory to PATH:
macOS / Linux:
export PATH="$HOME/.local/bin:$PATH"
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcWindows (PowerShell, then restart terminal):
setx PATH "$([Environment]::GetEnvironmentVariable('Path','User'));$HOME\.local\bin"Release archives are published automatically when a tag like v0.1.0 is pushed.
cargo build --release --lockedBinary:
target/release/grit-msggrit-msgOptions:
grit-msg --model llama-3.3-70b-versatile --diff-token-budget 6000
grit-msg --clear-aiapi-keys
grit-msg --with-watermarkNotes:
- If no staged changes exist, the tool exits with an error.
--clear-aiapi-keysremoves stored keys from keyring + fallback files.GROQ_API_KEYenvironment variable is supported and takes precedence.--with-watermarkappends a final watermark line only when committing withy/yes(not shown in preview/copy output).
cargo fmt --all
cargo check
cargo testgit tag v0.1.0
git push origin v0.1.0