commit-conventional
v1.0.1
Published
A CLI tool for authoring Git commits that follow the Conventional Commits specification.
Maintainers
Readme
commit-conventional
A CLI tool for authoring Git commits that follow the Conventional Commits specification.
Features
- 🎯 Interactive prompts - Guided commit message creation
- 📋 Conventional Commits compliance - Follows the standard specification
- ✅ Validation - Ensures proper commit message format and length
- 🔍 Staged changes detection - Warns when no changes are staged
- 💥 Breaking changes support - Marks breaking changes with
! - 📝 Optional detailed body - Add comprehensive commit descriptions
Installation
Global Installation
npm install -g commit-conventionalLocal Installation
npm install --save-dev commit-conventionalUsage
- Stage your changes with
git add - Run the tool:
npx commit-conventional # or if installed globally commit-conventional - Follow the interactive prompts:
- Type: Select from conventional commit types (feat, fix, docs, etc.)
- Scope: Optional scope (e.g., auth, api, ui)
- Subject: Short description (max 72 characters)
- Body: Optional detailed description
- Breaking: Mark if this is a breaking change
- Confirm: Review and confirm the commit
Showcase
$ npx commit-conventional
? Type (build, chore, ci, docs, feat, fix, perf, refactor, style, test)
? Scope (optional) › auth
? Short description (subject) › add user authentication system
? Added detailed body? (y/N)
? Breaking change? (y/N)
? Create commit with above information? (Y/n)
feat(auth): add user authentication systemCommit Types
The tool supports all standard conventional commit types:
build- Changes that affect the build system or external dependencieschore- Other changes that don't modify src or test filesci- Changes to CI configuration files and scriptsdocs- Documentation only changesfeat- A new featurefix- A bug fixperf- A code change that improves performancerefactor- A code change that neither fixes a bug nor adds a featurestyle- Changes that do not affect the meaning of the codetest- Adding missing tests or correcting existing tests
Example Output
feat(auth): add user authentication system
Implemented JWT-based authentication with login/logout functionality.
Added middleware for protected routes and token validation.
BREAKING CHANGE: Updated user schema, requires database migration.Development
Build
npm run buildRun locally
npm run startRequirements
- Node.js >= 14
- Git repository
- TypeScript (for development)
License
ISC
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Use this tool to create conventional commits!
- Submit a pull request
