committier β€οΈ commitlint
π AI commit generator is now available in Beta (Free, Local, Light, Zero-Deploy, Fast, CPU friendly)
- Fix and format rough commit messages into conventioanl commits
- Adopt commitlint
- Automatically format once
git commit -m '...', see Git hook setup - Automatically append emoji, scope, and default commit messages
- User-friendly commit CLI tool
- AI commits generator
A completely free, local, light, cpu, zero-deploy AI assitant. Use AI with just one command. No API, no prerequisites and no setup needed.
- β¨ Generate commit message
- π Summarize changes
- π§ Provide suggestions for improvement
- π Find bugs
- π¬ Ask AI
committier fixes and formats your git commit messages meet the conventional commit format. Unlike commitlint, it only attempts to format and fix formatting styles without performing strict rules validation. Similar to Prettier and ESLint, it integrates well with both.
It does:
- Attemps to format and fix
- Attemps to infer the type, scope, breaking change mark(!), description
- Infer the scope from workspace package names
- Remove extra spaces in the body and footer
- And more...
pnpm add committier -D
yarn add committier -D
npm i committier -D
Or install globally
pnpm add -g committier
Or directly execute
npx committier <command>
pnpm dlx committier <command>
NOTE: committier ai is now in Beta
pnpm add committier@beta -D
- CLI
- Integrate commitlint
- Module API
committier format <message>
Format and preview the message
committier edit <file>
Checkout husky official documentation
pnpm add husky -D
pnpm husky initEdit .husky/commit-msg, add npx --no -- committier edit $1
+ npx --no -- committier edit $1
npx --no -- commitlint --edit $1Note, there is no '--' before 'edit' command in committier but commitlint.
committier ai
committier commit
pnpm committier commitOr you can add a script in package.json
{
"scripts": {
"commit": "committier commit",
"commit:ai": "committier ai"
}
}Then
pnpm commitIt's useful if you only want to test the commit experience.
committier commit --dry-run
Integrate commitlint
Make sure commitier runs before commitlint
.husky/commit-msg
npx --no -- committier edit $1
npx --no -- commitlint --edit $1If your enabled autoEmoji: true (default: true), make sure to set our commitlintEmojiParser, because commitlint doesn't accept any emoji by default.
commitlint.config.js
import { commitlintEmojiParser } from "committier/commitlint-emoji-parser"";
export default {
extends: ["@commitlint/config-conventional"],
parserPreset: commitlintEmojiParser,
};Create a .committerrc.json file at root, you can partially add fields to override the default config.
Default config:
{
"autoEmoji": true, // boolean
"autoScope": false, // boolean | 'replaceToPackageName' (true) | 'defaultToPackageName'
"defaultType": "fix",
"defaultDescription": false, // boolean | "fileName" (true) | "fileBasename" | "filePath"
"types": {
"feat": {
"emoji": "β¨",
"title": "Feature",
"description": "A new feature"
},
"fix": {
"emoji": "π",
"title": "Bug Fixes",
"description": "A bug fix"
},
"refactor": {
"emoji": "β»οΈ",
"title": "Code Refactoring",
"description": "A code change that neither fixes a bug nor adds a feature"
},
"perf": {
"emoji": "β‘οΈ",
"title": "Performance Improvements",
"description": "A code change that improves performance"
},
"chore": {
"emoji": "π¨",
"title": "Chores",
"description": "Other changes that don't modify src or test files",
"scopes": [
{
"match": "release",
"emoji": "π",
"title": "Release",
"description": "A new release"
}
]
},
"test": {
"emoji": "π§ͺ",
"title": "Tests",
"description": "Adding missing tests or correcting existing tests"
},
"style": {
"emoji": "π",
"title": "Styles",
"description": "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)"
},
"docs": {
"emoji": "π",
"title": "Documentation",
"description": "Documentation only changes"
},
"revert": {
"emoji": "β",
"title": "Reverts",
"description": "Reverts a previous commit"
},
"build": {
"emoji": "π¦οΈ",
"title": "Builds",
"description": "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)"
},
"ci": {
"emoji": "π·",
"title": "Continuous Integrations",
"description": "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)"
},
"breakingChange": {
"emoji": "π₯",
"title": "Breaking Changes",
"description": "Introduce breaking changes."
}
}
}ISC




