Skip to main content

Generate automatic commit messages using AI

Project description

AutoCommitAI 🤖

Automatic commit message generator using AI. With some extra features.

🚀 Features

  • 🧠 Multiple AI providers: OpenAI, Google Gemini and Azure OpenAI. Other integrations will be added in the future
  • 🌍 Multi-language support: Generate commits in Spanish, English, French, German, etc.
  • 📋 Interactive staging: Select which files to include in the commit
  • 👀 Preview mode: Generate messages without committing. Yes, the "final" message will be different, but you can see an approach
  • 📊 Repository information: Status, history, branches
  • 🔄 Automation: Auto-confirm mode for CI/CD
  • 📱 JSON output: Structured format for tool integration

📦 Installation

You can install AutoCommit AI directly from PyPI using pip:

pip install auto-commit-ai

Alternatively, you can clone the repository and install directly from source:

git clone https://gitlab.com/tmllull/auto-commit-ai.git
cd auto-commit-ai
pip install .

🔧 Configuration

AutoCommit AI loads its configuration from environment variables file. You can set these variables in a .auto_commit_ai.env file located in your current working directory (where your git repository is) or your home directory (~/.auto_commit_ai.env).

NOTE: If you add the file to your working directory, remember to add it to your .gitignore file.

The contents of the .auto_commit_ai.env can be found in the .auto_commit_ai.env.template file.

🎯 Basic Usage

AutoCommit AI is a command-line tool. Navigate to your Git repository and run one of the following commands:

# Default command
auto-commit-ai

or

# Alias for the default command
acai

This is the default command, and it will generate a commit message for your staged changes only.

Both commands, auto-commit-ai and acai, are equivalent and can be used interchangeably.

Basic commands

# Include all changes (staged + unstaged + untracked)
acai --all

# Use specific provider
acai --provider google

# Generate in Spanish
acai --language es

Preview message

# Preview without committing
auto-commit-ai --preview

# Preview including all changes
acai --preview --all

Interactive staging

# Select files for staging
acai --stage

📊 Repository information

# Repository status
acai --status

# Commit history
auto-commit-ai --history

# Branch information
acai --branches

🛠️ Advanced options

Automation

# Automatic mode (no confirmations)
acai --auto-confirm

# JSON output for scripts
auto-commit-ai --output json

# Specific repository
auto-commit-ai --repo /path/to/repo

Output control

# Don't show status before commit
acai --no-status

# Verbose mode for debugging
acai --verbose

🌍 Supported languages

The system supports ISO 639-1 language codes:

  • en - English (default)
  • es - Spanish
  • fr - French
  • de - German
  • it - Italian
  • pt - Portuguese
  • ja - Japanese
  • zh - Chinese
  • ru - Russian
  • And many more... As you use the ISO 639-1 codes, the system will adapt to your needs.

📋 Usage Examples

Typical workflow

# 1. Check repository status
acai --status

# 2. Interactive file staging
acai --stage

# 3. Preview message
acai --preview

# 4. Generate final commit
acai

CI/CD automation

# Automatic commit in pipeline
acai --all --auto-confirm --output json

Working with specific repository

# Work with another repository
acai --repo /path/to/project --status
acai --repo /path/to/project --all

🔄 Workflow

  1. Analysis: Detects repository changes (staged, unstaged, untracked)
  2. Generation: Uses AI to analyze diffs and generate descriptive message
  3. Review: Shows generated message for confirmation
  4. Commit: Creates commit with generated message
  5. Optional push: Offers to push automatically

📝 Message format

Generated messages follow best practices:

  • Title: Concise line describing the main change
  • Description: Additional details when necessary
  • Conventions: Follows standards like Conventional Commits when appropriate

🚨 Error handling

The system gracefully handles:

  • ❌ Non-Git repositories
  • ❌ No changes to commit
  • ❌ AI API errors
  • ❌ Connectivity issues
  • ❌ Incorrect configuration

📄 License

This project is licensed under the GNU General Public License v3.0. See LICENSE file for more details.

🆘 Support

To report bugs or request features, please open an issue on the GitHub repository.


Made with ❤️ for developers who value quality commits

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

auto_commit_ai-0.2.1.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

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

auto_commit_ai-0.2.1-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

Details for the file auto_commit_ai-0.2.1.tar.gz.

File metadata

  • Download URL: auto_commit_ai-0.2.1.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for auto_commit_ai-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5cc3608eff246cdf515c33e8dd0b761e1ca61fd40062f1de726b373ffe3db61d
MD5 47ca7de7ed17ee65275c84d99a7aaef5
BLAKE2b-256 3aff2ce4edb0b8e72569d0093e7d5882fca7548edf56ce0fbdfd84fc9996d8a4

See more details on using hashes here.

File details

Details for the file auto_commit_ai-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: auto_commit_ai-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 31.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for auto_commit_ai-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d6c41d003eabd44a34f3853aa9094611046506e7fe3728246a152ebf443bfda5
MD5 fec0e4bf7996a29272d065dd314b66da
BLAKE2b-256 a187d3bade08c9b2f3c0127a1792ec1d60508f1882c1f25200a55fda882ad02c

See more details on using hashes here.

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