Auto-Gitmoji
A Rust CLI tool that automatically prepends appropriate gitmoji to your commit messages based on intelligent keyword matching.
✨ Features
- Intelligent Matching: Uses first-word keyword matching with 200+ keyword mappings
- Comprehensive Emoji Support: All 69 official gitmojis from the gitmoji standard
- High Confidence Scoring: 90% confidence for exact matches, with fallback options
- Git Integration: Seamlessly integrates with your Git workflow
- Dry Run Mode: Preview commits before executing
- Emoji Display: View all available gitmojis
- Robust Error Handling: Validates staged changes and Git repository status
🚀 Installation
Prerequisites
- Rust 1.70+ with Cargo
- Git installed and configured
From Source
📋 Usage
Basic Usage
# Commit with automatic gitmoji selection
# Output: ✨ :sparkles: add new user authentication feature
# Preview without committing (dry run)
# Output: 🐛 :bug: fix login validation bug
# Show all available emojis
Complete Examples
# Feature additions
# Result: ✨ :sparkles: add user profile page
# Bug fixes
# Result: 🐛 :bug: fix memory leak in data processor
# Documentation
# Result: 📝 :memo: docs update installation guide
# Refactoring
# Result: ♻️ :recycle: refactor authentication module
# Performance improvements
# Result: ⚡ :zap: optimize database queries
# Security fixes
# Result: 🚑️ :ambulance: hotfix critical vulnerability in auth
🎯 How It Works
First-Word Matching Strategy
- Split: Commit message split into words by whitespace
- Filter: Keep only alphanumeric words (+ hyphens/underscores)
- Match: Find first word that exists in keyword map
- Confidence: 90% confidence for exact matches, 30% for fallbacks
Keyword Categories
- Feature:
add
,create
,implement
,introduce
- Fixes:
fix
,repair
,resolve
,correct
,hotfix
- Documentation:
docs
,documentation
,readme
,comment
- Refactoring:
refactor
,restructure
,reorganize
,cleanup
- Performance:
optimize
,performance
,speed
,cache
- Testing:
test
,testing
,spec
,coverage
- Security:
security
,vulnerability
,auth
,permission
- Styling:
style
,format
,lint
,prettier
- Dependencies:
deps
,dependency
,package
,upgrade
- Configuration:
config
,configuration
,settings
,env
Emoji Mapping
Uses the complete official gitmoji specification with 69 different emojis covering all common development activities. The tool loads emojis from JSON first, with a hardcoded fallback for reliability.
🛠️ CLI Options
🔧 Development
Building
Testing
Running