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:
-hor--help: Displays the help message.--provideror-p: Specifies the AI provider to use for generating commit messages. Overrides theDEFAULT_AI_PROVIDERenvironment variable.- Choices:
openai,google,azure - Example:
auto-commit-ai --provider google
- Choices:
--allor-a: Adds all files (staged and unstaged) to the commit. By default, only staged changes are included.- Example:
acai --all
- Example:
--languageor-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
- Example:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file auto_commit_ai-0.2.0.tar.gz.
File metadata
- Download URL: auto_commit_ai-0.2.0.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3b65127be1bbf7ea854674cde82b89f2c82d67e1df774e5ede07d37ddfd60a8
|
|
| MD5 |
7d5d949afaa15d9db11ae327eec088f5
|
|
| BLAKE2b-256 |
bbf3a7b86138a367a4f5153e2464ae4aca3e6038011f49b0bdc88c9b8a5e435b
|
File details
Details for the file auto_commit_ai-0.2.0-py3-none-any.whl.
File metadata
- Download URL: auto_commit_ai-0.2.0-py3-none-any.whl
- Upload date:
- Size: 30.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
264026707e3a2e41ea9df32ea50b33e7367b834cfb043e1a21341502a27f307a
|
|
| MD5 |
508f91d9aef53abf63b14f113aa02b3b
|
|
| BLAKE2b-256 |
1e9b15d09b9edf5518b08e2766dd37ac5fa7a4ce8fe956e4ded48fc5256779c2
|