GitPilot is an intelligent AI-powered Git assistant that revolutionizes how developers interact with Git. Version 2.0 introduces advanced features including visual Git graphs, AI-powered conflict resolution, repository health monitoring, and semantic commit search—all designed to make Git more accessible, efficient, and intelligent.
- Interactive Git Graph: Visual representation of commit history with branch relationships
- Repository Health Monitor: AI-powered analysis of repository health with actionable insights
- Advanced Analytics: Comprehensive repository statistics and performance metrics
- AI Conflict Resolution: Intelligent merge conflict analysis and resolution suggestions
- Semantic Commit Search: Natural language search through commit history
- Repository Health Analysis: AI-driven recommendations for repository optimization
- Security Scanning: Automated detection of sensitive files and potential security issues
- Multi-format Git Graph: Tree, table, and JSON output formats for commit visualization
- Performance Analytics: Repository size analysis, tracking efficiency metrics
- Security Analysis: Comprehensive security scanning with severity-based recommendations
- Branch Health Monitoring: Intelligent branch management insights
- Natural Language Processing: Converts plain English requests into precise Git commands
- Context-Aware Intelligence: Analyzes your repository state to provide relevant suggestions
- Multi-Model Support: Choose from multiple AI providers and models:
- Google Gemini: Gemini 2.0 Flash for fast, accurate responses
- Groq: Lightning-fast inference with Llama 3.1 8B Instant, Llama 3.3 70B Versatile
- DeepSeek: Advanced reasoning with R1 Distill Llama 70B
- Intelligent Response Parsing: Enhanced parsing handles various response formats from different AI models
- Destructive Operation Detection: Identifies potentially dangerous commands and requires confirmation
- Command Validation: Prevents command injection and validates Git syntax
- Dry-Run Mode: Preview commands before execution
- Context Warnings: Alerts about uncommitted changes, remote status, and other potential issues
- Branch Status: Current branch, detached HEAD detection
- Working Directory State: Staged, unstaged, and untracked files
- Remote Synchronization: Ahead/behind status with remote repositories
- Stash Management: Stash count and status
- Commit History: Last commit information and analysis
- Rich Terminal Interface: Beautiful, colorized output with progress indicators
- Command History: Track and review previously executed commands
- Detailed Explanations: Optional explanations for generated commands
- Interactive Prompts: Confirmation dialogs for destructive operations
GitPilot is built with a modular architecture:
├── cli.py # Command-line interface and user interaction
├── ai_engine.py # Multi-model AI integration (Gemini, Groq, DeepSeek)
├── context_analyzer.py # Git repository state analysis
├── git_executor.py # Safe Git command execution
├── logger.py # Logging and command history
└── prompts.py # AI prompt templates
- CLI Interface: Rich terminal interface with colorized output and interactive prompts
- AI Engine: Multi-provider AI integration supporting:
- Google Gemini (gemini-2.0-flash)
- Groq (llama-3.1-8b-instant, llama-3.3-70b-versatile)
- DeepSeek (deepseek-r1-distill-llama-70b)
- Context Analyzer: Analyzes Git repository state and provides contextual information
- Git Executor: Safely executes Git commands with validation and safety checks
- Logger: Tracks command history and provides debugging information
- Python 3.8 or higher
- Git installed and configured
- At least one AI provider API key:
- Google Gemini API key (set as
GEMINI_API_KEYenvironment variable) - Groq API key (set as
GROQ_API_KEYenvironment variable) - for Groq models - Both keys can be used simultaneously for maximum flexibility
- Google Gemini API key (set as
pip install gitpilotgit clone https://github.com/InflixOp/gitpilot.git
cd gitpilot
pip install -e .git clone https://github.com/InflixOp/gitpilot.git
cd gitpilot
pip install -e .[dev]GitPilot is also available as a VS Code extension! Get the same AI-powered Git assistance directly integrated into your favorite editor.
- Open VS Code
- Go to the Extensions view (
Ctrl+Shift+X) - Search for "GitPilot"
- Click "Install" on the GitPilot - AI Git Assistant extension
code --install-extension InflixOP.gitpilot- 🤖 AI-Powered Panel: Beautiful integrated sidebar panel
- 📋 Command Palette Integration: Access via
Ctrl+Shift+P - 🎯 Context Menu: Right-click integration in Explorer
- ⚙️ Settings Integration: Configure API keys in VS Code settings
- 🔄 Real-time Repository Status: Live Git status display
- 🎨 VS Code Theming: Matches your VS Code theme perfectly
- Install the extension (see methods above)
- Configure API keys:
- Go to VS Code Settings (
Ctrl+,) - Search for "GitPilot"
- Add your Gemini or Groq API key
- Go to VS Code Settings (
- Start using:
- Click the robot icon 🤖 in the Activity Bar
- Or use
Ctrl+Shift+P→ "GitPilot: Execute Command"
"create a new branch for user authentication"
→ git checkout -b feature/user-authentication
"commit all changes with message 'Add login functionality'"
→ git add . && git commit -m "Add login functionality"
"show commits from last week"
→ git log --since="1 week ago" --oneline
-
Set up your API keys:
# For Google Gemini (default) export GEMINI_API_KEY="your-gemini-api-key" # For Groq models (optional) export GROQ_API_KEY="your-groq-api-key"
-
Navigate to a Git repository:
cd your-git-project -
Start using GitPilot:
# Use default model (Gemini) gitpilot "create a new branch for user authentication" # Or select a specific model gitpilot --model 2 "show me the current status" # Groq Llama 3.1 8B gitpilot --model 3 "commit all changes" # Groq Llama 3.3 70B
# Create and switch to a new branch
gitpilot "create a new branch called feature-auth"
# Switch to an existing branch
gitpilot "switch to main branch"
# Delete a branch
gitpilot "delete the old-feature branch"# Stage and commit changes
gitpilot "commit all changes with message 'Add user authentication'"
# Undo last commit but keep changes
gitpilot "undo last commit but keep the changes"
# Amend the last commit
gitpilot "modify the last commit message"# Push to remote repository
gitpilot "push changes to origin"
# Pull latest changes
gitpilot "pull latest changes from remote"
# Sync with remote branch
gitpilot "sync with remote main branch"# Check repository status
gitpilot "show me the current status"
# View commit history
gitpilot "show commits from last week"
# Check differences
gitpilot "show what changed in the last commit"GitPilot 2.0 now features a comprehensive command-line interface with specialized commands:
gitpilot [OPTIONS] [QUERY] # Original natural language interface# Repository health analysis
gitpilot health [--detailed] [--model MODEL] [--format json|text]
# Semantic commit search
gitpilot search "search query" [--limit 50] [--model MODEL]
# Visual Git graph
gitpilot graph [--max-commits 20] [--format tree|table|json]
# Conflict resolution assistance
gitpilot conflicts [--model MODEL]
# Repository analysis
gitpilot analyze --security # Security-focused analysis
gitpilot analyze --performance # Performance metrics--dry-run, -d: Show what would be executed without running the command--explain, -e: Show detailed explanation of the generated command--yes, -y: Auto-confirm destructive operations--history, -h: Show recent command history--version: Show version information--model, -m: Select AI model (1: Gemini, 2: Llama 3.1 8B, 3: Llama 3.3 70B, 4: DeepSeek R1)--skip-model-selection: Skip interactive model selection and use default
# Traditional natural language commands
gitpilot "create a new branch for user authentication"
gitpilot "show me recent commits" --model 2
# New specialized features
gitpilot health --detailed --model 1
gitpilot search "authentication fixes" --limit 30
gitpilot graph --format table
gitpilot conflicts --model 3
gitpilot analyze --security
# Advanced usage
gitpilot health --format json > health-report.json
gitpilot graph --max-commits 50 --format json | jq '.commits[] | .message'Create a configuration file at ~/.gitpilot/config.yaml:
# Auto-confirm destructive operations
auto_confirm: false
# Always show detailed explanations
explain_by_default: false
# Logging level (INFO, DEBUG, ERROR)
log_level: INFOGEMINI_API_KEY: Your Google Gemini API key (required for Gemini models)GROQ_API_KEY: Your Groq API key (required for Groq models)GITPILOT_LOG_LEVEL: Override log level (optional)
GitPilot automatically detects potentially destructive operations:
git reset --hard: Discards uncommitted changesgit clean -f: Permanently deletes untracked filesgit push --force: Overwrites remote historygit rebase: Rewrites commit history
- Uncommitted Changes: Warns before operations that might lose work
- Remote Status: Alerts when branch is behind remote
- Detached HEAD: Notifies about detached HEAD state
- Stash Status: Considers stashed changes in recommendations
click>=8.0.0: Command-line interface frameworkrich>=13.0.0: Rich terminal formattinggoogle-generativeai>=0.3.0: Google Gemini AI integrationgitpython>=3.1.0: Git repository interactionpyyaml>=6.0.0: Configuration file parsingloguru>=0.7.0: Advanced logging
pytest>=7.0.0: Testing frameworkpytest-cov>=4.0.0: Coverage reportingblack>=23.0.0: Code formattingflake8>=6.0.0: Code lintingmypy>=1.0.0: Type checking
# Run all tests
pytest
# Run with coverage
pytest --cov=gitpilot
# Run specific test file
pytest tests/test_cli.pyWe welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a virtual environment:
python -m venv venv - Activate it:
source venv/bin/activate(Linux/Mac) orvenv\Scripts\activate(Windows) - Install dependencies:
pip install -e .[dev] - Run commands starting with "gitpilot"
Found a bug? Please report it on our GitHub Issues page.
This project is licensed under the MIT License - see the LICENSE file for details.