Skip to content

dlnilsson/git-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

110 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git ai

asciicast

Generates conventional commit messages from your staged changes using Claude, Gemini, or Codex. Use the generated message with git commit (e.g. via the git-ai script) and optionally edit it in your editor before committing.

Requirements

  • Go — to build the binary
  • Claude, Gemini, or Codex — installed and on your PATH

Install

macOS/Linux:

make install

This installs the Go binary and scripts/git-ai into $(BINDIR) (default ~/.local/bin). Ensure that directory is on your PATH.

Windows (PowerShell):

./scripts/install-windows.ps1

This installs the Go binary plus git-ai.cmd/git-ai.ps1 into $HOME\.local\bin by default. Ensure that directory is on your PATH.

Configure a Git alias on Windows so git ai works:

git config --global alias.ai "!git-ai"

Verify:

git config --global --get alias.ai

Expected output:

!git-ai

Backends

The backend is auto-detected from your PATH (Claude preferred, then Gemini, then Codex). Override with GIT_AI_BACKEND:

Value Provider
claude Anthropic Claude CLI
gemini Google Gemini CLI
codex OpenAI Codex CLI
# Auto-detect (claude preferred, then gemini, then codex)
git ai

# Force a specific backend
GIT_AI_BACKEND=codex git ai

# Print the exact backend command without executing it
git ai --dry-run

PowerShell backend override:

$env:GIT_AI_BACKEND='codex'; git ai

Get started

  1. Stage your changes: git add ...
  2. Run: git ai (or git-ai if not using a git alias)
  3. The backend drafts a conventional commit message and opens your editor so you can confirm or edit, then commit.

About

commit messages with claude cli or codex

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages