AI-powered git commit & push in one command. Uses Groq (free, blazing fast) to generate conventional commit messages from your diff.
git-ai # auto-generate commit message from diff
git-ai "added auth flow" # provide context hint for better messages
git-ai --skip # skip confirmation, commit and push immediately
▸ Generating commit message...
Changes to commit:
src/auth.ts | 42 ++++++++++++++++++++++----
src/db.ts | 8 ++---
2 files changed, 38 insertions(+), 12 deletions(-)
Commit message:
┌─────────────────────────────────────────────┐
│ feat(auth): add OAuth2 login flow │
└─────────────────────────────────────────────┘
[Enter] Accept [e] Edit [r] Regenerate [c] Cancel
curl -fsSL https://raw.githubusercontent.com/rohitg00/git-ai/main/install.sh | bashThat's it. The installer:
- Downloads
git-aito~/.local/bin/ - Makes it executable
- Adds
~/.local/binto your PATH if needed - Tells you exactly what to do next
Then add your free Groq API key:
export GROQ_API_KEY="your-key-here" # add to ~/.zshrc or ~/.bashrcGet your free key at console.groq.com → API Keys → Create (no credit card needed).
Manual install
curl -fsSL https://raw.githubusercontent.com/rohitg00/git-ai/main/git-ai -o ~/.local/bin/git-ai
chmod +x ~/.local/bin/git-ai
export PATH="$HOME/.local/bin:$PATH"rm ~/.local/bin/git-ai- Validates you're in a git repo with changes
- Stages modified/deleted tracked files (
git add -u) - Sends diff to Groq API → generates conventional commit message
- Shows diff summary + proposed message
- You accept, edit, regenerate, or cancel
- Commits and pushes to current branch
Untracked (new) files are never auto-staged — you explicitly git add them first.
| Key | Action |
|---|---|
Enter |
Accept message, commit and push |
e |
Edit message in your $EDITOR |
r |
Regenerate with a new API call |
c |
Cancel and unstage all changes |
| Variable | Default | Description |
|---|---|---|
GROQ_API_KEY |
— | Required. Free API key from console.groq.com |
GIT_AI_MODEL |
llama-3.3-70b-versatile |
Groq model to use |
GIT_AI_MAX_DIFF |
8000 |
Max diff chars sent to API |
- Free — no credit card, 14,400 requests/day
- Fast — LPU inference, sub-second responses
- Smart — Llama 3.3 70B understands code diffs well
- Simple — OpenAI-compatible API, just a curl call
- bash 4+
curljq- A free Groq API key
Since the script is named git-ai, git automatically picks it up as a subcommand:
git ai # works the same as git-ai
git ai "refactored api" # with context
git ai --skip # auto-commitMIT