@missb/git-commit-m
v1.0.12
Published
A CLI tool that automatically generates commit messages using AI and commits changes
Maintainers
Readme
git-commit-m
A CLI tool that automatically generates commit messages using AI and commits changes.
Installation
npm install -g @missb/git-commit-mOr install with pnpm:
pnpm install -g @missb/git-commit-mOr install with yarn:
yarn global add @missb/git-commit-mOr use directly with npx:
npx @missb/git-commit-mUsage
git-commit-m
Automatically generates commit messages using AI and commits changes:
git-commit-mThis command will:
- Stage all changes (
git add .) - Generate a diff of staged changes
- Use an AI model to create a meaningful commit message
- Commit with the generated message
- Display the time taken for the entire process
Sample Output
$ git-commit-m
Adding all changes to git...
Generating commit message with gemini...
Commit message: feat: Change package name to `@missb/git-commit-m`
The package name has been updated to `@missb/git-commit-m` in `package.json` and all corresponding references in the `README.md` have been changed from `git-commit--message` to `git-commit-m`.
Changes committed successfully.
Successfully processed in 14.19 seconds.Options
Usage: git-commit-m [options]
CLI tool that automatically generates commit messages using AI and commits changes
Options:
-n, --no-add-dot skip the "git add ." step
-p, --prompt-arg <arg> specify the prompt argument to pass to the AI tool (default: "-p")
--provider <provider> specify the AI provider to use (gemini, qwen, claude, codex, continue, or any string) (default: "gemini")
--diff <file> specify a diff file to use instead of generating one from git
--no-commit dry run mode - generate commit message without committing
--no-signature disable adding signature to commit message
-h, --help display help for commandExamples
# Normal usage (uses gemini as default provider)
git-commit-m
# Skip git add . step
git-commit-m --no-add-dot
# or
git-commit-m -n
# Use a custom prompt argument
git-commit-m --prompt-arg "--prompt"
# or
git-commit-m -p "--prompt"
# Use a different AI provider
git-commit-m --provider qwen
git-commit-m --provider claude
git-commit-m --provider codex
# Use a specific diff file instead of generating one from git
git-commit-m --diff path/to/diff.txt
# Dry run mode - generate commit message without committing
git-commit-m --no-commit
# Disable adding signature to commit message
git-commit-m --no-signature
# Combine multiple options
git-commit-m --no-add-dot --prompt-arg "--prompt" --provider qwen --no-commit --no-signatureSupported providers:
gemini(default)qwenclaudecodexcn (continue)- Any other string (will attempt to execute as a command)
Requires one of the following AI tools to be installed:
gemini(primary)- Other AI commit tools (fallback)
Installation links for AI providers:
If no AI tool is available, it will fall back to a generic "Update files" message.
How it works
- Adds all changes to git staging area (unless
--no-add-dotis specified) - Creates a diff of the staged changes (or uses provided diff file with
--diff) - Uses AI to generate a meaningful commit message based on the diff
- Appends a signature to the commit message indicating it was generated by @missb/git-commit-m (unless
--no-signatureis specified) - Commits the changes with the generated message (unless
--diffor--no-commitis used) - Displays the time taken for the entire process
Requirements
- Node.js >= 12
- Git
- An AI tool (like
gemini) for generating commit messages
Development
This project is written in TypeScript with a modular structure:
bin/commit.ts- Main CLI implementationindex.ts- Programmatic API entry point
To build:
npm run buildLicense
MIT
