Metadata-Version: 2.1
Name: git-ai-toolkit
Version: 0.2.3
Summary: A toolkit for using OpenAI's GPT-4o-mini model to assist with Git workflows.
Home-page: https://github.com/maximilianlemberg-awl/git-ai-toolkit
Author: Maximilian Lemberg
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.txt

# 🧰 Git AI Toolkit

## 👋 Description

This tool can generate commit messages for your Git repository by summarizing the changes using the OpenAI API. It identifies the Git repository, checks for changes (both staged and unstaged), and uses OpenAI to provide a comprehensive commit message following conventional commit formats. If you approve, the changes can be committed and optionally pushed to the remote repository.

### Enhanced Features

- **Conventional Commit Format**: Uses standardized types (feat, fix, docs, etc.)
- **Smart Context Gathering**: Analyzes branch, file types, and repository context
- **Staged & Unstaged Changes**: Handles both types of changes with selective staging
- **Interactive Editing**: Edit commit messages before finalizing
- **Project-Specific Conventions**: Learns from your commit history
- **Color-Coded Output**: Better visual organization of information
- **Extended Description**: Auto-generates detailed descriptions for complex changes

## 🚀 Installation

Install the package via pip:

```sh
pip install git_ai_toolkit
```

## ⚙️ Configuration

1. **Add Your OpenAI API Key**

   Add your OpenAI API key to your environment variables by updating your shell's configuration file.

   For `zsh` (Zsh users):
   
   ```sh
   echo '\nexport OPENAI_API_KEY="your_openai_api_key_here"' >> ~/.zshrc
   source ~/.zshrc
   ```

   For `bash` (Bash users):
   
   ```sh
   echo '\nexport OPENAI_API_KEY="your_openai_api_key_here"' >> ~/.bashrc
   source ~/.bashrc
   ```

   Replace `your_openai_api_key_here` with your actual OpenAI API key.

## 💻 Usage

1. **Navigate to Your Git Project Directory**

    Ensure you are in the root directory of your Git repository:

    ```sh
    cd path/to/your/git/repository
    ```

2. **Run the Command**

    Execute the script using the command:

    ```sh
    ai-commit
    ```

3. **Follow the Prompts**

    - The script will check for a Git repository and detect changes.
    - It will then generate a suggested commit message using the OpenAI API.
    - You will have the option to commit the changes with the suggested message.
    - Finally, you will be prompted to push the changes to the remote repository.


## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE.txt) file for more details.
