- π¨ Beautiful Colorful Output - Terminal UI with colors and emojis
- π Conventional Commits - Full support for the conventional commits specification
- π€ Husky Integration - Seamlessly works with Husky Git hooks
- β Message Validation - Validates commit messages before creation
- β‘ Interactive Prompts - User-friendly command line interface
- π§ Flexible Configuration - Customizable commit types and scopes
- π¦ Easy Installation - Install globally and use anywhere
- π TypeScript - Written in TypeScript for type safety
npm install -g cli-commitnpm install --save-dev cli-commitnpx cli-commit commitcli-commit commit
# or
cc commit
# or
cc c# Create a feature commit
cli-commit commit -t feat -m "add user authentication"
# Create a fix commit with scope
cli-commit commit -t fix -s api -m "resolve CORS issue"
# Create a breaking change
cli-commit commit -t feat -m "change API structure" --breaking
# Commit all changes
cli-commit commit -t feat -m "major update" --all| Type | Description | Emoji |
|---|---|---|
feat |
A new feature | β¨ |
fix |
A bug fix | π |
docs |
Documentation only changes | π |
style |
Code style changes (formatting) | π |
refactor |
Code refactoring | β»οΈ |
perf |
Performance improvements | β‘ |
test |
Adding or updating tests | π§ͺ |
build |
Build system or dependency changes | π¦ |
ci |
CI/CD configuration changes | π· |
chore |
Maintenance tasks | π§ |
revert |
Reverting changes | βͺ |
merge |
Merging branches | π |
hotfix |
Urgent bug fix | π |
Create a new conventional commit.
Options:
| Option | Alias | Description | Example |
|---|---|---|---|
--type |
-t |
Commit type | -t feat |
--scope |
-s |
Scope of the change | -s api |
--message |
-m |
Commit message | -m "add feature" |
--body |
-b |
Commit body | -b "details" |
--footer |
-f |
Commit footer | -f "Closes #123" |
--breaking |
-B |
Breaking change flag | --breaking |
--issue |
-i |
Issue reference | -i #123 |
--all |
-a |
Stage all changes | --all |
--dry-run |
-d |
Show without committing | --dry-run |
--skip-validation |
Skip validation | --skip-validation |
|
--skip-push |
Skip push after commit | --skip-push |
|
--no-emoji |
Disable emoji output | --no-emoji |
Examples:
# Basic usage
cli-commit commit
# With type and message
cli-commit commit -t fix -m "resolve login bug"
# With scope
cli-commit commit -t feat -s auth -m "add OAuth support"
# Breaking change
cli-commit commit -t api -m "change response format" --breaking
# Commit all changes
cli-commit commit -t chore -m "update dependencies" -a
# Dry run
cli-commit commit -t feat -m "new feature" --dry-runList all available commit types.
cli-commit list
# Output:
# β¨ feat Feature A new feature
# π fix Bug Fix A bug fix
# π docs Documentation Documentation only changes
# ...Show git status and commit readiness.
cli-commit statusValidate a commit message.
cli-commit validate "feat(api): add new endpoint"Show CLI Commit information.
cli-commit infoββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β CLI Commit - Conventional Commits Tool β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Branch: main
β Husky installed (9.0.0)
β Commitlint configured
? Select the type of commit: (Use arrow keys)
β¨ feat - A new feature
π fix - A bug fix
...
β Commit created successfully!
Hash: a1b2c3d
? Push to remote? (y/N)
Commit Preview:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β¨ feat(api): add user authentication
Add JWT-based authentication with refresh tokens
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Is this a BREAKING CHANGE? (y/N)
CLI Commit works seamlessly with Husky. Just install Husky and use cli-commit in your commit workflow:
# Install Husky
npm install husky --save-dev
npx husky install
# Add to package.json
{
"scripts": {
"commit": "cli-commit commit"
}
}Validate commit messages with commitlint:
npm install @commitlint/config-conventional --save-devAdd to your ~/.gitconfig:
[alias]
cc = !cli-commit commit
ccc = !cli-commit commit --allcli-commit/
βββ bin/
β βββ cli-commit.js # Binary entry point
β βββ postinstall.js # Post-install script
βββ src/
β βββ index.ts # Main CLI entry
β βββ commands/
β β βββ commit.ts # Commit command
β βββ config/
β β βββ commit-config.ts # Commit types & prompts
β βββ types/
β β βββ index.ts # TypeScript types
β βββ utils/
β βββ colors.ts # Color utilities
β βββ commit-builder.ts # Message builder
β βββ git.ts # Git utilities
βββ test/ # Test files
βββ docs/ # Documentation
βββ package.json
βββ tsconfig.json
βββ README.md
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run in watch mode
npm run test -- --watch- Fork the repository
- Create your feature branch (
git checkout -b feat/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feat/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
LTD - LaboratΓ³rio de TransformaΓ§Γ£o Digital
- Website: ltdestacio.com.br
- Email: ltd@estacio.edu.br
Made with β€οΈ by LTD - LaboratΓ³rio de TransformaΓ§Γ£o Digital
EstΓ‘cio - Campus FlorianΓ³polis