Mostly useless. An agent SKILL is probably a better fit for this problem. But ey, it was fun to make!
A CLI tool that generates git commit messages using AI. It reads your staged changes, sends context to an AI agent with read-only repository access, and proposes a commit message for your approval.
Supports GitHub Copilot CLI and Claude Code as AI backends.
- At least one AI CLI tool installed and authenticated:
- GitHub Copilot CLI (
copilotcommand) -- default - Claude Code (
claudecommand)
- GitHub Copilot CLI (
git
brew install torryt/tap/ai-commitgo install github.com/torryt/ai-commit@latestgit clone https://github.com/torryt/ai-commit.git
cd ai-commit
go build -o ai-commit .Then place the resulting binary somewhere on your PATH.
# Generate a commit message for already-staged changes
ai-commit
# Stage all changes first, then generate a commit message
ai-commit -A
ai-commit --all
# Use Claude Code instead of Copilot
ai-commit --provider claude
# Use a specific AI model
ai-commit --model claude-opus-4
# Print version
ai-commit --version| Flag | Description |
|---|---|
-A, --all |
Stage all changes (git add -A) before generating the message |
--provider |
AI provider: copilot or claude (default from config or copilot) |
--model |
AI model to use (default: claude-haiku-4.5 for copilot, haiku for claude) |
--max-turns |
Maximum number of agentic turns (default: 3) |
--debug |
Enable verbose debug output |
--version |
Print version and exit |
You can set a default AI provider in ~/.config/ai-commit/config.json:
{
"ai_provider": "claude"
}| Field | Values | Description |
|---|---|---|
ai_provider |
"copilot", "claude" |
Default AI provider. Overridden by --provider flag. |
Provider resolution order:
--providerflag (if set)ai_providerfrom config file"copilot"(built-in default)
- Stage your changes (or use
-Ato auto-stage). - Run
ai-commit. - The tool collects the file list and diff stats, then invokes the AI with read-only git access to generate a message.
- Review the proposed commit message.
- Confirm with
yoryesto commit, or anything else to abort.
The tool sends the list of changed files and diff statistics to an AI agent. The agent has read-only access to a limited set of git commands (git diff, git log, git show, git blame, git status) so it can inspect the actual changes and commit history for additional context. It then produces a commit message wrapped in <COMMIT_MSG> markers, which the tool extracts and presents for confirmation.
All agent permissions are deny-by-default -- only explicitly whitelisted read-only operations are allowed. For Copilot this uses --allow-tool; for Claude Code this uses --allowedTools.
Releases are automated via GoReleaser. To create a new release:
- Tag a version:
git tag v0.1.0 - Push the tag:
git push origin v0.1.0 - Create a GitHub release from the tag.
The release workflow builds cross-platform binaries and publishes to the Homebrew tap.
Required secrets: HOMEBREW_TAP_TOKEN (a GitHub PAT with repo access to torryt/homebrew-tap).
ai-commit/
├── main.go # Entire application
├── go.mod # Go module (no external dependencies)
├── .goreleaser.yml # GoReleaser config (cross-build + Homebrew)
├── .github/workflows/
│ ├── ci.yml # CI: vet + build on push/PR
│ └── release.yml # Release: goreleaser on published release
└── .gitignore