ai-komitto
v0.1.9
Published
Generate short git commit messages from staged diffs using OpenAI, Claude, Gemini or DeepSeek.
Maintainers
Readme
About AI Komitto
Generate short Git commit messages from your staged diff using OpenAI, Claude, Gemini or DeepSeek.
AI Komitto is a small global CLI for developers who want fast commit messages without manually writing summaries. It stages your repository changes, sends the staged diff to your selected AI provider, prints the generated message, and commits with that message.
The command is intentionally short:
komittoFeatures
- Supports Google Gemini, OpenAI, Anthropic Claude, and DeepSeek
- Global npm CLI installation
- Default lightweight model support
- Provider and model overrides
- Language option, defaulting to English
- Print-only mode for editor aliases and IDE tasks
- Optional --lowercase flag to transform commit message to lowercase
- Optional
--no-addmode when you only want to summarize already staged files - Configurable min word count for commit messages
- Multiple commit formats: plain, conventional, gitmoji, full (title + body)
- Custom context instructions to guide the commit message tone and content
Why
Writing commit messages for small everyday changes is repetitive. This package turns this:
git add .
git commit -m "fix booking status translation"into this:
komittoExample output:
fix: update booking status translationsInstallation
Install globally:
npm install -g ai-komittoOr install from a local folder while developing:
git clone <your-repo-url>
cd ai-komitto
npm install -g .After installation, the package exposes this command:
komittoRequirements
- Node.js 18 or higher
- Git
- An API key for at least one supported provider
Node 18 is required because the package uses the built-in fetch API.
Provider setup
Gemini
export KOMITTO_PROVIDER="gemini"
export GEMINI_API_KEY="your_gemini_api_key"
export GEMINI_MODEL="gemini-flash-lite-latest"OpenAI
export KOMITTO_PROVIDER="openai"
export OPENAI_API_KEY="your_openai_api_key"
export OPENAI_MODEL="gpt-5.4-nano"Claude
export KOMITTO_PROVIDER="claude"
export ANTHROPIC_API_KEY="your_anthropic_api_key"
export CLAUDE_MODEL="claude-haiku-4-5"DeepSeek
export KOMITTO_PROVIDER="deepseek"
export DEEPSEEK_API_KEY="your_deepseek_api_key"
export DEEPSEEK_MODEL="deepseek-v4-flash"DeepSeek is the default provider if KOMITTO_PROVIDER is not set.
Language
The default commit message language is English.
komittoGenerate a Malay commit message:
komitto --language malayGenerate a Japanese commit message:
komitto --language japaneseSet a default language permanently:
export KOMITTO_LANGUAGE="english"You can use any language name supported by your selected model, for example:
komitto --language english
komitto --language malay
komitto --language indonesian
komitto --language japanese
komitto --language chinesePermanent shell setup
For macOS or zsh:
nano ~/.zshrcAdd your preferred provider config:
export KOMITTO_PROVIDER="gemini"
export GEMINI_API_KEY="your_gemini_api_key"
export GEMINI_MODEL="gemini-flash-lite-latest"
export KOMITTO_LANGUAGE="english"
export KOMITTO_FORMAT="conventional"
export KOMITTO_CONTEXT="reference exact function names modified"Reload your shell:
source ~/.zshrcFor bash:
nano ~/.bashrc
source ~/.bashrcUsage
Commit using your default provider:
komittoUse a specific provider for one commit:
komitto --provider openaiUse a specific model for one commit:
komitto --provider gemini --model gemini-flash-lite-latestUse a specific language for one commit:
komitto --language malayPrint the generated message without committing:
komitto --printDo not run git add automatically:
komitto --no-addLimit the diff size sent to the provider:
komitto --max-chars 12000Set minimum word count for commit message:
komitto --min-words 8Use a specific commit format:
komitto --format plain
komitto --format conventional
komitto --format gitmoji
komitto --format fullPossible gitmoji output:
✨ add user avatar upload endpointPossible full output:
feat: add user avatar upload endpoint
- add POST /api/avatar route with multer middleware
- validate file size and type before saving
- update user model with avatarUrl fieldAdd custom context to guide the commit message:
komitto --context "prioritize the performance effects of the updates"
komitto --context "reference the exact function names and file paths modified"
komitto --context "use gen alpha vibes terminology"Show help:
komitto --helpEditor aliases
You can create aliases in your terminal, editor, or IDE task runner.
Replace your current commit shortcut
alias commit="komitto"Then use:
commitPrint-only alias
Useful when your editor only needs the generated message:
alias commitmsg="komitto --print"Then:
commitmsgProvider-specific aliases
alias commitg="komitto --provider gemini"
alias commito="komitto --provider openai"
alias commitc="komitto --provider claude"
alias commitd="komitto --provider deepseek"Language-specific aliases
alias commitmy="komitto --language malay"
alias commitjp="komitto --language japanese"Configuration
Environment variables:
| Variable | Description | Default |
| --- | --- | --- |
| KOMITTO_PROVIDER | Default provider: gemini, openai, claude, or deepseek | deepseek |
| KOMITTO_LANGUAGE | Default commit message language | english |
| GEMINI_API_KEY | Gemini API key | none |
| OPENAI_API_KEY | OpenAI API key | none |
| ANTHROPIC_API_KEY | Anthropic API key | none |
| DEEPSEEK_API_KEY | DeepSeek API key | none |
| GEMINI_MODEL | Gemini model | gemini-flash-lite-latest |
| OPENAI_MODEL | OpenAI model | gpt-5.4-nano |
| CLAUDE_MODEL | Claude model | claude-haiku-4-5 |
| DEEPSEEK_MODEL | DeepSeek model | deepseek-v4-flash |
| KOMITTO_MAX_CHARS | Maximum diff characters sent to the provider | 18000 |
| KOMITTO_MIN_WORDS | Minimum words in the commit message | 12 |
| KOMITTO_FORMAT | Commit format: plain, conventional, gitmoji, full | conventional |
| KOMITTO_CONTEXT | Extra instructions for commit message generation | none |
CLI options override environment variables.
CLI options
komitto [options]| Option | Description |
| --- | --- |
| -p, --provider <name> | Provider: gemini, openai, claude, or deepseek |
| -m, --model <model> | Override provider model |
| -l, --language <name> | Commit message language, default: english |
| --no-add | Do not run git add before generating the message |
| --print | Print the message only, do not commit |
| --dry-run | Same as --print |
| --max-chars <number> | Maximum diff characters sent to the provider |
| -w, --min-words <n> | Minimum words in the commit message, default: 12 |
| -f, --format <type> | Commit format: plain, conventional, gitmoji, full |
| -c, --context <text> | Extra instructions for the commit message |
| -h, --help | Show help |
Default models
The package uses lightweight defaults intended for low-cost commit message generation:
gemini: gemini-flash-lite-latest
openai: gpt-5.4-nano
claude: claude-haiku-4-5
deepseek: deepseek-v4-flashThe Gemini default intentionally uses the latest alias-style model name:
gemini-flash-lite-latestThis reduces the chance of your CLI breaking when a fixed older Gemini model is deprecated or shut down.
Override the model if your account does not have access to a model or your provider changes the available model IDs:
komitto --provider openai --model gpt-5.4-miniHow it works
By default, komitto runs:
git add <repo-root>
git diff --cached --stat
git diff --cached
git commit -m "<generated-message>"The generated message is normalized before commit:
- first line only
- surrounding quotes removed
- trailing period removed
To force lowercase output, use the --lowercase or -lc flag:
komitto --lowercaseExamples
English:
komitto --language englishPossible output:
fix: update booking status translationsMalay:
komitto --language malayPossible output:
fix: kemas kini terjemahan status tempahanPrint only:
komitto --print --language englishPossible output:
refactor: simplify provider selection logicLicense
MIT
