A toolkit for using OpenAI's GPT-4o-mini model to assist with Git workflows.
Project description
🧰 Git AI Toolkit
👋 Description
This tool can generate commit messages for your Git repository by summarizing the changes using the OpenAI API. It identifies the Git repository, checks for changes using git diff, and uses OpenAI to provide a one-sentence summary of the changes. If you approve, the changes can be committed and optionally pushed to the remote repository.
🚀 Installation
Install the package via pip:
pip install git_ai_toolkit
⚙️ Configuration
-
Add Your OpenAI API Key
Add your OpenAI API key to your environment variables by updating your shell's configuration file.
For
zsh(Zsh users):echo '\nexport OPENAI_API_KEY="your_openai_api_key_here"' >> ~/.zshrc source ~/.zshrc
For
bash(Bash users):echo '\nexport OPENAI_API_KEY="your_openai_api_key_here"' >> ~/.bashrc source ~/.bashrc
Replace
your_openai_api_key_herewith your actual OpenAI API key.
💻 Usage
-
Navigate to Your Git Project Directory
Ensure you are in the root directory of your Git repository:
cd path/to/your/git/repository
-
Run the Command
Execute the script using the command:
ai-commit
-
Follow the Prompts
- The script will check for a Git repository and detect changes.
- It will then generate a suggested commit message using the OpenAI API.
- You will have the option to commit the changes with the suggested message.
- Finally, you will be prompted to push the changes to the remote repository.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
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 git_ai_toolkit-0.1.5.tar.gz.
File metadata
- Download URL: git_ai_toolkit-0.1.5.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12810667fd48fbfe33602c8984f1de2cb2b61a100b8b4350da4d6fb41413d9d7
|
|
| MD5 |
88483921b943d641b6bc44035322b599
|
|
| BLAKE2b-256 |
726178f7f8ca56d73f7d7d9f1b6dc82207a1029828a42023caa63e96c62336ac
|
File details
Details for the file git_ai_toolkit-0.1.5-py3-none-any.whl.
File metadata
- Download URL: git_ai_toolkit-0.1.5-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
477bddbc66c654f57e8d7ce1d19d31927403c222e41c9b8e314422dc9b627639
|
|
| MD5 |
6e92cf23ebe5c714271e433cc0b8c9aa
|
|
| BLAKE2b-256 |
29a557b310482064c44328f3efc7e1b6477b816c38e5e6137a627cd859b0619d
|