Everything you need to know about using CommitPolice.
CommitPolice requires Node.js 18 or higher. Install it globally using npm:
npm install -g commitpolice
Or using yarn:
yarn global add commitpolice
Verify the installation:
commitpolice --version
Using CommitPolice is as simple as three steps:
git add .
git commitp
Press Y to commit or n to cancel.
CommitPolice can be invoked as git commitp or commitpolice.
| Option | Description |
|---|---|
| -y, --yes | Skip confirmation prompt and commit automatically |
| -d, --dry-run | Generate message without creating a commit |
| --api-url <url> | Use a custom API endpoint |
| -V, --version | Show version number |
| -h, --help | Show help information |
git add . git commitp
git commitp -y
git commitp --dry-run
$ git add src/auth.js
$ git commitp
Analyzing 45 lines of changes...
Generated commit message:
feat(auth): add password reset functionality
Commit with this message? (Y/n) Y
Committed successfully!
Commit: a1b2c3d
Branch: main
Stats: 1 file(s), +42, -3CommitPolice generates messages following the Conventional Commits specification. This provides a standardized format that makes commit history more readable.
type(scope): description
| Type | Description |
|---|---|
| feat | A new feature |
| fix | A bug fix |
| docs | Documentation changes |
| style | Code style changes (formatting, semicolons, etc.) |
| refactor | Code refactoring without feature changes |
| perf | Performance improvements |
| test | Adding or updating tests |
| chore | Maintenance tasks, dependency updates |
| ci | CI/CD configuration changes |
| build | Build system changes |
You need to stage files before running CommitPolice.
git add <files> # Stage specific files git add . # Stage all changes
Make sure you're in a directory with an initialized git repository.
git init # Initialize a new repo
Check your internet connection. If the issue persists, the service might be temporarily unavailable. You can check status at our GitHub issues page.
Yes! CommitPolice is 100% free. We cover the AI costs so you don't have to bring your own API key. If you find it useful, consider buying us a coffee!
Only your git diff (the changes you've staged) is sent to our API for analysis. Your full codebase is never uploaded. The diff is processed and immediately discarded.
CommitPolice uses Claude 3 Haiku by Anthropic - a fast, efficient model optimized for quick responses.
Yes! Use the -y flag to skip confirmation prompts in automated environments.
Just press n when prompted to cancel, then write your own commit message manually.
Found a bug or have a feature request? Open an issue on GitHub.