DEV Community

Cover image for A git plugin, for when you draw a blank with commit messages.
Mik
Mik

Posted on

A git plugin, for when you draw a blank with commit messages.

I built a small Git plugin called git-ai-tools that uses LLMs (OpenAI, DeepSeek, and Gemini) to generate commit message suggestions directly from my git diffs. It’s designed to integrate natively with Git and stay out of my way until I need it.

Many code editors offer AI-powered commit message suggestions, but I wanted something that:

  1. Works as a Git subcommand (e.g., git ai commit).
  2. Is completely optional - only runs when explicitly invoked, so it doesn’t interfere with my workflow.
  3. Can be configured easily via git config, no separate config files or external setup

Install

PIP

pip install git-ai-tools
Enter fullscreen mode Exit fullscreen mode

or install from source:

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

Setup

git config --global git-ai.ai-model openai  
git config --global git-ai.openai-key "your-openai-api-key"  
Enter fullscreen mode Exit fullscreen mode

(Supports OpenAI, DeepSeek, and Gemini.)

Usage

$ git ai commit
Enter fullscreen mode Exit fullscreen mode

Opens your default Git commit message editor with a suggested message.

$ git ai suggest
Enter fullscreen mode Exit fullscreen mode

Outputs a suggested message to the terminal for preview or further editing.

Options

git ai suggest              # Suggestion based on staged changes
git ai suggest --unstaged   # Suggestion based on unstaged changes
git ai suggest --last       # Suggestion based on the last commit (useful for amending)
git ai suggest --shorter    # Generate a shorter message
git ai suggest --longer     # Generate a longer message
git ai suggest "context"    # Provide custom context for the suggestion
Enter fullscreen mode Exit fullscreen mode

I built this to scratch my own itch, but maybe you'll find it useful too.

Source Code available under the MIT License here
https://github.com/Mik1337/git-ai-tools

Would love to hear your feedback or suggestions!

Top comments (0)