AI-powered Git automation for VS Code. Generate smart commit messages and create Pull Requests with a single click using OpenAI or local Ollama models.
Features
🚀 Smart Push: Automatically stages your changes, generates a meaningful commit message based on your code diff, commits, and pushes to your remote.
📝 AI Commit Messages: Uses advanced LLMs to write industry-standard commit messages following Conventional Commits.
🛠️ Zero Config PRs: Automatically detects your GitHub repository and opens a Pull Request flow after pushing.
🏠 Local & Cloud Support: Choose between OpenAI (GPT-4o) or run completely locally using Ollama.
Getting Started
1. Configure your AI Provider
Open VS Code Settings (Cmd+,) and search for Gai:
Provider: Choose openai or ollama.
Model: Set your preferred model (e.g., gpt-4o or llama3.2).
2. Set your API Key (If using OpenAI)
Run the command from the Command Palette (Cmd+Shift+P):
Gai: Set OpenAI API Key
Note: Ollama does not require an API key as it runs locally.
Usage
Go to the Source Control view in VS Code and look for the 🚀 icon in the title bar.
Click the Rocket icon 🚀.
Gai will analyze your changes and suggest a commit message.
Confirm the message or choose to edit it.
Gai will commit, push, and ask if you'd like to create a Pull Request.
Requirements
Git: Must be installed and initialized in your workspace.
Ollama (Optional): If you want to use local models, ensure Ollama is installed and running (ollama serve).
Extension Settings
This extension contributes the following settings:
gai.ai.provider: Choose between openai and ollama.
gai.ai.model: The model to use for generation.
gai.ollama.baseUrl: The base URL for your local Ollama instance (default: http://localhost:11434).
gai.rules: Custom rules for commit message generation (e.g., "Mention ticket IDs", "No emojis").