cmt (short for commit) is a command-line tool designed to help developers write consistent and standardized commit messages across different commit conventions.
Open source contributors often face a unique challenge when working across multiple projects: navigating the diverse landscape of commit conventions. Each repository may adhere to its own set of rules for structuring commit messages, from Conventional Commits to Gitmoji, or even custom formats. This inconsistency can lead to confusion, reduced productivity, and potential errors in version control.
cmt aims to alleviate this pain point by providing a flexible, easy-to-use tool that adapts to different commit conventions. By standardizing the commit process across projects, cmt helps contributors maintain consistency and focus on what truly matters - their code contributions.
Supported conventions at the time of writing:
npm install -g @segersniels/cmtcurl -sSL https://raw.githubusercontent.com/segersniels/cmt/master/scripts/install.sh | bashOr download one of the released binaries for your operating system here.
You can choose to use cmt in an existing project without adding a new configuration file. If no .cmtrc.json file is found, cmt will attempt to determine the commit convention from the last commit message.
First initialize cmt in your project:
cmt init
This will create a .cmtrc.json file with your preferred settings.
After that simple create a commit:
cmt commit
or use the shorthand:
cmt c
Follow the interactive prompts to construct your commit.
Update cmt to the latest version:
cmt update
cmt uses a .cmtrc.json file to store configuration. You can edit this file manually or run cmt init to set up your preferences.
