Skip to main content

An intelligent Git commit assistant that not only generates commit messages, but also automatically analyzes and splits your code changes into multiple well-organized commits following best practices.

Project description

English | 中文

AI Commit (aicmt)

An AI-powered Git commit assistant that not only generates commit messages, but also automatically analyzes and splits your code changes into multiple well-organized commits following best practices.

aicmt

Features

  • Intelligent Change Splitting: Unlike traditional commit message generators, aicmt analyzes your code changes and automatically splits them into logical, focused commits following Git best practices
  • Flexible Control: You can let AI decide the optimal number of commits, or specify exactly how many commits you want
  • Focus on Coding: Make all your changes freely, and let AI handle the commit organization - no need to worry about making perfect atomic commits while coding

Installation

Requires Python 3.10 or higher.

pip install aicmt

Quick Start (Command Line Arguments Mode)

In your git repository directory, run:

aicmt --api-key <API_KEY> --model <MODEL> --base-url <OPENAI_BASE_URL>

To specify the number of commits to generate(default: AI decides):

aicmt --api-key <API_KEY> --model <MODEL> -n 3  # Split changes into 3 commits

Help

$ aicmt -h
usage: aicmt [-h] [-v] [--api-key KEY] [--base-url URL] [--model MODEL] [-n N]

<<< AICMT (AI Commit) - AI-powered Git commit assistant >>>

options:
  -h, --help           show this help message and exit
  -v, --version        show program's version number and exit
  --api-key KEY        OpenAI API key for authentication
  --base-url URL       Custom API base URL (default: https://api.openai.com/v1)
  --model MODEL        AI model to use (default: gpt-4o-mini)
  -n, --num-commits N  Number of commits to generate (default: AI decides)

Configuration File Mode

  1. Create configuration file .aicmtrc

Reference the template file .aicmtrc.templateand create.aicmtrc` in your home directory.

cp .aicmtrc.template ~/.aicmtrc

You can also create .aicmtrc in the current directory, which will override the global configuration file (~/.aicmtrc)

cd /path/to/git/repo
touch .aicmtrc
  1. Add OpenAI API and other information in the configuration file.

  2. Enter your git repository directory and run the aicmt command to automatically analyze changes and generate commit messages.

Development

  1. Clone the repository:
git clone https://github.com/versun/aicmt.git
  1. Install dependencies:
cd aicmt
pip install ".[dev]"

Having Issues?

All code in this project is AI-generated, so if you encounter any problems, please first try asking AI for solutions (preferably using the claude-3.5-sonnet model). If the issue persists, please submit an issue, and I will consult AI to resolve it.

Contributing

Pull requests are welcome!

A Big Thank You to My Sponsors

I am deeply grateful to my amazing supporters and sponsors who have made my open source journey possible.

Become a Sponser on Github / 爱发电 / 微信

Star History

Star History Chart

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aicmt-0.0.1.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aicmt-0.0.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file aicmt-0.0.1.tar.gz.

File metadata

  • Download URL: aicmt-0.0.1.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for aicmt-0.0.1.tar.gz
Algorithm Hash digest
SHA256 11a804bb77fbd4f9e4c20b252643267c54bfc920da12d150a4fc48f1c0883f65
MD5 2e5674f3818381f680db5a4b9325a605
BLAKE2b-256 381914442fe65377967e0d6be4c6e57e892a2ed1dd0296313a64b22618e07ca0

See more details on using hashes here.

Provenance

The following attestation bundles were made for aicmt-0.0.1.tar.gz:

Publisher: publish.yml on versun/aicmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aicmt-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: aicmt-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for aicmt-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a377695e4eb59ae03e61f8eb580d71bb0f5ec3c8b954bb876fdf2fdd53f12ec5
MD5 afeb151b369aed9be7310ea65f3b53a4
BLAKE2b-256 728426430ae5973d41741d516395d30f37faea713ede25dd8ed81610f820e268

See more details on using hashes here.

Provenance

The following attestation bundles were made for aicmt-0.0.1-py3-none-any.whl:

Publisher: publish.yml on versun/aicmt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page