TypeScript-first conventional commits from a single commit.config.ts — composable plugins, optional AI, and the same rules in CI.
better-commit helps you and your AI tools ship consistent commit messages without juggling ad hoc scripts. One config file, one CLI (bc / better-commit), and you are productive in minutes.
npm install -D @better-commit/cli
bc init
bcbc runs the interactive commit flow. Use bc doctor to verify Node, config load, plugins, and AI providers. Non-interactive bc init supports -q; add -f to replace an existing file.
conventionalCommits— Allowed types and optional scopes; drives validation inbc check.defineConfig+ plugins — ComposeconventionalCommits(required) and optionalaiSuggestfor message suggestions.bc check— Validate the last message,COMMIT_EDITMSG, or a ref range — same rules as locally, ideal for CI.
bc and bc commit guide the message; bc fix amends the last commit; bc retry reuses cached form data when you need another try.
Discovery walks up for commit.config.ts, commit.config.mts, or commit.config.js. Import helpers from @better-commit/cli/config for typed, small surface area.
Optional aiSuggest plugs into Cursor, Claude, Codex, OpenAI, Anthropic, and more. Use --no-ai or BETTER_COMMIT_NO_AI=1 for fully manual flows.
Run bc check in pipelines; wire exec bc commit in Husky prepare-commit-msg so local commits match automation.
Install @better-commit/cli from npm. For flags, bc check modes, AI providers (bc doctor), and security notes, see the repository and package source.