@sojanvarghese/commit-x
v3.0.1
Published
AI-powered Git commit assistant that intelligently analyzes your code changes and generates clear, concise, and context-aware commit messages
Maintainers
Readme
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.
✨ Features
- Intelligent Grouping - Automatically groups related file changes into logical commits
- Smart Analysis - Understands code changes and generates contextual commit messages
- Dynamic Timeouts - Smart timeout calculations based on file size, changes, and complexity
- 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
🚀 Quick Start
Prerequisites
- Node.js 24.0.0+
- Gemini AI API key
Installation
# Install globally from npm
npm install -g @sojanvarghese/commit-xSetup
# Interactive setup
cx setup
# Or set API key directly
export GEMINI_API_KEY="your_api_key_here"Usage
# Process files with AI-powered intelligent grouping (recommended)
cx
# Stage all files and commit together (also uses AI grouping)
cx commit --all
# Preview commits without executing
cx commit --dry-run📖 Commands
| Command | Description |
|---------|-------------|
| cx | Process files with AI-powered intelligent grouping |
| cx commit --all | Stage all files and commit together (uses AI grouping) |
| cx commit --dry-run | Preview commits without executing |
| cx commit -m "message" | Use custom commit message |
| cx commit --all --interactive | Interactive mode for traditional workflow |
| 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 |
⚙️ Configuration
# View current configuration
cx config
# Set configuration values
cx config set model gemini-3.1-flash-lite-preview
# Reset to defaults
cx config resetConfiguration Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| apiKey | string | - | Gemini AI API key (use environment variable) |
| model | string | gemini-3.1-flash-lite-preview | AI model to use |
Acknowledgments
- Google Gemini AI for the AI capabilities
- Simple Git for Git operations
- Commander.js for CLI interface
