AI copilot for Git workflows in VS Code.
Git Copilot is a VS Code extension that automates common Git operations using an intelligent agent.
It detects the current repository, guides you through staging files, generates commit messages using AI, and pushes changes β all with real-time progress updates inside VS Code.
- π Automatic Git repository detection
- π Detects current working directory or workspace
- π Lists unstaged files
- β
Interactive file staging
- Select all files
- Manually select files
- Cancel safely
- βοΈ AI-generated commit messages
- π Commit and push workflow
- π‘ Live progress streaming inside VS Code
- π Safe-by-default Git operations
Git Copilot consists of two layers:
- Detects repository context
- Displays progress banners
- Collects user input (file selection, confirmations)
- Streams agent updates in real time
- Executes Git workflow as a state graph
- Streams structured status events back to VS Code
- Uses AI to generate commit messages
- VS Code β₯ 1.108
- Git installed and available in PATH
- Python 3.10+
- Node.js 18+ (for development)
- OpenAI API Key (for AI-generated commit messages)
- Download the latest
.vsixfile from releases - Install the extension:
code --install-extension git-copilot-0.0.1.vsixOr via VS Code:
- Open Command Palette (
Cmd/Ctrl + Shift + P) - Type:
Extensions: Install from VSIX... - Select the downloaded
.vsixfile
-
Reload VS Code
Cmd/Ctrl + Shift + PβDeveloper: Reload Window
-
Configure OpenAI API Key
- Run
Git Copilot: Run Agentcommand - Enter your OpenAI API key when prompted
- The key is stored securely in VS Code's secret storage
- Run
git clone https://github.com/yourusername/git-copilot.git
cd git-copilotTypeScript/Node.js:
npm installPython:
cd python
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
cd ..The extension will prompt you for your API key on first run and store it securely.
Alternatively, for development/testing, create a .env file:
# python/.env
OPENAI_API_KEY=sk-your-openai-api-key-hereYou may also set:
ANTHROPIC_API_KEY=...
GROQ_API_KEY=...
GEMINI_API_KEY=...
MISTRAL_API_KEY=...Note: The
.envfile is only for local development. When installed as an extension, the API key is stored in VS Code's secure storage.
npm run compileOr watch mode for development:
npm run watchPress F5 in VS Code to:
- Compile the code
- Launch Extension Development Host
- Test the extension in a new VS Code window
npm install -g @vscode/vsce
vsce packageThis creates git-copilot-0.0.1.vsix that you can:
- Install locally:
code --install-extension git-copilot-0.0.1.vsix - Share with others
- Publish to VS Code Marketplace
vsce publish- Open any Git repository in VS Code
- Open Command Palette
- macOS:
Cmd + Shift + P - Windows/Linux:
Ctrl + Shift + P
- macOS:
- Run:
Git Copilot: Run Agent - Follow the prompts:
- Select files to stage
- Review AI-generated commit message
- Confirm push to remote
git-copilot/
βββ src/
β βββ extension.ts # VS Code extension entry point
βββ python/
β βββ main.py # Python agent entry point
β βββ requirements.txt # Python dependencies
β βββ venv/ # Python virtual environment (created on setup)
β βββ core/
β βββ agent_schemas.py # Data schemas
β βββ git_utils.py # Git operations
β βββ pagent.py # Agent orchestration
β βββ review_agent.py # Commit message generation
βββ out/ # Compiled TypeScript output
βββ package.json # Extension manifest
βββ tsconfig.json # TypeScript configuration
βββ .vscodeignore # Files excluded from packaging
- API Keys: Stored securely using VS Code's Secret Storage API
- Git Operations: Read-only by default; writes only with explicit user confirmation
- Network: Only communicates with OpenAI API for commit message generation
-
Check Output Panel:
ViewβOutput- Select
Extension Hostfrom dropdown - Look for
[git-copilot]logs
-
Verify Python Setup:
cd python
source venv/bin/activate
python --version # Should be 3.10+
pip list # Check installed packages- Verify Git Repository:
git status # Should show repository status- Ensure Python virtual environment exists:
python/venv/ - Reinstall dependencies:
cd python
source venv/bin/activate
pip install -r requirements.txt --force-reinstall- Delete and re-enter your API key:
- Run command again and enter key when prompted
- Or clear VS Code secrets and restart
npm testnpm run lintnpm run watch- Open project in VS Code
- Press F5 to launch Extension Development Host
- Set breakpoints in
src/extension.ts - Run
Git Copilot: Run Agentin the debug window
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE.txt for details
Found a bug or have a feature request?
Open an issue