We use cookies to understand how the site is used and to display ads. Analytics and advertising only run after you accept. You can change your choice anytime. Privacy policy

Skip to content
devvkit
$devvkit learn --librarie commitizen:-interactive-commit-wizard-guide

commitizen: Interactive Commit Wizard Guide

[oss-stack][commits][conventional-commits][developer-experience]
Open Source
Install
# Global (any repo):
npm install -g commitizen
cz

# Per project:
npm install --save-dev commitizen
npx commitizen init cz-conventional-changelog --save-dev --save-exact

commitizen replaces the blank `git commit` prompt with a guided questionnaire: pick the type (feat, fix, docs...), add a scope, write the description, and optionally a body and breaking change. The result is a well-formed conventional commit every time: no memorization, no lint failures.

Teams adopt it in two forms: the interactive CLI for humans and the cz-friendly aliases for CI. Combined with commitlint it closes the loop: the wizard prevents bad commits at the source, the linter catches anything the wizard did not produce.

Setup

Initialize a project· Install the conventional changelog adapter.
npm install --save-dev commitizen
npx commitizen init cz-conventional-changelog --save-dev --save-exact

# Adds a "cz" script to package.json and config to package.json:
"config": { "commitizen": { "path": "./node_modules/cz-conventional-changelog" } }

Configuration

Custom adapters· Choose or build an adapter that matches your workflow.
# jira-smart-commit adapter:
npx commitizen init cz-jira-smart-commit --save-dev --save-exact

# berry adapter for npm 7+
npx commitizen init cz-conventional-changelog --save-dev --save-exact --force

# The MUI style (Conventional Commits + PR-friendly):
cz-conventional-changelog with custom scope answers

Usage

Commit with the wizard· Replace git commit with cz.
# Global install:
cz

# Project script:
npm run cz

# Pass through flags (adiacitve, amend...):
cz -a
cz --amend

Integration

Alias as git cz· Use cz through git for muscle memory.
git config --global alias.c z
# or
npm pkg set scripts.commit="cz"

# Speed tip: after "git cz" commits, hook commitlint pre-commit
# so the linter is a safety net, not a gatekeeper.