ai-commit  by guanguans

CLI tool for AI-powered conventional Git commit message generation

created 2 years ago
385 stars

Top 75.5% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides an AI-powered tool to automatically generate conventional Git commit messages, streamlining the development workflow for individual developers and teams. It supports multiple AI backends, including OpenAI, GitHub Copilot CLI, and Bito CLI, offering flexibility in choosing the underlying AI model.

How It Works

The tool leverages various AI models via their respective CLIs or APIs to analyze code changes and generate descriptive commit messages. Users can configure their preferred AI generator and API keys. The core functionality involves running ai-commit commit, which then prompts the user to select a commit type (or uses an auto-generated one) before sending the diff to the chosen AI for message generation. The generated message is then presented for confirmation before committing.

Quick Start & Requirements

  • Installation: Download the ai-commit binary from GitHub releases or install via Composer (composer global require guanguans/ai-commit --dev).
  • Prerequisites: PHP >= 7.3. API keys for chosen AI services (OpenAI, ERNIE-Bot, Moonshot, etc.) are required for those generators. Some generators may require their specific CLI binaries to be installed.
  • Configuration: API keys and binary paths are set using ./ai-commit config set <generator>.<key> <value> --global.
  • Usage: ./ai-commit commit to generate and commit using the default generator, or ./ai-commit commit --generator=<generator_name> to specify.
  • Documentation: README

Highlighted Details

  • Supports a wide range of AI generators including OpenAI, GitHub Copilot CLI, Bito CLI, ERNIE-Bot, and Moonshot.
  • Allows configuration of default generators, API keys, and CLI binary paths.
  • Provides options to control Git commit behavior like --no-edit and --no-verify.
  • Includes a self-update mechanism for the tool.

Maintenance & Community

The project is maintained by guanguans. Contributions are welcome, with details provided in CONTRIBUTING.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: Permissive MIT license allows for commercial use and integration with closed-source projects.

Limitations & Caveats

The effectiveness of generated commit messages is dependent on the quality of the underlying AI model and the clarity of the code changes. Some AI generators may require specific CLI tools to be installed and configured separately.

Health Check
Last commit

3 days ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
2 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.