AI-powered git commit generator that analyzes your staged diff and suggests a Conventional Commits–style message using Google Gemini (via the genai client).
Gitaid stands for Git AI Daemon it reads your staged Git changes (what you'd commit with git commit), generates a clear, conventional commit message using a language model, and offers an interactive flow to accept, regenerate, or discard the suggestion.
- Purpose: reduce commit message friction and improve commit quality.
- Behavior: reads
git diff --cachedand prompts Gemini(Any model, everyone uses their own API Key model which are stored locally in json file, eg i create my json file at C:/Users/george/.config/gitaid/config.json) to generate a Conventional Commit message.
contents of C:/Users/your_name/.config/gitaid/config.json
{
"gemini_key": "YOUR_API_KEY",
"model": "gemini-flash-latest"
}- Generates Conventional Commits-format messages (types like
feat,fix,docs, etc.) - Interactive CLI: accept, regenerate, or quit
- Configurable model (defaults to
gemini-1.5-flash) - Designed for simple pre-commit or manual usage
There are several ways to install Gitaid.
Download the appropriate binary from the Releases page:
https://github.com/004Ongoro/gitaid/releasesUnpack and place the binary in your PATH.
Goreleaser is configured to publish a Homebrew formula to 004Ongoro/homebrew-tap.
brew tap 004Ongoro/homebrew-tap
brew install gitaidInstall Scoop package manager if you havent already, it handles downloads of CLI tools and adds them to PATH
A Scoop bucket 004Ongoro/scoop-bucket is configured in goreleaser.
scoop bucket add 004Ongoro https://github.com/004Ongoro/scoop-bucket
scoop install gitaidYou can build or install directly using Go (Go 1.20+ recommended):
# Build locally
git clone https://github.com/004Ongoro/gitaid.git
cd gitaid
go build -o gitaid ./...
# Or install via `go install`
go install github.com/004Ongoro/gitaid@latestGitaid expects a JSON config file at:
- Linux/macOS/WSL:
$HOME/.config/gitaid/config.json - Windows:
%USERPROFILE%\.config\gitaid\config.json
Example config.json:
{
"gemini_key": "YOUR_GEMINI_API_KEY",
"model": "gemini-1.5-flash"
}gemini_key(required): API key used by the Gemini client.model(optional): model name to use; defaults togemini-1.5-flash.
Important: do not commit your API key to source control.
- Stage your changes:
git add <files>- Run Gitaid in the repository root:
gitaidGitaid will:
- Validate it's inside a git repo
- Get the staged diff (
git diff --cached) - Send the diff + system prompt to Gemini
- Print the suggested commit message and prompt you:
(a) accept & commit— runsgit commit -m "..."(r) regenerate— re-generate with the same diff(q) quit— discard message and exit
Example interactive flow:
Analyzing changes and generating commit message...
--- Suggested Commit Message --- feat(auth): add session timeout enforcement
The commit adds a 30-minute session timeout which expires tokens and redirects users to the login page. This prevents long-lived sessions and reduces risk in case of compromised tokens.
Options: (a)ccept & commit, (r)egenerate, (q)uit:
- "config file not found" — create the config file at
$HOME/.config/gitaid/config.jsonwithgemini_keyas shown above. - "not a git repository" — run
gitaidfrom inside a git repository. - "no staged changes found" — stage changes with
git addbefore running. - "AI generation failed" — check your API key, quota, and network connectivity.
Privacy note: The diff content is sent to the Gemini API — avoid staging secrets or PII.
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a branch:
git checkout -b feat/my-feature - Make changes and add tests where appropriate
- Run
go vet,gofmt, andgo test(or your preferred linters) - Open a Pull Request and describe the change
Guidelines:
- Keep changes small and focused
- Follow Go idioms and existing code style
- Write tests for new behavior when possible
Maintainers will review, request changes if needed, and merge once ready.
This project uses goreleaser for cross-platform builds and publishing to GitHub Releases, Homebrew, and Scoop.
Typical release flow (maintainers):
export GORELEASER_TOKEN="<token-with-repo-scope>"
goreleaser release --rm-distSee .goreleaser.yaml for configured taps/buckets and targets.
Gitaid is released under the MIT License. See LICENSE for details.
- George Ongoro — original author
- See
go.modfor dependencies (includinggoogle.golang.org/genai)
If anything is missing or you'd like docs expanded (examples, pre-commit scripts, or CI samples), please open an issue or a PR — contributions are very welcome! ✅