Getting started
commit-jazzer asks a few questions (type, scope, title, …) and writes a Conventional Commits message with an emoji. It needs Node.js 22.13 or newer and git.
Install
npm install --save-dev commit-jazzerpnpm add --save-dev commit-jazzeryarn add --dev commit-jazzerbun add --dev commit-jazzerThe package installs the command under two names, jazzer and commit-jazzer. Without installing, use the package name: npx commit-jazzer. (npx jazzer would download an unrelated package called jazzer.)
Commit
Stage your changes and run:
npx jazzerIt asks the questions, shows the message, and runs git commit once you confirm. Options for git commit go after --:
npx jazzer -- --no-verify -SA script makes it shorter for the team:
{
"scripts": {
"commit": "jazzer"
}
}Or let git commit ask
With the hook installed, a plain git commit asks the questions and opens the editor with the message filled in. git commit -m "…", merges and amends are left alone, and so are commits from IDEs and GUI clients, which have no terminal to ask in.
npx jazzer init --hook # install
npx jazzer init --remove-hook # removeinit --hook also writes a config to the repository root when there is none. git commit -m still skips the questions; npx jazzer init --lint adds a commit-msg hook that checks those messages with jazzer lint.
The hook goes to .husky/prepare-commit-msg when the project uses husky, and to git's hooks directory otherwise (core.hooksPath is respected). See Recipes for lefthook and simple-git-hooks.
Or keep using git cz
If the team already runs Commitizen, point it at commit-jazzer:
{
"config": {
"commitizen": {
"path": "commit-jazzer"
}
}
}For a global setup, install both packages globally and put the path into ~/.czrc:
npm install --global commitizen commit-jazzer
echo '{ "path": "commit-jazzer" }' > ~/.czrcConfigure
Everything works without a config. To change the questions, the types or the format, create one:
npx jazzer init # jazzer.config.json
npx jazzer init --ts # jazzer.config.tsContinue with Configuration, or open the Playground to see how the options change the message.
Uninstall
npx jazzer init --remove-hook # if you installed the hook
npm uninstall commit-jazzerThen delete jazzer.config.* and the config.commitizen entry of package.json, if you added them.