Skip to content

AI Commit generates Git commit messages using AI, supporting various models and providers. Integrate with LazyGit and VS Code, making it easy to incorporate AI Commit into your workflow.

License

Notifications You must be signed in to change notification settings

kevin-kidd/aicommit

Repository files navigation

AI Commit

Bun TypeScript License: MIT PRs Welcome

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:

  1. Run aic integrate
  2. Choose "LazyGit" from the options
  3. Follow the prompts to configure your LazyGit config file

VS Code

To set up the VS Code integration:

  1. Install the AI Commit extension from the VS Code marketplace
  2. 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:

  1. Clone the repository
  2. Install dependencies: bun install
  3. Build the project: bun run build
  4. Run tests: bun test

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/CoolFeature)
  3. Commit your changes (git commit -m 'Add some CoolFeature')
  4. Push to the branch (git push origin feature/CoolFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any problems or have any questions, please open an issue on the GitHub repository.

Acknowledgements

About

AI Commit generates Git commit messages using AI, supporting various models and providers. Integrate with LazyGit and VS Code, making it easy to incorporate AI Commit into your workflow.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published