commit-prompt
This page shows how to write commit messages in the Conventional Commits format by answering questions instead of remembering the rules. It suits teams where not everyone has the format memorised.
What you get
A pnpm commit command that asks for the type, scope and description, then runs the commit for you. It is off by default.
Add it
What changed:
Use it
Stage your changes, then run the prompt instead of git commit:
It asks for the type, the scope, a short description, a longer one, and any breaking change or issue it closes. Then it commits with a message like this:
Configure it
Everything is in cz.config.js, and the only edit most projects need is the scope list:
How it works
The prompt tool reads cz.config.js, builds the message from your answers and passes it to git commit. The types are the eleven that commitlint's conventional config accepts.
The header limit and lowercase subject match its rules. A message from the prompt passes the check in git-hooks when that is installed.
The prompt does not install a hook of its own. Plain git commit still opens your editor as before, and a hand-written message goes through the same commitlint check.
Gotchas
- The prompt needs a terminal. In CI or a script, use
git commit -m "feat(cart): ..."directly. - Emoji is switched off. Set
useEmojitotrueif your team wants it, but check that your commitlint rules allow it.