Gai is an AI-Powered Automation Tool for Git 🚀
command-line application that automates git commit messages and merge requests using AI.
✨ Features
- Generate commit messages based on code diffs.
- Create merge requests with AI-generated titles and descriptions.
- Works with both GitHub and GitLab.
- Supports Groq and Hugging Face AI interfaces.
📦 Installation
Install gai-tool via pip:
pip install gai-tool
🚀 Getting Started
-
Navigate to your git repository:
cd /path/to/your/git/repo
-
Set API Tokens as Environment Variables:
# Ensure you have your AI interface and GitHub/GitLab API tokens set: export GROQ_API_KEY='your_groq_api_key' # If you want to use Groq's API export HUGGINGFACE_API_TOKEN='your_hf_api_token' # If you want to use Hugging Face's API export GITHUB_TOKEN='your_github_token' # If using GitHub export GITLAB_TOKEN='your_gitlab_token' # If using GitLab
-
Start Using gai-tool:
# Generate an AI-powered commit message: gai commit -a
⚙️ Configuration
Configuration file is located at ~/.config/gai/config.yaml. Customize settings like the AI interface, temperature, and target branch.
Example configuration:
interface: huggingface
temperature: 0.7
target_branch: master
📖 Usage
gai-tool provides two main commands: commit and merge.
📝 Commit Messages
Generate an commit message:
gai commit
Options:
-a,--all: Stage all changes before committing.-t,--temperature: Override the temperature specified in the config.-i,--interface: Specify and override the AI client API to use (groqorhuggingface).
Example:
# Simply
gai commit -a
# Or
gai commit -a -t 0.5 -i huggingface
🔀 Merge Requests
Create a merge request:
gai merge
Options:
[remote]: Specify the remote git repository (default isorigin).--push,-p: Push changes to remote before creating a merge request.--target-branch,-tb: Specify the target branch for the merge request (default ismaster).-t,--temperature: Override the temperature specified in the config.-i,--interface: Specify and override the AI client API to use (groqorhuggingface).
Example:
# Simply
gai merge -p
# Or
gai merge origin -p -tb develop -t 0.8 -i groq
🛠 Build Instructions
Build gai-tool from source:
-
Clone the Repository:
git clone https://github.com/Danielratmiroff/gai.git
-
Navigate to the Project Directory:
cd gai
-
Create a Virtual Environment (Optional but Recommended):
python -m venv venv source venv/bin/activate # On Windows use venv\Scripts\activate
-
Install Build Tools and Dependencies:
pip install build pip install -r requirements.txt
-
Build the Package:
python -m build
This will generate distribution files in the
dist/directory. -
Install the Built Package:
pip install dist/gai_tool-0.1.0-py3-none-any.whl
🤝 Contributing
Contributions are welcome!
📄 License
MIT License - LICENSE.
Metadata
Release files for gai-tool 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| gai_tool-0.2.1.tar.gz | 19.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gai_tool-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.1 kB
Release files / gai_tool-0.2.1.tar.gz
| Download URL | gai_tool-0.2.1.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
692241bd9ec77f44c0aeaf5533b43299d6f083dc90cd1635862de2fde8f75237
|
|
BLAKE2b-256 checksum How to use checksums |
2f72fb30356dfbe5a5dce130d13c83f2f66f21c430ed672d56005c621b190cf3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Release files / gai_tool-0.2.1-py3-none-any.whl
| Download URL | gai_tool-0.2.1-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0565c47aa1153e0f303402b7ebfca6c5d5daaa7cd88ecfd5c1d9dfe7bf2af169
|
|
BLAKE2b-256 checksum How to use checksums |
6923752763c1a68b7c4b5f98e8deb65651c3956bc6700115a65542731a975aad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Security for gai-tool 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.