A zero-dependency CLI tool that generates smart, conventional commit messages by analyzing your git diff. No API keys, no cloud services — runs entirely locally using pattern matching.
Writing good commit messages is tedious. This tool analyzes your staged changes and suggests a Conventional Commits message based on what actually changed.
npm install -g ai-git-commitOr use directly with npx:
npx ai-git-commit# Stage your changes first
git add .
# Generate a commit message
ai-git-commit
# Auto-commit with the generated message
ai-git-commit --commit
# Just print the message (for piping)
ai-git-commit --quiet- Reads your
git diff --staged - Analyzes file patterns, additions, deletions, and content
- Determines the commit type (
feat,fix,docs,refactor,style,test,chore) - Generates a descriptive scope and subject
- Outputs a conventional commit message
$ ai-git-commit
🔍 Analyzing staged changes...
📝 Suggested commit message:
feat(auth): add JWT token validation middleware
Use --commit to auto-commit, or copy the message above.
$ ai-git-commit
🔍 Analyzing staged changes...
📝 Suggested commit message:
fix(api): handle null response in user endpoint
| Pattern | Type |
|---|---|
| New files added | feat |
| Test files modified | test |
| README/docs changed | docs |
| Package files changed | chore |
| Bug-related keywords | fix |
| Style/format only | style |
| Restructuring | refactor |
MIT