Global AI-powered tool for generating meaningful commit messages.
- 🇺🇸 English (current)
- 🇷🇺 Русский (Russian)
- 🇨🇳 中文 (Chinese) - coming soon
- 🇪🇸 Español (Spanish) - coming soon
- 🇩🇪 Deutsch (German) - coming soon
Want to add a translation? Create a Pull Request or open an Issue!
- 🤖 AI-powered: Generate commit messages using GPT models via gptunnel.ru
- 💰 Cost-effective: Uses the cheapest GPT-5-nano model ($0.001 per token)
- 📝 Conventional Commits: Support for conventional commits format
- 🔧 Flexible configuration: Global and project-specific settings
- 🤖 Smart analysis: Two analysis modes - lite (fast) and full (detailed with diff)
- 🎯 Multiple modes: Standard, dry-run, generate-only, custom message
- ⚡ Fast: Message generation in < 30 seconds
- 🛠️ Extensible: Clean architecture with SOLID principles support
- 🎨 Beautiful CLI: Colored output with progress indicators
# Clone the repository
git clone https://github.com/prod-broke-again/smart-commit.git
cd smart-commit
# Install dependencies and build
npm install && npm run build
# Link globally (for development)
npm link
# Verify installation
smart-commit --version# Navigate to your git project
cd your-project
# Regular commit (automatically adds all changes)
smart-commit
# Generate message only without committing
smart-commit --generate-only
# Dry-run (show what would be committed)
smart-commit --dry-run
# Use custom message
smart-commit -m "feat: add new feature"Smart Commit supports two code analysis modes:
- Fast analysis of file list only
- Minimal token usage
- Suitable for simple commits
- Analyzes actual code changes (diff)
- AI sees what exactly changed
- Better generation quality for complex changes
# Switch to full analysis mode
smart-commit config --global --set analysisMode=full
# Return to lite mode
smart-commit config --global --set analysisMode=litesmart-commit setupGet API key from gptunnel.ru/profile/business, then:
smart-commit config --global --set apiKey=YOUR_API_KEY# Set default model (gpt-5-nano is most cost-effective)
smart-commit config --global --set defaultModel=gpt-5-nano
# Enable wallet balance usage (recommended for individual users)
smart-commit config --global --set useWalletBalance=true
# View current configuration
smart-commit config --global --list# Generate and commit (default)
smart-commit
# Generate only
smart-commit --generate-only
# Dry run
smart-commit --dry-run
# Custom message
smart-commit -m "feat: add awesome feature"# Set global config
smart-commit config --global --set key=value
# Get config value
smart-commit config --global --get key
# List all configs
smart-commit config --global --list
# Project-specific config
smart-commit config --set key=value# List available models
smart-commit models list
# List all models (including details)
smart-commit models list --all
# Refresh models from API
smart-commit models refresh
# Clear models cache
smart-commit models clear-cacheAdd custom instructions for specific projects:
smart-commit config --set customInstructions="Always use Russian language"# Use specific model for generation
smart-commit config --global --set defaultModel=gpt-5-chat
# Available models: gpt-5-nano, gpt-5-chat, gpt-5-codex, gpt-4o-mini, etc.
smart-commit models list --all# Project-specific settings
cd my-project
smart-commit config --set language=ru
smart-commit config --set includeScope=true$ smart-commit --generate-only
- Analyzing repository...
- Generating commit message...
Generated commit message:
feat: add user authentication module
- 🔐 Implemented JWT-based authentication system
- 👤 Added User model with validation
- 🗄️ Created user repository with database integration
- 🛡️ Added middleware for route protection
- 📝 Updated API documentation$ smart-commit config --global --set analysisMode=full
$ smart-commit --generate-only
Generated commit message:
feat: implement advanced caching system 🚀
- 🧠 Added RedisCacheManager with TTL support
- 🔄 Implemented cache invalidation strategies
- 📊 Added cache hit/miss metrics
- 🏗️ Created CacheService interface for extensibility
- 🧪 Added comprehensive unit tests for cache operations
- 📚 Updated documentation with caching best practices- Domain Layer: Business logic for commit generation
- Application Layer: Workflow orchestration and commands
- Infrastructure Layer: Git operations, AI API, file system
- Single Responsibility: Each module has one purpose
- Open/Closed: Open for extension, closed for modification
- Liskov Substitution: Correct inheritance interfaces
- Interface Segregation: Minimal and specific interfaces
- Dependency Inversion: Dependencies are injected
- CommitGenerator: AI-powered message generation
- GitAnalyzer: Repository analysis and diff extraction
- WorkflowOrchestrator: Process coordination
- ConfigurationManager: Settings management
- GptunnelApiClient: AI service integration
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'feat: add some AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- gptunnel.ru for AI API
- Conventional Commits specification
- Open source community for inspiration
Made with ❤️ for developers who care about clean commit history