commit-msg hook into .git/hooks/commit-msg that validates every commit message against the project’s conventional-commit rules. It replaces husky and commitlint: the rules live in @talosjs/cli, so there is no .commitlintrc.ts to maintain. The hook re-invokes the CLI (commitlint:check) to do the check, so it works without a global install. Running it also clears any core.hooksPath a previous husky setup left behind, so git uses the standard hooks directory again.
app:init runs this for you, and generated projects re-install the hook on every bun install through the prepare script. Run it yourself after cloning a repository, or any time the hook goes missing or the repo moves to a new path.
Usage
Examples
Options
This command takes no options.What the hook validates
The installed hook accepts messages in the formtype(scope): Subject:
- type — one of
build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test, in lower-case. - scope — required and lower-case, and either
commonor the name of a package or module directory in the workspace. Scopes are discovered automatically, so a new module or package is a valid scope with no config change. Multiple scopes are allowed (feat(app, shared): ...). - subject — non-empty, starts with an upper-case letter, and does not end with a period. The whole header must be 100 characters or fewer.
fixup!/squash!) messages are ignored. See commitlint:check, the command the hook runs to perform the check.