A command-line tool that intelligently generates commit messages based on staged file changes in Git using OpenAI's GPT.
Project description
gpt-commit 🚀
gpt-commit
is a command-line tool that intelligently generates commit messages based on staged file changes in Git. It utilizes OpenAI's GPT model to craft concise and descriptive commit messages.
Acknowledgements 🙌
This project was inspired by and owes gratitude to the original work found at markuswt/gpt-commit. Thank you for laying the foundation!
Prerequisites 📋
- Python
- A valid OpenAI API key
Installation 🛠️
-
Clone the repository:
git clone https://github.com/josenerydev/gpt-commit.git
-
Navigate to the project directory:
cd gpt-commit/
-
Install the package:
pip install .
For developers: If you're making changes and want to reflect them immediately, install in editable mode:
pip install -e .
Update ⬆️
To upgrade the tool to the latest version:
pip install --upgrade .
Uninstallation ❌
To uninstall the tool:
pip uninstall gpt-commit
Configuration ⚙️
Before using the tool, you need to set up your OpenAI API key.
On Windows (PowerShell):
Before running any PowerShell script, you may need to modify the execution policy. To do this, open PowerShell as an administrator and run:
Set-ExecutionPolicy RemoteSigned
Then, run the setupEnvironmentVariables.ps1
script:
.\setupEnvironmentVariables.ps1 -openaiKey YOUR_OPENAI_API_KEY
On Linux/Mac:
Run the setupEnvironmentVariables.sh
script:
./setupEnvironmentVariables.sh YOUR_OPENAI_API_KEY
Remember to replace YOUR_OPENAI_API_KEY
with your actual API key.
Usage 🚀
After installation, you can use the gpt-commit
tool anywhere in your system:
gpt-commit
Running the above command will analyze changes in staged files in Git and generate a commit message. This message will then be opened in Git's default editor for review or editing. After reviewing the message, save and close the editor to finalize the commit.
For help on available options:
gpt-commit --help
License
This project is licensed under the MIT License - see the LICENSE file for 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
File details
Details for the file gpt-commit-0.1.2.tar.gz
.
File metadata
- Download URL: gpt-commit-0.1.2.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5cd24018d8bf595a8944b40cd14cb2064b2ac65753568aa4cdf76807735a4a0 |
|
MD5 | e17ba407b6e386f1b24d020345dc3a62 |
|
BLAKE2b-256 | 855035ad924cdce396805a3cab893e5d03c35d1e01accb1d0a57eedc8049b8a9 |
File details
Details for the file gpt_commit-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: gpt_commit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d636271e34af695eceef4e12218facf4d3a075acf53205e57bbf040c9d7aea02 |
|
MD5 | fea7329330b94271730df71134294321 |
|
BLAKE2b-256 | 935b428df3195262c5c6f2c81b6fd2f913135f356750752bb300f1a56498a256 |