Komt - AI-Powered Git Commit Tool
Generate conventional commit messages using AI
Komt analyzes your git changes and automatically creates well-formatted conventional commit messages using AI (Claude, OpenAI, or Gemini).
Features
- AI-powered semantic analysis of code changes
- Conventional Commits format (type, scope, description)
- Two modes: simple (single commit) and compose (multi-commit grouping)
- Multi-provider support: Claude, OpenAI, and Gemini
- Automatic chunking for large changesets
- Interactive preview with editor integration
- Built with TypeScript + Bun
Installation
bun install -g komt
npm install -g komt
Quick Start
komt config
Follow the prompts to configure your AI provider and API key.
git add .
komt commit
Usage
Simple Mode (Default)
Generates a single commit message for all staged changes:
komt commit
Options:
-a, --all - Stage all changes before committing
-e, --edit - Open editor to modify commit message
-y, --yes - Skip confirmation prompt
Compose Mode
Intelligently groups changes into multiple logical commits:
komt commit --compose
Komt will analyze your changes and propose multiple commits, grouping related changes together.
Stashing Behavior:
- With
-a flag: All files are committed, no stashing occurs
- Without
-a flag: Unstaged files are safely stashed before creating commits, then automatically restored afterward. This preserves your work-in-progress while committing only staged changes.
Configuration
komt config
komt config --show
komt config --set provider=claude
komt config --test
Configuration File
Configuration is stored at ~/.komt/config.json:
{
"provider": "claude",
"providers": {
"claude": {
"apiKey": "sk-ant-...",
"model": "claude-3-7-sonnet-20250219"
},
"openai": {
"apiKey": "sk-...",
"model": "gpt-4o"
},
"gemini": {
"apiKey": "...",
"model": "gemini-2.0-flash-exp"
}
}
}
Environment Variables
Override configuration with environment variables:
KOMT_PROVIDER - Provider name (claude/openai/gemini)
KOMT_API_KEY - Generic API key
KOMT_CLAUDE_API_KEY - Claude-specific key
KOMT_OPENAI_API_KEY - OpenAI-specific key
KOMT_GEMINI_API_KEY - Gemini-specific key
Conventional Commits
Komt generates commits following the Conventional Commits specification:
<type>(<scope>): <description>
[optional body]
Types:
- feat: New feature or functionality
- fix: Bug fix
- docs: Documentation changes
- style: Code formatting only (whitespace, semicolons, indentation) - NOT UI/CSS styling
- refactor: Code restructuring without changing behavior
- test: Adding or updating tests
- chore: Build process, dependencies, tooling
Note: UI/CSS styling improvements should use feat or fix, not style.
Examples
Simple commit:
feat(auth): implement JWT authentication
- Add JWT token generation and validation
- Implement password hashing with bcrypt
- Add authentication middleware
Multiple commits (compose mode):
[1/3] feat(auth): implement JWT authentication
[2/3] test(auth): add authentication tests
[3/3] docs: update API documentation
Development
bun install
bun test
bun run src/index.ts
bunx tsc --noEmit
License
MIT
Credits
Built with Bun and powered by AI.