Skip to main content

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.

License: MIT

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 🛠️

  1. Clone the repository:

    git clone https://github.com/josenerydev/gpt-commit.git
    
  2. Navigate to the project directory:

    cd gpt-commit/
    
  3. 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.

Release files for gpt-commit 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpt-commit 0.1.2
File Size Uploaded
gpt-commit-0.1.2.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gpt-commit 0.1.2
File Interpreter ABI Platform
gpt_commit-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / gpt-commit-0.1.2.tar.gz

Download URL gpt-commit-0.1.2.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f5cd24018d8bf595a8944b40cd14cb2064b2ac65753568aa4cdf76807735a4a0
BLAKE2b-256 checksum
How to use checksums
855035ad924cdce396805a3cab893e5d03c35d1e01accb1d0a57eedc8049b8a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / gpt_commit-0.1.2-py3-none-any.whl

Download URL gpt_commit-0.1.2-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d636271e34af695eceef4e12218facf4d3a075acf53205e57bbf040c9d7aea02
BLAKE2b-256 checksum
How to use checksums
935b428df3195262c5c6f2c81b6fd2f913135f356750752bb300f1a56498a256
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page