GitPT
Overview
Welcome to the repo for GitPT, the command line utility that uses an LLM to generate git commit messages for you. Save your brain cycles for something other than writing meaningful commit messages. Choose from LLMs installed on your machine or use API access. Select the message style that matches your codebase and personality: professional, funny, or intrinsic.
Remember: LLMs are used to generate the messages. LLMs make mistakes. Verify all responses created by GitPT
Common Scenarios
If you’d like to get the repo working on your machine, follow these steps.
Setup Your Machine for Development
Assumptions
- You already have Git installed and working.
- You are familiar with Python and creating virtual environments.
- You are able to access a LLM (either locally or with an API key).
Decide about LLM Access
If you prefer a local LLM Be sure your machine can handle the system requirements. Specifics in the Ollama documentation.
- Download Ollama and install it.
- Follow the Ollama instructions for pulling gemma2.
- For Mac, run
ollama pull gemma2in the Terminal and wait for the model to be downloaded into~/.ollama/models/blobs
- For Mac, run
If you prefer API Access
Use the developer documentation to review the API pricing and obtain your API key. For example, at the time of writing, Gemini allows 1,500 requests per day free.
Steps
-
Use Git to Clone this Repo
-
Set Up Python Virtual Environment and Install Poetry
- Follow the venv directions for creating a virtual environment. For example:
python -m venv venv - Activate the virtual environment:
source venv/bin/activate - If Poetry is not installed, install it. For example:
pip install poetry
- Follow the venv directions for creating a virtual environment. For example:
-
Install Project Dependencies
- CD into the project folder.
- Use Poetry to install the project in editable mode:
poetry install - This will install the dependencies specified in
pyproject.tomland set up the project for CLI use.
-
Configure Environment Variables
- Create a
.envfile in the root directory of the project. See Available Environment Variables.
- Create a
-
Run GitPT
- To interact with the CLI, type
gitpt - Use
gitpt --helpto see available options and commands. - See additional Usage Instructions
- To interact with the CLI, type
Usage Instructions
The gitpt commit command helps you generate meaningful commit messages for your Git changes. Here's how to use it:
- Basic Usage
gitpt commit
# Generate commit message with custom style
gitpt --style professional commit
# Specify maximum length for commit message
gitpt --length 50 commit
- Examples
# Basic commit gitpt commit # Conversational style with 50 char limit gitpt --style professional --length 50 commit
Available Environment Variables
| Environment Variable | Description | Default Value |
|---|---|---|
| GITPT__LLM | LLM provider selection (ollama, openai, claude, google) | ollama |
| GITPT__MODEL | Model name to use | gemma2 |
| GITPT__OPENAI_API_KEY | OpenAI API key for using OpenAI models | None |
| GITPT__CLAUDE_API_KEY | Claude API key for using Anthropic models | None |
| GITPT__GOOGLE_API_KEY | Google API key for using Google models | None |
| GITPT__STYLE | Style of generated commit messages | professional |
| GITPT__LENGTH | Maximum length of commit messages | 72 |
Metadata
Release files for gitpt 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gitpt-0.2.0.tar.gz | 9.2 kB | Without provenance | Details for gitpt-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gitpt-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for gitpt-0.2.0-py3-none-any.whl |
Total release size: 19.5 kB
Release files / gitpt-0.2.0.tar.gz
| Download URL | gitpt-0.2.0.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
216bce492b3221bccb9e582e6981a9dceafd22d3a73cd3c3fb728dc28a5b1025
|
|
BLAKE2b-256 checksum How to use checksums |
26d62d0f4967e0b1e15f97d9c0a9d31c7f5a947a592e02100ed60fe5d2b63490
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.12.4 Darwin/23.0.0
|
Release files / gitpt-0.2.0-py3-none-any.whl
| Download URL | gitpt-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
879ad5e45b237e044a0aa87741545d9c86ed361ea665275b4b4f937aed2fadcd
|
|
BLAKE2b-256 checksum How to use checksums |
aff7b4b8c223e54809583dad428e85969d6a6e73f29fce6df93ba3c5e2cc8bd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.12.4 Darwin/23.0.0
|
Security for gitpt 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.