Skip to main content

GPT-Powered Commit Assistance

Project description

GPiT

Effortless Git Integration with GPT-Powered Commit Assistance

Overview

This tool is designed to automate several common Git operations, enhancing the standard Git workflow with additional features. It helps in managing unpushed commits, checking for local changes, generating commit messages using OpenAI's GPT-4 API, editing commit messages, and handling the push operation to a remote repository.

https://github.com/ofirsteinherz/gpit/assets/29001725/e699afd0-f219-48b5-b1e9-563d5f31845a

Features

  • 🔍 Check for Unpushed Commits: Quickly identify any commits that haven't been pushed to the remote repository.
  • 📝 Detect Local Changes: View a summary of local changes that are not yet committed.
  • 💬 Generate Commit Messages: Utilizes GPT-4 to suggest commit messages based on the detected changes.
  • ✏️ Edit Commit Messages: Offers an interactive editor for customizing commit messages.
  • 🚀 Stage, Commit, and Push: Automates the process of staging changes, committing them with a chosen message, and pushing to the remote repository.

Installation

GPIT can be installed directly from PyPI:

pip install gpit

This tool requires Python 3.x. Make sure you have Python installed on your system.

Setting Up OpenAI API Key

Before using the tool, make sure to set your OpenAI API key as an environment variable:

export OPENAI_API_KEY='your_openai_api_key'

Alternatively, you can set it in a .env file in the same directory as the script. The most recommended way to save the key is through "Shell Profile Files": Open or create the .bashrc file:

nano ~/.bashrc

Add your export statement:

export OPENAI_API_KEY="your_openai_api_key_here"

Save and exit. Apply the changes:

source ~/.bashrc

Verifying the Variable:

echo $OPENAI_API_KEY

Usage

Once installed, you can run GPIT from any Git repository on your system. Simply use the following command:

gpit

Follow the on-screen prompts to manage your Git operations.

Dependencies

  • Git
  • Python 3.x
  • Requests library for Python
  • python-dotenv (for managing environment variables)

Install Python dependencies using:

pip install requests python-dotenv

Contributing

Contributions to this project are welcome! Please fork the repository and submit a pull request with your proposed changes.

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

gpit-0.0.4.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpit-0.0.4-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file gpit-0.0.4.tar.gz.

File metadata

  • Download URL: gpit-0.0.4.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/42.0 requests/2.31.0 requests-toolbelt/0.10.1 urllib3/1.26.16 tqdm/4.65.0 importlib-metadata/6.8.0 keyring/23.8.2 rfc3986/1.5.0 colorama/0.4.5 CPython/3.10.7

File hashes

Hashes for gpit-0.0.4.tar.gz
Algorithm Hash digest
SHA256 652dcb10c3e7ce4ded2ce75f5f297054b5994ab9985b50fee4edbc60448b988d
MD5 eeb72ea66e9a528063f7b413c58e2c31
BLAKE2b-256 0caa69552080bdf69550f6fbefb7764796820fb846d605711b8c9f2326fb90cd

See more details on using hashes here.

File details

Details for the file gpit-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: gpit-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/42.0 requests/2.31.0 requests-toolbelt/0.10.1 urllib3/1.26.16 tqdm/4.65.0 importlib-metadata/6.8.0 keyring/23.8.2 rfc3986/1.5.0 colorama/0.4.5 CPython/3.10.7

File hashes

Hashes for gpit-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ff64f34f575f91c4c01c617b7d74888f2025687532566d6be27f79b01dba2e30
MD5 27303ce1eda701f55d7ca6f3a49be768
BLAKE2b-256 938715891d8a552178bae992db102d9ad9ad9fa2da3b6205bd20460e2a512b48

See more details on using hashes here.

Supported by

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