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

Uploaded Python 3

File details

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

File metadata

  • Download URL: auto_commit_ai-0.1.2.tar.gz
  • Upload date:
  • Size: 25.5 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.1.2.tar.gz
Algorithm Hash digest
SHA256 38fd4a1f2646e02df85757d1a1027db78eedf9d75552b04fc043e1deeebd738f
MD5 ab02f0d2d5d946e028f85846628ba552
BLAKE2b-256 417d9afee2b4853a240d7116066a0c87b6c872ee4a2cd34ed33d6e5994e33280

See more details on using hashes here.

File details

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

File metadata

  • Download URL: auto_commit_ai-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 25.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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ebd13ec4c67dd5dad183b02544500ea2507adc7e5d59f14e845da3a977396549
MD5 f1825a4079a28aec840ef95e89e71d8e
BLAKE2b-256 9b2c9028de3d662f2b4a6ea743dd817ac64c7ba41a466ac7baf1794a4a575500

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