gcg is a fast and lightweight CLI tool written in Rust that uses LLMs to automatically generate meaningful Git commit messages from your code changes.
- 🔍 Parses your
git difffiles and suggests a relevant commit message. - 🤖 Supports multiple LLM providers:
- Google Gemini
- Local models via Ollama
- OpenAI-compatible APIs
- ⚡ Fast and efficient — written in Rust
- Clone the repository and build:
git clone https://github.com/daniel-mosko/gcg.git
cd gcg
cargo install --path .You can provide a configuration file named gcg.yaml in one of the following locations:
- In your project repository (local config)
- In the global config directory:
$HOME/.config/gcg/ - Or rely on the default configuration shown below:
provider:
name: "ollama"
api_url: "http://127.0.0.1:11434/api/generate"
model: "llama-3.2-3b-instruct:latest"
prompt_template: |
You are an AI assistant that generates concise, short and clear Git commit messages from code diffs.
---
**Guidelines for Commit Messages:**
* Start with a **type** (e.g., `feat`, `fix`, `docs`, `refactor`, `chore`) followed by a colon and a space, then the **subject**.
* The subject line should be **imperative**, **50 characters or less**, and concisely describe the change.
* Optionally, include a blank line followed by a **body** with bullet points (`-`). Each bullet point should clearly explain a specific aspect of the change.
* Focus strictly on the changes presented in the diff.
---
**Code Diff to Analyze:**gcg "repo/path"feat: Add error handling to auth middleware
- Refactored login logic in auth.rs
- Added error messages for invalid tokens