CommitKit is a command-line tool that helps developers create well-structured and consistent commit messages following the Conventional Commits specification. It provides an interactive interface to guide users through the process of constructing a commit message with a type, optional scope, subject, body, and footer.
-
Core Functionality
- Interactive selection of commit types and scopes
- Customizable configuration via
.commitkit.toml - Enforcement of maximum subject length
- Support for multi-line commit bodies
- Automatic validation of input
- Optional signed-off commits
- Cross-platform compatibility
-
Enhanced Features
- Emoji support in commit messages (✨, 🐛, etc.)
- Commit templates with placeholder substitution
- Automatic changelog generation and maintenance
- Git hooks for commit message validation and formatting
- Commit statistics and analysis
- Interactive prompts for template values
- Rust: Version 1.88.0 or higher (MSRV)
- Cargo: Included with Rust installation
git clone https://github.com/somethingwithproof/commitkit-rust.git
cd commitkit-rust
cargo install --path .Navigate to your git repository and run:
commitkitUSAGE:
commitkit [OPTIONS]
OPTIONS:
-d, --dry-run Skip git commit and print the message to stdout
-v, --verbose Show verbose output
-c, --config Path to config file (default: .commitkit.toml in current or home directory)
--emoji Toggle emoji in commit messages
--template Use a specific commit template
--changelog Update changelog after committing
--install-hooks Install git hooks
--stats Show commit statistics
--days Number of days to analyze for stats (default: all)
--validate Validate a commit message file
--prepare-msg Prepare commit message (used by git hook)
--lang <LANG> Display language (e.g. en, de, ja, zh-CN, pt-BR)
-h, --help Print help information
-V, --version Print version information
CommitKit detects the display language from LC_ALL, LC_MESSAGES, and LANG, or accepts --lang <LANG>. It supports 48 languages (including 6 right-to-left locales: ar, ar-EG, ar-MA, fa, he, and ur):
| Code | Language | README | Code | Language | README | Code | Language | README |
|---|---|---|---|---|---|---|---|---|
en |
English | English | pl |
Polski | README | so-SO |
Soomaali | README |
de |
Deutsch | README | tr |
Türkçe | README | sw-KE |
Kiswahili | README |
es |
Español | README | sv |
Svenska | README | xh-ZA |
isiXhosa | README |
fr |
Français | README | vi |
Tiếng Việt | README | yo-NG |
Yorùbá | README |
it |
Italiano | README | id |
Bahasa Indonesia | README | zu-ZA |
isiZulu | README |
pt-BR |
Português (Brasil) | README | af-ZA |
Afrikaans | README | bn |
বাংলা | README |
nl |
Nederlands | README | am-ET |
አማርኛ | README | fa |
فارسی | README |
ru |
Русский | README | ar-EG |
العربية (مصر) | README | he |
עברית | README |
uk |
Українська | README | ar-MA |
العربية (المغرب) | README | mr |
मराठी | README |
ja |
日本語 | README | fr-MA |
Français (Maroc) | README | ta |
தமிழ் | README |
ko |
한국어 | README | fr-SN |
Français (Sénégal) | README | te |
తెలుగు | README |
zh-CN |
简体中文 | README | ha-NG |
Hausa | README | th |
ไทย | README |
zh-TW |
繁體中文 | README | ig-NG |
Igbo | README | ur |
اردو | README |
ar |
العربية | README | mg-MG |
Malagasy | README | ms |
Bahasa Melayu | README |
hi |
हिन्दी | README | rw-RW |
Kinyarwanda | README | fil |
Filipino | README |
bs |
Bosanski | README | hr |
Hrvatski | README | sr |
Српски | README |
The tool will guide you through the process of creating a conventional commit message:
- Select a commit type (feat, fix, docs, etc.)
- Select a scope (optional)
- Enter the commit subject
- Enter the commit body (optional)
- Enter the commit footer (optional)
After completing these steps, CommitKit will run git commit with your constructed message.
# Basic usage
commitkit
# Dry run - display the resulting commit message without committing
commitkit --dry-run
# Use a custom config file
commitkit --config /path/to/custom-config.toml
# Verbose output
commitkit --verbose
# Use emojis in commit messages
commitkit --emoji
# Use a template for your commit
commitkit --template feature
# Automatically update CHANGELOG.md
commitkit --changelog
# Install git hooks
commitkit --install-hooks
# Show commit statistics for the last 30 days
commitkit --stats --days 30
# Validate a commit message
commitkit --validate .git/COMMIT_EDITMSG# Debug build
cargo build
# Release build
cargo build --release# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture# Check for linting issues
cargo clippy --all-targets --all-features
# Apply automatic fixes
cargo clippy --fix --allow-dirty# Check formatting
cargo fmt -- --check
# Apply formatting
cargo fmtCommitKit looks for a configuration file named .commitkit.toml in the following locations (in order):
- Current directory
- User's home directory
If no configuration file is found, a default one will be generated in your home directory.
Example configuration:
# CommitKit Configuration
# Whether to add a Signed-off-by line to commits (-s flag)
sign_off_commits = false
# Commit message prefixes following Conventional Commits specification
prefixes = [
{ title = "feat", description = "A new feature" },
{ title = "fix", description = "A bug fix" },
{ title = "docs", description = "Documentation changes" },
{ title = "style", description = "Changes that do not affect code meaning" },
{ title = "refactor", description = "Code change that neither fixes a bug nor adds a feature" },
{ title = "perf", description = "Code change that improves performance" },
{ title = "test", description = "Adding missing tests or correcting existing tests" },
{ title = "build", description = "Changes that affect the build system or external dependencies" },
{ title = "ci", description = "Changes to CI configuration files and scripts" },
{ title = "chore", description = "Other changes that don't modify src or test files" },
{ title = "revert", description = "Reverts a previous commit" }
]
# Optional scopes to categorize changes
scopes = [
"core",
"ui",
"docs",
"tests",
"deps"
]
# Subject line length constraints
max_subject_len = 72
min_subject_len = 3
# Feature toggles
use_emoji = true # Add emojis to commit messages
update_changelog = true # Update CHANGELOG.md automatically
validate_commit_msg = true # Validate commit messages against conventional format
# Templates directory for custom commit templates
templates_dir = "~/.commitkit/templates"This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Feel free to open issues or submit pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes using conventional commits
- Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request