aicommit2  by tak-bro

CLI tool for AI-powered git commit message generation

created 1 year ago
323 stars

Top 85.3% on sourcepulse

GitHubView on GitHub
Project Summary

This CLI tool automates the generation of Git commit messages using a variety of AI models, including OpenAI, Gemini, Claude, and Ollama. It's designed for developers who want to streamline their commit workflow by leveraging AI to create descriptive and consistent commit messages, supporting both cloud-based and local AI services.

How It Works

The tool analyzes staged code changes using git diff and sends this information to configured AI providers. It supports simultaneous requests to multiple AI services, allowing users to select the best generated message. The architecture is inspired by AICommits, offering flexibility in AI model selection and configuration.

Quick Start & Requirements

  • Install globally: npm install -g aicommit2
  • Requires Node.js v18 or higher.
  • Configure at least one AI provider's API key (e.g., aicommit2 config set OPENAI.key=).
  • Usage: git add . then aicommit2
  • Official Docs: https://github.com/tak-bro/aicommit2

Highlighted Details

  • Supports 10+ AI providers including OpenAI, Gemini, Claude, Mistral, Cohere, Groq, Perplexity, DeepSeek, and Ollama.
  • Offers OpenAI API compatibility for any service adhering to the specification.
  • Integrates seamlessly as a prepare-commit-msg Git hook.
  • Allows custom system prompts and Git commit message formats (conventional, gitmoji).

Maintenance & Community

  • Maintained by @tak-bro.
  • Contributors listed include @eltociear, @ubranch, @bhodrolok, and others.
  • Open for contributions.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial use and closed-source projects.

Limitations & Caveats

The codeReview and watch-commit features are experimental and may significantly increase token consumption and processing time. If git diff output is too large, AI generation may fail, requiring users to reduce the "commit unit."

Health Check
Last commit

2 days ago

Responsiveness

1 day

Pull Requests (30d)
8
Issues (30d)
4
Star History
53 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.