Skip to main content

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.

Release files for gpit 0.0.4

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

Source distribution (sdist)

Source distribution for gpit 0.0.4
File Size Uploaded
gpit-0.0.4.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gpit 0.0.4
File Interpreter ABI Platform
gpit-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size:13.8 kB

Release files / gpit-0.0.4.tar.gz

Download URL gpit-0.0.4.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
652dcb10c3e7ce4ded2ce75f5f297054b5994ab9985b50fee4edbc60448b988d
BLAKE2b-256 checksum
How to use checksums
0caa69552080bdf69550f6fbefb7764796820fb846d605711b8c9f2326fb90cd
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / gpit-0.0.4-py3-none-any.whl

Download URL gpit-0.0.4-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff64f34f575f91c4c01c617b7d74888f2025687532566d6be27f79b01dba2e30
BLAKE2b-256 checksum
How to use checksums
938715891d8a552178bae992db102d9ad9ad9fa2da3b6205bd20460e2a512b48
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.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