AI Commit is a powerful tool that generates Git commit messages using AI, supporting various models and providers. Integrate with LazyGit and VS Code, making it easy to incorporate AI-generated commit messages into your workflow.
Features
- π€ Generate commit messages using AI
- π Support for multiple AI providers (OpenAI, Anthropic, OpenRouter, Groq, and OpenAI-compatible)
- π₯οΈ CLI tool for easy integration into your workflow
- π VS Code extension for seamless integration within the editor
- π LazyGit integration for streamlined Git operations
Requirements
Installation
CLI Tool
bun add -g @kkidd/aicommit
VS Code Extension
The VS Code extension is available in the marketplace: AI Commit - Generate Commit Messages
Usage
CLI Commands
# Generate commit messages
aic generate [--amount <number>]
# Configure AI provider and model
aic config [options]
# View current configuration
aic view-config
# Set up integrations
aic integrate
Configuration Options
- For initial setup or to update all settings, run
aic config
without options --provider
: AI provider (openai, openai-compatible, anthropic, openrouter, groq)--model
: AI model to use--api-key
: API key for the selected provider--endpoint
: Endpoint for OpenAI compatible providers--tokens
: Maximum number of tokens to generate--integration
: Integration to use (lazygit / vscode / none)
Integrations
LazyGit
To set up the LazyGit integration:
- Run
aic integrate
- Choose "LazyGit" from the options
- Follow the prompts to configure your LazyGit config file
VS Code
To set up the VS Code integration:
- Install the AI Commit extension from the VS Code marketplace
- Configure the extension settings in VS Code:
- AI provider
- API key
- Model
- Max tokens
- Number of commit messages to generate
- Endpoint (for other OpenAI compatible provider)
Configuration
AI Commit uses a configuration file to store your preferences. You can edit this file directly or use the aic config
command to update your settings.
Example configuration:
{
"provider": "openai",
"model": "gpt-4",
"apiKey": "your-api-key-here",
"maxTokens": 256,
"integration": "lazygit",
"endpoint": "https://example.com/v1/"
}
TODO
- CLI tool for generating commit messages
- Support for multiple AI providers
- LazyGit integration
- VS Code Extension
- Custom prompt template
- Support for custom non-OpenAI compatible providers
- Localization support for multiple languages
- Integration with other Git GUI clients
Development
To set up the development environment:
- Clone the repository
- Install dependencies:
bun install
- Build the project:
bun run build
- Run tests:
bun test