format-commit
v0.4.0
Published
Lightweight CLI to standardize commit messages
Maintainers
Readme
format-commit
🚀 Lightweight CLI for consistent Git workflow formatting.
Standardize your commit messages and branch naming with configurable rules, and guide your development workflow through automated scripts. No bloat, no complexity — just clean, consistent Git practices.
Installation
npm i format-commit --save-devUsage
Add to your package.json scripts:
"scripts": {
"commit": "format-commit",
"branch": "format-commit --branch"
}Then use:
npm run commit # to commit
npm run branch # to create a branchGlobal Installation
Or install globally:
npm i -g format-commit
format-commit
format-commit --branchInitial Setup
On first use, format-commit will prompt you to configure your commit and branch formats, then create a commit-config.json file.
To reconfigure later, run:
format-commit --configConfiguration
| Property | Description |
| :------- | :---------- |
| format | Commit title format:1 - (type) Name / 2 - (type) name3 - type: Name / 4 - type: name5 - type(scope) Name / 6 - type(scope) name7 - type(scope): Name / 8 - type(scope): name |
| branchFormat | Branch naming format:1 - type/description2 - type/scope/description |
| types | Allowed commit and branch types (default: feat, fix, core, test, config, doc) |
| scopes | Scopes for commit/branch categorization (used in formats 5-8 for commits, format 2 for branches) |
| minLength | Minimum length required for the commit title |
| maxLength | Maximum length required for the commit title and branch description |
| changeVersion | Version change policy:never - Always prompt for version changeonly on release branch - Only release branch commits require version changealways - All commits require version change |
| releaseBranch | Main/release branch name (used if changeVersion = only on release branch) |
| showAllVersionTypes | Show all version types or only main ones (major/minor/patch/custom) |
CLI Options
| Option | Description |
| :----- | :---------- |
| --config / -c | Generate or update configuration file |
| --branch / -b | Create a new standardized branch |
| --test / -t | Test mode - preview without executing Git commands |
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
