aicommits  by Nutlope

CLI tool for generating git commit messages using AI

created 2 years ago
8,574 stars

Top 6.1% on sourcepulse

GitHubView on GitHub
Project Summary

AI Commits is a command-line interface (CLI) tool designed to automate the creation of Git commit messages using AI. It targets developers who want to streamline their workflow by generating descriptive commit messages based on code changes, saving time and ensuring consistency.

How It Works

The tool leverages git diff to capture staged code modifications. This diff output is then sent to OpenAI's GPT models (defaulting to gpt-3.5-turbo) for processing. The AI generates commit messages based on the provided code context, which are then returned to the user for review and use in their Git commits.

Quick Start & Requirements

  • Install via npm: npm install -g aicommits
  • Requires Node.js v14 or later.
  • Requires an OpenAI API key.
  • Configuration: aicommits config set OPENAI_KEY=<your token>
  • Official documentation: https://github.com/Nutlope/aicommits

Highlighted Details

  • Supports generating multiple commit message recommendations (--generate <i>).
  • Can format messages according to the Conventional Commits specification (--type conventional).
  • Integrates with Git via a prepare-commit-msg hook for seamless usage.
  • Allows passing custom Git commit flags directly (e.g., aicommits --all).

Maintenance & Community

  • Maintained by Hassan El Mghari (@Nutlope) and Hiroki Osame (@privatenumber).
  • Contribution guide available for bug fixes and feature implementation.

Licensing & Compatibility

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

Limitations & Caveats

The tool relies on OpenAI's API, incurring costs based on token usage. Using more advanced models like GPT-4 may improve quality but increases expenses. The max-length default is 50 characters, which might be restrictive for complex changes.

Health Check
Last commit

11 months ago

Responsiveness

Inactive

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

Explore Similar Projects

Feedback? Help us improve.