Skip to main content

A toolkit for using OpenAI's GPT-4o-mini model to assist with Git workflows.

Project description

🧰 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:

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):

    echo '\nexport OPENAI_API_KEY="your_openai_api_key_here"' >> ~/.zshrc
    source ~/.zshrc
    

    For bash (Bash users):

    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:

    cd path/to/your/git/repository
    
  2. Run the Command

    Execute the script using the command:

    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 file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_ai_toolkit-0.2.3.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_ai_toolkit-0.2.3-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file git_ai_toolkit-0.2.3.tar.gz.

File metadata

  • Download URL: git_ai_toolkit-0.2.3.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for git_ai_toolkit-0.2.3.tar.gz
Algorithm Hash digest
SHA256 2227d9f1e249ff24f214b334c61453031de100a2c4e25a1a13f225ff559f83ff
MD5 1054b5bdc398dfcc9e87656e9691f8ed
BLAKE2b-256 6c1d07f107b1f5b28b8fc99e12e7be45dee13ca87f650437910da3e870abc641

See more details on using hashes here.

File details

Details for the file git_ai_toolkit-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: git_ai_toolkit-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for git_ai_toolkit-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 986bb8d0aacbd97bbb573668791ccab118db128e3235b1b64702912009d50a3a
MD5 b23430e595a4a99d5580756c01f810d7
BLAKE2b-256 c20a22c43440972d1a25c0a47442d375b9acc9a97f531e2dd4e12e0881df3896

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page