A CLI tool that generates git commit messages from diffs using Claude.
- Reads a git diff from stdin
- Sends it to the Claude API with a prompt that enforces good commit message conventions
- Streams the result back to stdout
npm install
cp .env.example .env
# Add your Anthropic API key to .env# Generate message from staged changes
git diff --cached | node index.js
# Generate message from last commit
git diff HEAD | node index.js
# Stage everything and commit in one go
git add -A && git diff --cached | node index.js | git commit -F -- Runtime: Node.js (ESM)
- AI: Claude via
@anthropic-ai/sdk, streamed output - Model:
claude-sonnet-4-6
- First line: imperative mood, max 72 chars
- Optional body (blank line + 2–5 lines) explaining why, not what
- No vague words, no markdown, no preamble