Skip to main content

A collection of AI-powered Git tools

Project description

Git AI Tools

A collection of AI-powered tools for Git, making your Git workflow eas.

Currently includes:

  • Commit message generation
  • Commit message suggestions
  • Support for multiple AI providers:
    • OpenAI
    • Google Gemini
    • DeepSeek
    • Claude

Installation

Install directly from PyPI:

pip install git-ai-tools

Or install from source:

git clone https://github.com/Mik1337/git-ai-tools.git
cd git-ai-tools
pip install -e .

Configuration

1. Choose your AI provider

You can choose between OpenAI (default), Gemini, or DeepSeek:

git config --global git-ai.ai-model openai  # or 'gemini' or 'deepseek'

2. Configure API Key

Set the API key for your chosen provider:

For OpenAI:

git config --global git-ai.openai-key "your-openai-api-key"
# or export OPENAI_API_KEY="your-openai-api-key"

For Gemini:

git config --global git-ai.gemini-key "your-gemini-api-key"
# or export GEMINI_API_KEY="your-gemini-api-key"

For DeepSeek:

git config --global git-ai.deepseek-key "your-deepseek-api-key"
# or export DEEPSEEK_API_KEY="your-deepseek-api-key"

Available Commands

Commit Messages

  1. Quick commit with AI-generated message:
git add .              # Stage your changes
git ai commit          # Creates a commit with AI-generated message
  1. Get commit message suggestions:
# Basic usage - suggests message for staged changes
git ai suggest

# Use unstaged changes instead
git ai suggest --unstaged

# Get suggestion for last commit (useful for amending)
git ai suggest --last

# Customize the message
git ai suggest --shorter          # Get a shorter message
git ai suggest --longer           # Get a more detailed message
git ai suggest "context here"     # Add custom context

Understanding the --last flag

The --last flag is used to generate a commit message based on your last commit's changes instead of the current changes in your working directory. This is particularly useful when:

  • You want to improve/rewrite the message of your last commit
  • You made a quick commit with a poor message and want a better suggestion
  • You plan to amend your last commit and want a better message

Without --last (default behavior):

  • The tool looks at your current changes (either staged or unstaged)
  • Generates a commit message based on what you've modified

With --last:

  • The tool looks at your most recent commit (HEAD)
  • Shows what changes were made in that commit
  • Generates a new commit message for those changes

Example workflow for improving your last commit:

# Get a suggestion for your last commit's changes
git ai suggest --last

# If you like the suggestion, amend your commit with the new message
git commit --amend -m "new message"

Common Workflows

  1. Normal commit workflow:
git add .
git ai commit
  1. Review and edit suggestion before committing:
git add .
git ai suggest > msg.txt
$EDITOR msg.txt
git commit -F msg.txt
rm msg.txt
  1. Amend last commit with better message:
git ai suggest --last
git commit --amend
  1. Direct pipe to commit:
git ai suggest | git commit -F -

Features

  • AI-powered commit message generation
  • Multiple AI provider support
  • Git plugin integration
  • Support for staged/unstaged changes
  • Support for amending commits
  • Customizable message style (shorter/longer)
  • Context-aware suggestions
  • More AI-powered Git tools coming soon

Requirements

  • Python 3.8 or higher
  • Git
  • API key for your chosen AI provider

Contributing

  1. Fork the repository
  2. Make your changes
  3. Create a pull request

License

This project is licensed under the MIT License. See the LICENSE file for 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_tools-0.1.0.tar.gz (6.3 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_tools-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file git_ai_tools-0.1.0.tar.gz.

File metadata

  • Download URL: git_ai_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for git_ai_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ba5b228de164d0f12868566a9275307bd4dae162082d3a279c0f998792fe6027
MD5 face5d37963ecc61bb8a9b17bd0c8124
BLAKE2b-256 a7057ef49cc8c9145b93c5334f63a924b1c2c1974a941430cb687a02d2676a7e

See more details on using hashes here.

File details

Details for the file git_ai_tools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: git_ai_tools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for git_ai_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04f6e4716047522c322a6427ae9e1215c08950848f1af60bf93d29154c02b4a4
MD5 302237a764b2e6fdee70555c8f703a23
BLAKE2b-256 1e3f89de17ea5234d128be657b00487fffa24f6e2f82256b80d257e351e4a906

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