@harshkas45a/commit-gen
v1.0.0
Published
AI-powered conventional commit message generator using Google Gemini
Maintainers
Readme
CommitGen
AI-powered conventional commit message generator using Google Gemini (FREE).
Setup
Install:
npm install -g commit-genGet FREE Gemini API key:
- Visit: https://aistudio.google.com/app/apikey
- Click "Create API Key"
- Copy the key
Configure:
commit-gen config # Paste your API key when promptedUse:
git add . commit-gen
Features
- AI-powered commit messages using Google Gemini
- Conventional commit format (feat, fix, refactor, etc.)
- Uses FREE Gemini API
- Interactive selection with 3 suggestions
- Beautiful terminal UI with colors and spinners
- Large diff warnings
- Configurable preferences
Commands
commit-gen- Generate and commitcommit-gen config- Setup/change configurationcommit-gen config --show- View current configcommit-gen config --reset- Reset all configurationcommit-gen --help- Show helpcommit-gen --version- Show version
How It Works
- Stage your changes with
git add - Run
commit-gen - AI analyzes your diff and suggests 3 commit messages
- Pick one (1-3), regenerate (r), or quit (q)
- Auto-commits with your chosen message
Configuration
Config is stored at ~/.config/commit-gen-nodejs/config.json:
| Option | Default | Description |
|--------|---------|-------------|
| apiKey | - | Gemini API key (required) |
| preferredTypes | [] (all) | Prioritize certain commit types |
| maxDiffLines | 500 | Warn if diff exceeds this |
| autoCommit | true | Auto-commit or just show message |
| showExplanations | false | Show reasoning for suggestions |
License
MIT
