@lunchbox-tools/commit
Interactive CLI prompt that generates conventional commit messages with type, scope, subject, body, and breaking change support.
Usage
Run it without installing anything, from anywhere inside a git repository:
npx @lunchbox-tools/commityarn dlx @lunchbox-tools/commitpnpm dlx @lunchbox-tools/commitInstallation
Install it globally to get the lunchbox-commit command everywhere:
npm install -g @lunchbox-tools/commit
lunchbox-commitOr add it to a project, to pin the version for the whole team:
npm install -D @lunchbox-tools/commityarn add -D @lunchbox-tools/commitpnpm add -D @lunchbox-tools/commitThen add an npm script in your package.json:
{
"scripts": {
"commit": "lunchbox-commit"
}
}Run it with:
pnpm commitOptions are read from lunchbox.config.json. The default scopes are generic, so you will most likely want to set your own commitScopes there.
Use it from a script
You can also call it from your own script, for instance to compute the configuration:
#!/usr/bin/env node
import { setupCommitPrompt } from '@lunchbox-tools/commit';
setupCommitPrompt().run();Prompts
Stage your changes with git add first: the command stops right away when nothing is staged.
The prompt will guide you through:
- Type — Select the kind of change (feat, fix, docs, refactor, etc.)
- Scopes — Select one or more scopes affected by the change
- Subject — Short description of the change
- Body — Optional detailed description
- Breaking change — Optional breaking change description
- Ticket — Mandatory when
ticketProvideris configured; skipped when the branch name already contains it
The generated message follows the format:
type(scope1, scope2)!: subject
body
BREAKING CHANGE: descriptionDefault Commit Types
| Value | Label | Changelog Section |
|---|---|---|
feat | A new feature | Features |
fix | A bug fix | Bug Fixes |
docs | Documentation only changes | Documentation |
refactor | Code change that neither fixes a bug nor adds a feature | Refactor |
build | Build system or bundler configuration changes | Build |
test | Adding missing tests | Tests |
ci | Changes to CI/CD pipeline configuration | CI |
release | Version bumps and changelog updates | Release |
Default Commit Scopes
| Value | Label |
|---|---|
deps | Dependency version changes |
workspace | Root-level monorepo concerns |
Husky Integration
You can use @lunchbox-tools/commit as a replacement for git commit by combining it with husky to enforce structured commits across your team.
1. Install husky
pnpm add -D huskynpm install -D huskyyarn add -D husky2. Initialize husky
npx husky initThis creates a .husky/ directory in your project root.
3. Install the commit tool
pnpm add -D @lunchbox-tools/commitnpm install -D @lunchbox-tools/commityarn add -D @lunchbox-tools/commit4. Add an npm script
{
"scripts": {
"commit": "lunchbox-commit"
}
}5. Use it
Instead of running git commit directly, run:
pnpm commitThis launches the interactive prompt, generates the message, and commits for you.
TIP
If you have a commit-msg hook that validates the message format, @lunchbox-tools/commit already produces compliant messages — no extra validation needed. You can also pass noVerify: true in the config to skip hooks during the commit if needed.