| Crates.io | auto-gitmoji |
| lib.rs | auto-gitmoji |
| version | 0.1.2 |
| created_at | 2025-07-10 03:25:40.848917+00 |
| updated_at | 2025-07-11 02:30:22.913363+00 |
| description | A Rust CLI tool that automatically prepends appropriate gitmoji to your commit messages based on intelligent keyword matching. |
| homepage | |
| repository | https://github.com/wty92911/auto-gitmoji |
| max_upload_size | |
| id | 1745779 |
| size | 1,169,648 |
A Rust CLI tool that automatically prepends appropriate gitmoji to your commit messages based on intelligent keyword matching.
git clone https://github.com/yourusername/auto-gitmoji.git
cd auto-gitmoji
cargo build --release
cargo install --path .
cargo install auto-gitmoji
# or with your own API_KEY
cargo install auto-gitmoji --features llm
# Commit with automatic gitmoji selection
amoji "add new user authentication feature"
# Output: โจ :sparkles: add new user authentication feature
# Preview without committing (dry run)
amoji "fix login validation bug" --dry-run
# Output: ๐ :bug: fix login validation bug
# Show all available emojis
amoji --show-emoji
# Get detailed help with examples
amoji --help-message
# Feature additions
amoji "add user profile page"
# Result: โจ :sparkles: add user profile page
# Bug fixes
amoji "fix memory leak in data processor"
# Result: ๐ :bug: fix memory leak in data processor
# Hotfixes
amoji "hotfix critical authentication vulnerability"
# Result: ๐๏ธ :ambulance: hotfix critical authentication vulnerability
# Documentation
amoji "docs update installation guide"
# Result: ๐ :memo: docs update installation guide
# Refactoring
amoji "refactor authentication module"
# Result: โป๏ธ :recycle: refactor authentication module
# Performance improvements
amoji "optimize database query performance"
# Result: โก :zap: optimize database query performance
# Testing
amoji "test user registration flow"
# Result: ๐งช :test_tube: test user registration flow
# Dependencies
amoji "update package dependencies"
# Result: ๐ฆ :package: update package dependencies
# Security
amoji "security fix for JWT validation"
# Result: ๐ :lock: security fix for JWT validation
| Category | Keywords | Emoji |
|---|---|---|
| Features | add, new, create, implement, introduce, feat |
โจ :sparkles: |
| Bug Fixes | fix, repair, resolve, correct, patch |
๐ :bug: |
| Hotfixes | hotfix, urgent, critical |
๐๏ธ :ambulance: |
| Documentation | docs, documentation, readme, comment |
๐ :memo: |
| Refactoring | refactor, restructure, reorganize, cleanup |
โป๏ธ :recycle: |
| Performance | optimize, performance, speed, cache, perf |
โก :zap: |
| Testing | test, testing, spec, coverage |
๐งช :test_tube: |
| Security | security, vulnerability, auth, permission |
๐ :lock: |
| Styling | style, format, lint, prettier |
๐ :lipstick: |
| Dependencies | deps, dependency, package, upgrade |
๐ฆ :package: |
| Configuration | config, configuration, settings, env |
โ๏ธ :gear: |
The tool uses a clean strategy pattern with pluggable matchers:
pub trait GitmojiMatcher {
fn match_emoji(&self, message: &str) -> Result<MatcherResult>;
fn name(&self) -> &'static str;
}
pub type MatcherResult = Option<(String, String)>; // (emoji_code, formatted_message)
Current Matchers:
amoji [OPTIONS] [MESSAGE]
ARGUMENTS:
[MESSAGE] The commit message
OPTIONS:
-d, --dry-run Show what would be committed without actually committing
-s, --show-emoji Show available emoji codes
-m, --help-message Show help message with usage examples
-h, --help Print help
-V, --version Print version
# Debug build
cargo build
# Release build
cargo build --release
# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test module
cargo test matcher::tests
# Development
cargo run -- "your commit message"
# With features
cargo run --features llm -- "your commit message"
# Dry run
cargo run -- "your commit message" --dry-run
src/
โโโ main.rs # CLI application entry point
โโโ lib.rs # Library exports and integration tests
โโโ commit.rs # Git commit operations
โโโ emoji.rs # Emoji lookup and mapping
โโโ matcher/
โโโ mod.rs # Matcher trait and factory
โโโ simple.rs # Keyword-based matcher
โโโ llm.rs # LLM-based matcher (feature gated)
tests/
โโโ integration_tests.rs # Full workflow integration tests
fixtures/
โโโ gitmojis.json # Official gitmoji data (69 emojis)
โโโ keyword_map.json # Keyword to emoji mappings (200+ keywords)
[features]
default = []
llm = ["reqwest", "tokio", "dotenvy"]
To enable LLM support:
cargo build --features llm
# For LLM feature
export API_KEY="your-api-key"
cargo testcargo fmt for formattingcargo clippy for lintingThis project is licensed under the MIT License. See the LICENSE file for details.