Commitizen is a command line utility that prompts contributors to fill in required commit message fields at commit time, so messages follow the format defined by project maintainers. It is aimed at contributors and maintainers of repositories that want consistent commit messages. It works through adapters, such as cz-conventional-changelog, configured in package.json or a .czrc file.
Install & use
Install
npm install -g commitizen
Usage
git cz
commitizen/cz-cli is a third-party open-source project, listed here from public GitHub data. ImuTechz did not write it and has not reviewed or security-audited its code. Read the source and its permissions before you install or run it.
Features
Prompts for required commit fields when committing
Formats commit messages per project-defined standards
Uses pluggable adapters like cz-conventional-changelog
Configured via package.json config.commitizen or .czrc
Can be installed globally or locally as a dev dependency
Adapter path resolved via require.resolve
Best for
Enforcing conventional commit messages
Onboarding contributors to a commit format
Standardizing commits across a team
Setting up a repo with the conventional-changelog adapter
Pros
Gives instant feedback on commit message formatting
Avoids digging through CONTRIBUTING.md for the preferred format
Local install lets developers run the same version on every machine
Cons
Tested against Node.js 12, 14 and 16; requires npm 6 or greater
In non-Commitizen-friendly repos, npx cz uses the streamich/git-cz adapter
czConfig is deprecated and must be migrated to the new format