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 script generates succinct commit messages for your Git repository by summarizing the changes using the OpenAI API. It identifies the Git repository, checks for changes using git diff, and uses OpenAI to provide a one-sentence summary of the changes. If the user approves, the changes can be committed and optionally pushed to the remote repository.

Prerequisites

  • Python 3.9
  • Git
  • Pip

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.1.4.tar.gz (4.0 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.1.4-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for git_ai_toolkit-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6804f6d9fb967302aaf4d82b2810b99781e48986e8a8a37a06d813fb58e4d077
MD5 4a826c16f98e1941ffe40d04d7b801bb
BLAKE2b-256 0a7e88522688363faa900d6333de23cbdc3d045dd295dd1f9e45e1b5c89e6133

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for git_ai_toolkit-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 91bbb6867902082d448d233360fdfb50b96ba88ce736b684ce657a7f23eb6c2b
MD5 d9e7ff14931390c83ca75e586dea959b
BLAKE2b-256 db60b1901a20d22957424495fbd316624dfcae823b356c93eaf0b89b07a2c318

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