Skip to main content

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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpt-commit-0.1.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

gpt_commit-0.1.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

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

Hashes for gpt-commit-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f5cd24018d8bf595a8944b40cd14cb2064b2ac65753568aa4cdf76807735a4a0
MD5 e17ba407b6e386f1b24d020345dc3a62
BLAKE2b-256 855035ad924cdce396805a3cab893e5d03c35d1e01accb1d0a57eedc8049b8a9

See more details on using hashes here.

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

Hashes for gpt_commit-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d636271e34af695eceef4e12218facf4d3a075acf53205e57bbf040c9d7aea02
MD5 fea7329330b94271730df71134294321
BLAKE2b-256 935b428df3195262c5c6f2c81b6fd2f913135f356750752bb300f1a56498a256

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page