komt
v0.1.0
Published
AI-powered git commit message generator
Maintainers
Readme
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
# Using bun
bun install -g komt
# Using npm
npm install -g komtQuick Start
- Initial Setup
komt configFollow the prompts to configure your AI provider and API key.
- Generate a Commit
# Stage your changes
git add .
# Generate and create commit
komt commitUsage
Simple Mode (Default)
Generates a single commit message for all staged changes:
komt commitOptions:
-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 --composeKomt will analyze your changes and propose multiple commits, grouping related changes together.
Stashing Behavior:
- With
-aflag: All files are committed, no stashing occurs - Without
-aflag: Unstaged files are safely stashed before creating commits, then automatically restored afterward. This preserves your work-in-progress while committing only staged changes.
Configuration
# Interactive configuration
komt config
# Show current configuration
komt config --show
# Change provider
komt config --set provider=claude
# Test API connection
komt config --testConfiguration 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 keyKOMT_CLAUDE_API_KEY- Claude-specific keyKOMT_OPENAI_API_KEY- OpenAI-specific keyKOMT_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 middlewareMultiple commits (compose mode):
[1/3] feat(auth): implement JWT authentication
[2/3] test(auth): add authentication tests
[3/3] docs: update API documentationDevelopment
# Install dependencies
bun install
# Run tests
bun test
# Run CLI locally
bun run src/index.ts
# Type check
bunx tsc --noEmitLicense
MIT
Credits
Built with Bun and powered by AI.
