Skip to main content

Generate automatic commit messages using AI

Project description

AutoCommit AI

Generate conventional commit messages with AI, directly from your terminal.

🚀 Features

  • AI-Powered commit messages: Automatically generates commit messages based on your staged or all changes using advanced AI models.
  • Push changes: Automatically pushes your committed changes to the remote repository.
  • Multiple AI provider support: Seamlessly switch between OpenAI, Google Gemini, and Azure OpenAI.
  • Configurable: Easily configure your AI provider, model, and other settings via environment variables.
  • Language support: Generate commit messages in various languages (defaulting to English).
  • User confirmation: Always prompts for user confirmation before committing or pushing changes.

📦 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. 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.

🚀 Usage

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

auto-commit-ai

or

acai

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

Command Line Arguments

You can customize the behavior using the following arguments:

  • -h or --help: Displays the help message.
  • --provider or -p: Specifies the AI provider to use for generating commit messages. Overrides the DEFAULT_AI_PROVIDER environment variable.
    • Choices: openai, google, azure
    • Example: auto-commit-ai --provider google
  • --all or -a: Adds all files (staged and unstaged) to the commit. By default, only staged changes are included.
    • Example: acai --all
  • --language or -l: Sets the language for the generated commit message (e.g., 'en' for English, 'es' for Spanish) in ISO 639-1 format. Defaults to 'en'.
    • Example: acai --language es

Usage Examples:

In the following examples, both auto-commit-ai and acai are valid commands.

# Generate a commit message for staged changes (default)
auto-commit-ai

# Include all files (staged and unstaged) in the commit
acai --all

# Use Google Gemini as the AI provider
auto-commit-ai --provider google

# Generate commit message in Spanish
auto-commit-ai --language es

🤝 Contributing

Contributions are welcome! Please feel free to open issues or any feature requests.

📄 License

This project is licensed under the GNU Affero General Public License v3.

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.0.0.tar.gz (25.3 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.0.0-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: auto_commit_ai-0.0.0.tar.gz
  • Upload date:
  • Size: 25.3 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.0.0.tar.gz
Algorithm Hash digest
SHA256 f75673e7bd03933bfe8b4e05844c52ead888f74941c2ef12c59b7b60900e50c0
MD5 82f56a7fead96bd2500b51853603411c
BLAKE2b-256 67f73dc284879f023852fc8ff875d9a209b0f0b0e4f91cb2246e9ed376c914bc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: auto_commit_ai-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 25.1 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ae0157cd0fe83108929339b5384c06977db1ddff9dae2cbf60ea6e1701410eb
MD5 10e55bbc6908bff782736eedcde23ebc
BLAKE2b-256 c7e78600a99595d0715d08f19f68b8c82af13f984f828e06f6716330b80bbc32

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