Generate git commit using AI
Project description
git-diff-lm
A command-line tool that uses OpenAI's language models to automatically generate meaningful git commit messages from staged changes.
Features
- Analyzes
git diffoutput using OpenAI's GPT models - Generates concise, descriptive commit messages
- Detects and alerts about sensitive information in diffs
- Allows editing of suggested commit messages before committing
- Securely stores API credentials
Installation
- Clone this repository
- Install dependencies:
pip install -r requirements.txt
Setup
On first run, you'll be prompted to enter:
- Your OpenAI API key
- OpenAI Base URL (optional, defaults to standard OpenAI API endpoint)
Usage
- Stage your changes using
git add - Run the tool:
commit-ai
To update stored credentials:
commit-ai -u
How it Works
- Retrieves staged changes using
git diff --staged - Sends diff to OpenAI API with specific prompting
- Analyzes changes and generates appropriate commit message
- Allows user review/editing before committing
- Executes the commit with the approved message
Security Features
- Scans for sensitive information in diffs
- Alerts user if potential credentials are detected
- Stores API keys securely in user config directory
- Includes .env in .gitignore
Requirements
- Python 3.6+
- Git
- OpenAI API key
- Required Python packages listed in requirements.txt
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
komitai-0.0.1.tar.gz
(4.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file komitai-0.0.1.tar.gz.
File metadata
- Download URL: komitai-0.0.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13e2d11e41ce318fa61c2fa872280b2ddfb7eadf10486ca2c5822d35f84c4fe6
|
|
| MD5 |
124ca63d47e28fd712e89dd5aa03b3e7
|
|
| BLAKE2b-256 |
dd537f2f844958b3a56f8914eadf7f93ae40c7d57e7386889269bc10a3fbd22e
|
File details
Details for the file komitai-0.0.1-py3-none-any.whl.
File metadata
- Download URL: komitai-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7113a04888bbe37872438e895431c20dc5fba6cf2c0496f9a106440284dd66fa
|
|
| MD5 |
f74d7688bf07f540f0f57266318c43c1
|
|
| BLAKE2b-256 |
9d734fe7ee3d7b1e7c08364f000dcdd39107df365c3900ec539b93fcc808fb0c
|