For those of us who haven't fully succumbed to fully agentic coding, leverage AI to make your git experience a little nicer.
git ai commit— generate conventional commit messages from staged files (with optional split-into-multiple-commits, verbose bodies, and ticket extraction from your branch name)
# Quick install (one-liner)
curl -fsSL https://raw.githubusercontent.com/jakiestfu/git-ai/main/install.sh | bash
# Or inspect first
curl -fsSL https://raw.githubusercontent.com/jakiestfu/git-ai/main/install.sh -o install.sh
less install.sh
bash install.shgitjqclaudeCLI, logged in- Bash 4+ (macOS users: the system bash 3.2 works for the dispatcher, but
commitusesmapfile; install bash via Homebrew if needed:brew install bash)
git clone <this-repo> git-ai
cd git-ai
./install.shBy default, files are installed to ~/.local/bin:
~/.local/bin/git-ai— the dispatcher~/.local/bin/git-ai.d/*— individual subcommands
To install somewhere else:
PREFIX=/usr/local/bin ./install.shIf ~/.local/bin is not on your PATH, the installer will tell you. Add this to
~/.zshrc or ~/.bashrc:
export PATH="$HOME/.local/bin:$PATH"Re-running ./install.sh is safe — it overwrites in place.
Run git ai to list subcommands. Each supports -h for full options.
Generate a conventional commit message for staged changes.
git add .
git ai commit # generate + confirm
git ai commit -y # auto-commit
git ai commit -v # include a body
git ai commit --split # split into multiple logical commits
git ai commit --no-verify # skip pre-commit hooksExtracts a ticket from the branch name (feature/PROJ-123-foo → (PROJ-123)),
flags possible secrets/generated/large files, and handles pre-commit hooks
(auto-fixes are re-staged silently). --split backs up the original staged
diff to a temp file before applying per-commit patches.
git ai update # latest from main
git ai update --ref v1.2.3 # pin to a tag/branch/commit
git ai update --repo myfork/git-ai # install from a forkReinstalls in place at the same prefix.
git ai uninstall # confirms first
git ai uninstall -y # skip confirmationRemoves git-ai and git-ai.d/ from the install prefix.
git automatically treats any executable named git-<name> on your PATH as a
subcommand (git <name>). The git-ai dispatcher mirrors that pattern one
level deeper: it scans its own git-ai.d/ directory and runs whichever script
matches the first argument.
-
Drop an executable file in
libexec/git-ai.d/named<subcommand>(nogit-prefix). -
Add a shebang and, optionally, a description comment that the dispatcher shows in
git ai --help:#!/usr/bin/env bash # Description: One-line summary set -euo pipefail # ...
-
Re-run
./install.sh.
git-ai/
├── install.sh
├── README.md
├── bin/
│ └── git-ai # dispatcher
└── libexec/
└── git-ai.d/
├── commit # AI commit message generator
├── update # pulls latest from GitHub and reinstalls
└── uninstall # removes git-ai from $INSTALL_DIR
After install, bin/git-ai and libexec/git-ai.d/* are flattened into a single
directory ($INSTALL_DIR) so the dispatcher's sibling lookup just works.
PRs are welcome. Open an issue first for anything non-trivial so we can align on
the approach. New subcommands should follow the pattern in
Adding a new subcommand and remember to add them to
the SUBCOMMANDS array in install.sh so remote installs pick
them up.
The commit subcommand started as
turo/developer-machine#366,
adapted to be a standalone repo with no external dependencies.