@lukaplayground/commitgen
v1.0.0
Published
AI-powered git commit message generator using AIKit
Downloads
48
Maintainers
Readme
CommitGen
AI-powered git commit message generator — built with AIKit
git diff --staged를 AI로 분석해서 Conventional Commits 형식의 커밋 메시지를 자동 생성하는 CLI 도구.
Features
- Conventional Commits —
feat,fix,refactor,docs등 자동 분류 - Multi-Provider — OpenAI / Claude / Gemini 선택 가능 (AIKit 기반)
- 한국어/영어 — 커밋 메시지 언어 선택
- Interactive — 생성 후 커밋/편집/재생성/취소 선택
- Dry Run — 커밋 없이 메시지만 확인
Installation
# Global install
npm install -g @lukaplayground/commitgen
# Or use directly with npx
npx @lukaplayground/commitgenQuick Start
# 1. Set up API key
commitgen config
# 2. Stage your changes
git add .
# 3. Generate & commit
commitgenUsage
# Basic usage (uses default provider)
commitgen
# Specify provider
commitgen -p claude
commitgen -p openai
commitgen -p gemini
# Korean commit messages
commitgen -l ko
# Specific model
commitgen -p openai -m gpt-4o
# Dry run (show message only)
commitgen --dry-run
# No emoji
commitgen --no-emoji
# Configure defaults
commitgen configExample Output
📋 Staged Changes:
added src/utils/cache.js
modified src/index.js
🔍 Analyzing with openai...
✅ Commit message generated!
📝 Generated Commit Message:
✨ feat(cache): add TTL-based cache expiration logic
- Implement isExpired() method for cache entries
- Set default TTL to 1 hour
- Add automatic cleanup of expired items on get()
? What would you like to do?
✅ Commit with this message
✏️ Edit message before committing
🔄 Regenerate message
❌ CancelConfiguration
API Keys
Set up via commitgen config or environment variables:
export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...
export GEMINI_API_KEY=...Config file location: ~/.commitgen/config.json
Tech Stack
| Technology | Purpose | |-----------|---------| | AIKit | Multi-provider AI API client | | Commander.js | CLI framework | | Inquirer.js | Interactive prompts | | Chalk | Terminal styling | | Ora | Spinner animation |
Project Structure
commitgen/
├── bin/
│ └── commitgen.js # CLI entry point
├── src/
│ ├── index.js # Main logic (run flow)
│ ├── commands/
│ │ └── configure.js # Interactive config setup
│ └── utils/
│ ├── ai.js # AIKit integration
│ ├── config.js # Config file management
│ ├── gitDiff.js # Git diff parsing
│ └── prompt.js # AI prompt builder
├── package.json
├── .env.example
└── README.mdLicense
MIT © Luka
