AI-powered Git commit assistant that intelligently analyzes your code changes and generates clear, concise, and context-aware commit messages using Google's Gemini AI.
- Smart Analysis - Automatically understands code changes and generates contextual commit messages
- Intelligent Fallbacks - Summary messages for large files, lock files, and build artifacts
- Security-First - Path validation, input sanitization, and secure API key handling
- Fast & Reliable - Optimized performance with retry logic and error recovery
- Node.js 20.0.0+
- Gemini AI API key
# Install globally from npm
npm install -g @sojanvarghese/commit-x
# Interactive setup
cx setup
# Or set API key directly
export GEMINI_API_KEY="your_api_key_here"
# Process files with AI (recommended)
cx
# Traditional workflow
cx commit --all
# Preview changes
cx commit --dry-run
Command | Description |
---|---|
cx |
Process files with AI |
cx commit --all |
Stage all files and commit together |
cx commit --dry-run |
Preview commits without executing |
cx commit -m "message" |
Use custom commit message |
cx status |
Show repository status |
cx diff |
Show unstaged changes summary |
cx config |
View configuration |
cx config set <key> <value> |
Set configuration value |
cx config reset |
Reset configuration to defaults |
cx setup |
Interactive setup |
cx privacy |
Show privacy settings and data handling information |
cx debug |
Debug repository detection |
cx help-examples |
Show usage examples |
# View current configuration
cx config
# Set configuration values
cx config set model gemini-2.0-flash-lite
# Reset to defaults
cx config reset
Option | Type | Default | Description |
---|---|---|---|
apiKey |
string | - | Gemini AI API key (use environment variable) |
model |
string | gemini-2.0-flash-lite |
AI model to use |
- Google Gemini AI for the AI capabilities
- Simple Git for Git operations
- Commander.js for CLI interface