Commitier is a command-line tool designed to help developers create consistent and meaningful commit messages. Built with Rust, it provides a structured way to format commit messages and can even create commits directly.
- Interactive commit message creation
- Customizable commit message prefixes
- Option to create Git commits directly
- View recent commit history
Before you can use Commitier, you need to have Rust installed on your system. If you haven't installed Rust yet, follow these steps:
- Visit https://www.rust-lang.org/tools/install
- Follow the instructions for your operating system
- After installation, restart your terminal
You can verify your Rust installation by running:
rustc --version
Currently, Commitier is not packaged for distribution. To use it, you'll need to clone the repository and run it locally:
-
Clone the repository:
git clone https://github.com/affanmustafa/commitier.git cd commitier
-
Build the project:
cargo build --release
Before first use, initialize Commitier in your project:
cargo run init
This will prompt you to set up your preferred commit message prefixes.
git add .
This will stage all the files in the current directory.
To generate a commit message:
cargo run commit
This will guide you through selecting a prefix and entering a commit description.
To generate a commit message and create a Git commit:
cargo run commit --create-commit
To view recent commits:
cargo run check-commits
By default, this shows the last 5 commits. You can specify a different number:
cargo run check-commits --count 10
Commitier uses a custom field in your project's package.json
file to store commit message prefixes. After initialization, your package.json
will include:
{
"commitier-prefixes": [
"feat:",
"fix:",
"docs:",
"style:",
"refactor:",
"test:",
"chore:"
]
}
You can manually edit this list to customize your commit prefixes.
feat:
- New featurefix:
- Bug fixdocs:
- Documentation changesstyle:
- Formatting, missing semi colons, etc; no code changerefactor:
- Refactoring production codetest:
- Adding missing tests, refactoring tests; no production code changechore:
- Updating grunt tasks etc; no production code change
In the future, Commitier will be packaged as an npm module for easier installation and use.
Affan Mustafa
- Inspired by Commitizen, a tool for creating standardized commit messages
- Built with Rust