๐จ CommitCraft
A fast, intelligent CLI tool that generates conventional commit messages using AI. Built in Rust for performance and reliability.
๐ What's New in v1.1.0: Updated to the latest AI models for 75% faster responses and 75% cost savings! Now featuring GPT-4.1 Nano and Claude 3.5 Haiku as defaults.
โจ Features
- ๐ค Multi-AI Provider Support: Works with OpenAI, Google Gemini, and Anthropic Claude
- ๐ Conventional Commits: Follows Conventional Commits v1.0.0 specification
- โ๏ธ Smart Configuration: Interactive setup with TOML configuration file
- ๐ฏ Context-Aware: Analyzes staged files and repository context
- ๐ง Developer-Friendly: Built for fast iteration with dry-run, review, and verbose modes
- ๐ฑ Model Aliases: Quick switching between models with custom aliases
๐ Quick Start
Installation
Option 1: Quick Install (Linux/macOS)
|
Option 2: Install via Cargo
Option 3: Download Binary
Download the latest binary from GitHub Releases
Option 4: Build from Source
Setup
# Run interactive setup
# Check your configuration
# List available providers and models
๐ Usage
โจ New Interactive Mode (Default)
# Stage your changes
# Generate and edit commit command interactively
)
)
# โ You can edit this command or just press Enter to execute
๐ Quick Modes
# Skip interactive editing, commit immediately
# Just show the git command (no execution)
# Dry run (generate message without committing)
# Use legacy confirmation flow
๐ง Advanced Usage
# Use specific provider and model
# Use model alias
# Include verbose output and file context
# Review in editor before committing
# Combine options
๐ ๏ธ Configuration
Configuration is stored at ~/.config/commitcraft/config.toml
:
= "gemini"
[]
= "sk-..."
= "your-api-key"
= "your-api-key"
[]
= "gpt-4.1-nano" # Latest: 75% faster & cheaper
= "gemini-1.5-flash-latest" # Unchanged: Already optimal
= "claude-3-5-haiku-20241022" # Latest: Superior performance
[]
= "gemini-1.5-flash-latest"
= "gpt-4o"
๐ฏ Conventional Commits
This tool generates commit messages following the Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Supported Types
feat
: New featuresfix
: Bug fixesdocs
: Documentation changesstyle
: Code formattingrefactor
: Code restructuringtest
: Adding testschore
: Maintenance tasksperf
: Performance improvementsci
: CI/CD changesbuild
: Build system changes
Examples
feat(auth): add OAuth2 login support
Implement OAuth2 authentication flow with Google and GitHub providers.
Includes token refresh logic and secure storage.
feat!: remove deprecated API endpoints
BREAKING CHANGE: The v1 API endpoints have been removed. Use v2 instead.
๐๏ธ Project Structure
src/
โโโ main.rs # Main application entry point
โโโ cli.rs # Command-line interface definitions
โโโ config.rs # Configuration management
โโโ git.rs # Git operations (diff, commit, repo info)
โโโ providers/ # AI provider implementations
โโโ mod.rs # Common traits and structures
โโโ openai.rs # OpenAI GPT integration
โโโ gemini.rs # Google Gemini integration
โโโ anthropic.rs # Anthropic Claude integration
๐ฌ Demos & Recordings
Watch CommitCraft in Action
Experience CommitCraft's power through our professional demo videos:
๐ฏ Quick Demo (3 minutes)
Perfect for social media and quick showcases:
๐จ Full Cinematic Demo (8-10 minutes)
Complete feature walkthrough for presentations:
Automatic Features:
- โ Generates MP4, GIF, WebM formats for any platform
- โ Professional quality with realistic typing effects
- โ Upload guides for YouTube, Twitter, LinkedIn, GitHub
See demo/README.md
for complete documentation.
๐งช Development
Building
Testing
Manual Testing Checklist
-
Setup Flow
-
Basic Generation
-
Provider Testing
-
Advanced Features
๐ง Troubleshooting
Common Issues
"Not inside a git repository"
- Make sure you're in a git repository
- Run
git init
if needed
"No staged files to commit"
- Stage your changes with
git add .
orgit add <file>
"API key not found"
- Run
commitcraft setup
to configure API keys - Check your configuration with
commitcraft config
Build errors
- Ensure you have Rust 1.70+ installed
- Run
rustup update
to update your toolchain
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
๐ License
MIT License - see LICENSE file for details.
๐ Acknowledgments
- Conventional Commits specification
- Rust community for excellent crates
- AI providers (OpenAI, Google, Anthropic) for powerful models