genai-commit
v1.4.0
Published
AI-powered commit message generator using Claude Code or Cursor CLI
Downloads
564
Maintainers
Readme
genai-commit
AI-powered commit message generator using Claude Code or Cursor CLI.
Features
- AI-powered commit messages - Generate meaningful commit messages using Claude Code or Cursor CLI
- Conventional Commits - Automatically follows the Conventional Commits specification
- Multi-language support - Generate titles and messages in English or Korean
- Jira integration - Assign Jira tickets to commits and auto-merge related changes
- Interactive workflow - Review, provide feedback, and refine before committing
- Smart file grouping - Intelligently splits changes into logical commits
How It Works
flowchart TD
A[Start: genai-commit] --> B[Collect Git Changes]
B --> C{Changes Found?}
C -->|No| D[Exit: No changes]
C -->|Yes| E[Generate Tree Summary]
E --> F[Build AI Prompt]
F --> G{Select Provider}
G -->|Claude Code| H[Claude Code CLI]
G -->|Cursor CLI| I[Cursor CLI]
H --> J[Parse JSON Response]
I --> K[Parse Delimiter Response]
J --> L[Display Proposed Commits]
K --> L
L --> M{User Action}
M -->|y| N[Execute git add + commit]
M -->|n| O[Cancel]
M -->|f| P[Get Feedback]
M -->|t| Q[Assign Jira Tickets]
P --> F
Q --> R[Merge Same-Ticket Commits]
R --> L
N --> S[Done]Prerequisites
You need at least one of these AI CLI tools installed:
- Claude Code CLI - Anthropic's official CLI
- Cursor Agent CLI - Cursor's agent CLI (command:
agent)
Installation
# Global installation
npm install -g genai-commit
# Or use directly with npx (no installation required)
npx genai-commit claude-codeUsage
Generate Commit Messages
# Using Claude Code
genai-commit claude-code
# Using Cursor Agent
genai-commit cursor-cli
# With specific model
genai-commit cursor-cli --model claude-4.5-sonnet
genai-commit claude-code --model sonnet
# Set language for both title and message
genai-commit claude-code --lang ko
# Set languages separately
genai-commit claude-code --title-lang en --message-lang koAuthentication
# Login to Cursor Agent
genai-commit login cursor-cli
# Setup Claude token
genai-commit login claude-code
# Check status
genai-commit status claude-code
genai-commit status cursor-cliList Supported Models
# List models for Cursor Agent
genai-commit models cursor-cli
# List models for Claude Code
genai-commit models claude-codeInteractive Options
After generating commit messages, you'll see an interactive menu:
| Option | Description |
|--------|-------------|
| [y] | Commit all proposed commits |
| [n] | Cancel |
| [f] | Provide feedback to regenerate |
| [t] | Assign Jira tickets and regroup commits |
Options
| Option | Description | Default |
|--------|-------------|---------|
| --lang <lang> | Set both title and message language (en|ko) | - |
| --title-lang <lang> | Language for commit title | en |
| --message-lang <lang> | Language for commit message | ko |
| --model <model> | Model to use | claude-4.5-sonnet (Cursor) / haiku (Claude) |
Examples
Basic Usage
# Navigate to your git repository
cd my-project
# Make some changes
echo "console.log('hello');" >> src/index.js
# Generate and create commits
genai-commit claude-codeWith Jira Integration
- Run
genai-commit claude-code - Review proposed commits
- Press
tto assign Jira tickets - Enter Jira URLs for each commit
- Commits with the same Jira ticket are automatically merged
- Press
yto commit
Providing Feedback
- Run
genai-commit cursor-cli - Review proposed commits
- Press
fto provide feedback - Enter your feedback (e.g., "Split the auth changes into separate commits")
- AI regenerates based on your feedback
- Press
yto commit
Supported Commit Types
Following the Conventional Commits specification:
| Type | Description |
|------|-------------|
| feat | New feature |
| fix | Bug fix |
| docs | Documentation |
| style | Formatting (no code change) |
| refactor | Code restructuring |
| test | Adding tests |
| chore | Maintenance |
| perf | Performance improvement |
| ci | CI/CD changes |
| build | Build system changes |
Configuration
The tool uses sensible defaults but can be configured:
| Setting | Default | Description |
|---------|---------|-------------|
| maxInputSize | 30000 | Maximum input size in bytes |
| maxDiffSize | 15000 | Maximum diff size in bytes |
| timeout | 120000 | AI request timeout in ms |
| treeDepth | 3 | Directory depth for tree compression |
Requirements
- Node.js >= 18.0.0
- Git repository
- Claude Code CLI or Cursor CLI installed and authenticated
License
MIT
