@maya_nk99/commit-ai
v1.0.0
Published
AI-powered git commit message generator using git diff as context
Maintainers
Readme
commit-ai
AI-powered git commit message generator that uses your git diff and an optional note as context to generate meaningful Conventional Commits.
Installation
npm install -g commit-aiSetup
Run once to save your OpenAI API key:
commit-ai configUsage
# Let AI generate from diff alone
git commit-ai
# Pass a note as context for better results
git commit-ai "fix login bug on mobile"
# Auto-commit without confirmation
git commit-ai "update deps" -y
# Pass note via flag
git commit-ai -n "refactor auth flow"How it works
- Reads your staged (or unstaged) git diff
- Collects branch name, changed files, and recent commits
- Sends context to OpenAI (gpt-4o-mini)
- Suggests a Conventional Commit message
- You choose to commit, edit, copy, or cancel
Commit message format
Follows Conventional Commits:
<type>(<scope>): <description>Types: feat, fix, refactor, chore, docs, style, test, perf
Requirements
- Node.js 18+
- OpenAI API key → platform.openai.com
License
MIT
