AI-powered Git guardian — scans for secrets, generates commit messages, and guards against dangerous commands.
Why Git Guard? (vs. GitHub Copilot)
While GitHub Copilot is your co-pilot for writing code, Git Guard is your air traffic controller. General AI agents don't natively monitor your terminal for destructive commands or scan your staged files for leaked API keys.
Repository Protection First: Git Guard intercepts dangerous commands (like git push --force) and explains the consequences before disaster strikes.
Pre-Commit Secret Scanning: Actively scans staged files for API keys, passwords, and tokens before they are committed to GitHub.
100% Privacy Focused: Supports running models entirely locally via Ollama, guaranteeing zero data leakage—crucial for enterprise security.
Features
Scan for Secrets: Analyzes your staged files for potential secrets or sensitive information before committing.
Generate Commit Message: Uses AI to generate a highly contextual and descriptive commit message based on your staged changes.
Guard Git Commands: Intercepts and explains potentially dangerous Git commands to prevent repository mistakes.
Local AI Support: Supports both Grok and Ollama, allowing you to run AI models entirely locally for maximum privacy.
Getting Started
Install the extension from the VS Code Marketplace.
Open a project with a Git repository.
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and type AI Git Guard: Configure AI Provider.
Navigate to the API Keys section and generate a new key.
Run the AI Git Guard: Configure AI Provider command in VS Code, select Grok, and paste your API key.
🔒 Privacy Guarantee: Your API key is securely stored in VS Code's native SecretStorage. It never leaves your system and is only sent directly to the xAI API endpoints. We do not track, collect, or store any of your data or keys on external servers.
Setting up Ollama (100% Local)
If you want maximum privacy, you can run the AI entirely on your own machine.