@fridzema/cmt
v1.1.1
Published
AI-powered conventional commits from unstaged changes. Fast.
Maintainers
Readme
@fridzema/cmt
AI-powered conventional commits from unstaged git changes.
Install
npm install -g @fridzema/cmtFirst Run
On first run with no config, cmt opens a setup wizard:
Welcome to @fridzema/cmt!
Get your OpenRouter API key at: https://openrouter.ai/keys
? OpenRouter API key: ••••••••••••••••••
Config saved. Ready to commit!Config is saved to your platform's app-data directory:
- macOS:
~/Library/Application Support/@fridzema/cmt/config.json - Linux:
~/.config/@fridzema/cmt/config.json - Windows:
%APPDATA%\@fridzema\cmt\config.json
After setup, your original commit task runs immediately — no second invocation needed.
Usage
# Group unstaged changes into logical commits and auto-commit (default)
cmt
# Single combined commit for all changes
cmt --all
# Open interactive TUI to review, edit, or skip groups before committing
cmt --review
# Use a specific OpenRouter model for this run
cmt --model openai/gpt-4oHow It Works
- Reads
git diff(unstaged) andgit status - Sends diff + context to OpenRouter AI
- AI groups related changes into logical conventional commits
- All groups are committed automatically by default
- With
--review: opens an interactive TUI where you can navigate groups, edit subjects, skip individual commits, then confirm
Flags
| Flag | Description |
| ---------------- | ------------------------------------------------- |
| --all | Single combined commit instead of topic groups |
| --review | Open interactive TUI to review/edit before commit |
| --model <slug> | OpenRouter model slug for this invocation |
| --version | Print version |
| --help | Show help |
Default Model
anthropic/claude-sonnet-4.6 via OpenRouter. Override per-run with --model.
To change the default permanently, edit your config file and update the model field.
Dependencies
| Package | Purpose |
| ------------------- | ---------------------------------------------------------------- |
| commander | CLI argument parsing and help generation |
| openai | HTTP client pointed at OpenRouter (same API, different base URL) |
| simple-git | Git operations: diff, status, stage, commit |
| @inquirer/prompts | Interactive prompts for wizard and confirmation |
| env-paths | Platform-appropriate config directory (macOS/Linux/Windows) |
| zod | Runtime validation of AI JSON responses |
| picocolors | Terminal color output |
FAQ
The AI returned invalid JSON.
cmt retries once automatically. If it fails again, it exits with an error — try again or use --all for a simpler prompt.
My diff is too large.
Diffs over 50 KB are truncated before sending to the AI. For large repos, use --all for a single commit.
I already staged some changes.
cmt works on unstaged changes only. Run git reset HEAD to unstage, then run cmt.
Can I use a different AI provider?
No — OpenRouter is locked. Use --model to switch models within OpenRouter's catalog: openrouter.ai/models.
