Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@missb/git-commit-m) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
git-commit-m
A CLI tool that automatically generates commit messages using AI and commits changes.
Installation
npm install -g @missb/git-commit-m
Or install with pnpm:
pnpm install -g @missb/git-commit-m
Or install with yarn:
yarn global add @missb/git-commit-m
Or use directly with npx:
npx @missb/git-commit-m
Usage
git-commit-m
Automatically generates commit messages using AI and commits changes:
git-commit-m
This 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 command
Examples
# 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-signature
Supported providers:
gemini
(default)qwen
claude
codex
cn (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-dot
is 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-signature
is specified) - Commits the changes with the generated message (unless
--diff
or--no-commit
is 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 build
License
MIT