Metadata-Version: 2.1
Name: komitai
Version: 0.0.2
Summary: Generate git commit using AI
Author-email: Angga <anggakawa@gmail.com>
Project-URL: Homepage, https://github.com/anggakawa/git-diff-lm
Project-URL: Issues, https://github.com/anggakawa/git-diff-lm/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: annotated-types>=0.7.0
Requires-Dist: anyio>=4.7.0
Requires-Dist: certifi>=2024.12.14
Requires-Dist: colorama>=0.4.6
Requires-Dist: distro>=1.9.0
Requires-Dist: exceptiongroup>=1.2.2
Requires-Dist: h11>=0.14.0
Requires-Dist: httpcore>=1.0.7
Requires-Dist: httpx>=0.28.1
Requires-Dist: idna>=3.10
Requires-Dist: jiter>=0.8.2
Requires-Dist: openai>=1.58.1
Requires-Dist: prompt_toolkit>=3.0.48
Requires-Dist: pydantic>=2.6.1
Requires-Dist: pydantic_core>=2.21.0
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: sniffio>=1.3.1
Requires-Dist: tqdm>=4.67.1
Requires-Dist: typing_extensions>=4.12.2
Requires-Dist: wcwidth>=0.2.13

# 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 diff` output 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

1. Clone this repository
2. Install dependencies:
```bash
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

1. Stage your changes using `git add`
2. Run the tool:
```bash
komitai
```

To update stored credentials:
```bash
komitai -u
```

## How it Works

1. Retrieves staged changes using `git diff --staged`
2. Sends diff to OpenAI API with specific prompting
3. Analyzes changes and generates appropriate commit message
4. Allows user review/editing before committing
5. 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
