ai-commit  by insulineru

CLI tool for generating commit messages using AI

created 2 years ago
440 stars

Top 69.0% on sourcepulse

GitHubView on GitHub
Project Summary

AI-Commit is a command-line tool that leverages AI to generate commit messages for Git repositories, targeting developers seeking to streamline their commit workflow. It integrates with OpenAI's GPT models and optionally Ollama for local inference, aiming to produce informative and conventional commit messages, potentially enhanced with Gitmojis.

How It Works

AI-Commit analyzes staged code changes using Git diffs. It then sends this diff information to a specified AI model (OpenAI's GPT-4o-mini by default, or a local Ollama model) to generate a commit message. The user can then approve the generated message or select from multiple suggestions before the commit is finalized. This approach automates the often tedious task of writing descriptive commit messages, promoting consistency and clarity in project history.

Quick Start & Requirements

  • Install via npm: npm install -g ai-commit
  • Requires Node.js and npm.
  • OpenAI API key required for cloud-based generation; set as OPENAI_API_KEY environment variable.
  • Ollama installation and a model (e.g., ollama run mistral) required for local inference; set PROVIDER=ollama environment variable.
  • Official Docs: https://github.com/insulineru/ai-commit

Highlighted Details

  • Supports OpenAI GPT-4o-mini and local Ollama models for flexibility and cost control.
  • Integrates Gitmoji for visually enhanced commit messages.
  • Offers options for multiple suggestions (--list), automatic commits (--force), fee display (--filter-fee), custom templates, and language selection.
  • Follows Conventional Commits structure.

Maintenance & Community

The project is maintained by insulineru. Community contributions are welcomed via pull requests.

Licensing & Compatibility

  • Licensed under the MIT License.
  • Permissive license suitable for commercial use and integration with closed-source projects.

Limitations & Caveats

The roadmap indicates features like automated scope detection, improved emoji suggestions, and Git hook integration are still under development. Advanced diff analysis and reverse commit message generation are also planned future enhancements.

Health Check
Last commit

6 months ago

Responsiveness

1 week

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

Explore Similar Projects

Feedback? Help us improve.