Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

ai-git

MCP.Pizza Chef: Codexiaoyi

AI-Git is a Git server that enhances the standard Git CLI by integrating AI capabilities. It automatically generates meaningful commit messages and descriptive branch names based on the current staged changes, streamlining the Git workflow. Fully compatible with all standard Git commands, it falls back to native Git for unsupported commands, making it a seamless AI-enhanced Git experience.

Use This MCP server To

Automatically generate commit messages from staged changes Create descriptive branch names based on code modifications Use AI-Git as a drop-in replacement for standard Git commands Improve Git commit quality with AI-generated messages Streamline Git workflows by reducing manual message writing Maintain full compatibility with existing Git repositories Fallback to native Git commands when AI features are unsupported

README

AI-Git: Git CLI with AI Capabilities

alt text

AI-Git is a Git wrapper that enhances standard Git commands with AI capabilities. It can generate commit messages and branch names based on your changes, making your Git workflow more efficient.

Features

  • AI-assisted Commit Messages: Automatically generate meaningful commit messages based on your changes
  • AI-assisted Branch Names: Create descriptive branch names based on your changes
  • Full Git Compatibility: Works with all standard Git commands, falling back to native Git for unsupported commands

Installation

# Clone the repository
git clone https://github.com/Codexiaoyi/ai-git.git

# Build and install
cd ai-git
go build -o ai-git .
sudo mv ai-git /usr/local/bin/

Usage

Basic Usage

AI-Git works as a drop-in replacement for Git. Simply use ai-git instead of git for any command:

# AI-assisted commit (automatically generates a commit message)
ai-git commit

# AI-assisted branch creation (automatically generates a branch name)
ai-git checkout -b

# Use any other Git command (falls back to native Git)
ai-git status
ai-git push
ai-git pull
ai-git log

Manual Editing Mode

You can manually edit the AI-generated commit messages and branch names:

# Commit with manual editing of the message
ai-git -m commit

# Checkout with manual editing of the branch name
ai-git -b checkout

Configuration

The application supports multiple AI models, including OpenAI, Ollama, Anthropic, DeepSeek, and Qwen. The configuration is managed using environment variables with default values.

Environment Variables

Variable Name Default Value Description
AI_TYPE ollama Specifies the AI model type to use (openai, ollama, anthropic, deepseek, qwen)
AI_GIT_EDITOR $EDITOR or vim Editor to use for manual editing mode
OPENAI_API_KEY "" OpenAI API key
OPENAI_MODEL gpt-3.5-turbo OpenAI model to be used
OPENAI_BASE_URL https://api.openai.com/v1/chat/completions OpenAI API endpoint URL
OLLAMA_BASE_URL http://localhost:11434 Base URL for Ollama
OLLAMA_MODEL qwen2.5:7b Ollama model to be used
ANTHROPIC_API_KEY "" Anthropic API key
ANTHROPIC_MODEL claude-3-opus-20240229 Anthropic model to be used
ANTHROPIC_BASE_URL https://api.anthropic.com/v1/messages Anthropic API endpoint URL
DEEPSEEK_API_KEY "" DeepSeek API key
DEEPSEEK_MODEL deepseek-chat DeepSeek model to be used
DEEPSEEK_BASE_URL https://api.deepseek.com/v1/chat/completions DeepSeek API endpoint URL
QWEN_API_KEY "" Qwen API key
QWEN_MODEL qwen-max Qwen model to be used
QWEN_BASE_URL https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation Qwen API endpoint URL

Configuration Examples

Set up your AI model type and API key:

export OPENAI_API_KEY="your_api_key_here"
export AI_TYPE="openai"

How It Works

When you run an AI-Git command:

  1. If it's a supported command (like commit or checkout -b), AI-Git uses AI to enhance the command's behavior
  2. If it's an unsupported command, AI-Git passes it through to the native Git command

This means you can use AI-Git for your entire Git workflow without having to switch between different commands.

License

[License details]

Acknowledgements

Git-related code is referenced from https://github.com/jatinsandilya/mcp-server-auto-commit. Thanks to jatinsandilya!

ai-git FAQ

How do I install AI-Git?
Clone the repository, build the binary, and move it to your system path as described in the GitHub README.
Can AI-Git be used as a direct replacement for Git?
Yes, AI-Git works as a drop-in replacement and supports all standard Git commands.
What AI capabilities does AI-Git provide?
It generates commit messages and branch names automatically based on your staged changes.
What happens if AI-Git encounters an unsupported Git command?
It falls back to the native Git command to ensure full compatibility.
Does AI-Git require internet access for AI features?
Typically, AI-Git uses local or integrated AI models; check the documentation for specific model requirements.
Is AI-Git compatible with all Git repositories?
Yes, it works with any standard Git repository without modification.
Can AI-Git improve commit message consistency?
Yes, by generating meaningful and standardized commit messages automatically.
Which AI models does AI-Git support?
AI-Git can integrate with various AI providers like OpenAI, Claude, and Gemini depending on configuration.