commitsent
v0.1.2
Published
Generate professional, semantic commit messages from your git diff using LLMs (OpenRouter/OpenAI).
Maintainers
Readme
commitsent
Generate professional, semantic git commit messages from your git diff using LLMs.
Use without installing (recommended):
npx commitsentOr install globally:
npm i -g commitsentRequirements
- Node.js >= 18
- Git installed and run from inside a git repository
Quick start
Run in your repo with changes:
npx commitsent --conventional --emoji --model gpt-4o-miniFor staged changes only:
git add .
npx commitsent --staged --conventional --emojiCommit automatically:
npx commitsent --conventional --emoji --commitOptions
--stagedUse staged diff (git diff --staged).--conventionalPrefer Conventional Commits format (e.g.,fix(auth): ...).--emojiPrefix with an emoji matching the type.--commitRungit commit -m "..."with the suggestion.--dry-runPrint the suggestion only (default behavior if not committing).--model <name>Preferred model name (optional).--max-tokens <n>Max output tokens (default 100, clamped [16..400]).--temperature <n>Sampling temperature (default 0.2, clamped [0..1]).
Examples
- Unstaged changes:
npx commitsent - Staged only + Conventional + Emoji:
npx commitsent --staged --conventional --emoji - Auto-commit with model:
npx commitsent --commit --model gpt-4o-mini
Security
- No secrets are hardcoded in the package.
- Git commit uses safe spawn (no shell interpolation).
- Numeric flags are clamped; model names are sanitized.
- Network calls use timeouts and handle errors gracefully.
- Diff size is truncated to limit data sent to providers.
License
MIT © Favour Idowu
Contributing
PRs welcome. Please keep the CLI fast, dependency-light, and secure-by-default.
