How to add Gemini to VS Code
Table of Contents
Gemini can be connected to VS Code in two ways: through Google’s official extension using a Google account, or through a third-party extension with an API key.
Important: Gemini Code Assist no longer works for personal accounts. As of June 18, 2026, the Gemini Code Assist extension stopped supporting the free plan for individuals, as well as Google AI Pro and Ultra subscriptions. Sign-in with a personal Google account is no longer available. Google is moving individual users to Google Antigravity. Gemini Code Assist is now available only in the Standard and Enterprise editions for corporate customers through Google Cloud.
Article reviewed in November 2026.
Method 1. Google Antigravity extension
- Open VS Code (version 1.90 or later is required).
- Go to the Extensions tab:
Ctrl+Shift+Xon Windows and Linux,Cmd+Shift+Xon macOS. - Search for Google Antigravity and make sure the publisher is Google.
- Click Install.
- Click the Antigravity icon in the sidebar and sign in with your personal Google account.
On the first launch, the extension automatically installs the local agy service that powers the agent.
Antigravity’s free plan includes unlimited Tab-based autocomplete and basic weekly limits on agent requests. Google AI Pro and Ultra subscriptions increase these limits.
Method 2. Gemini API key in Cline or Continue
This method is suitable if you need to choose a specific model or pay only for the tokens you use:
- Create an API key in Google AI Studio.
- Install the Cline or Continue extension from the Marketplace.
- In the extension settings, select the Gemini provider (Google), paste the key, and choose a model.
At the free level, Gemini API provides access to Flash models, but Google may use such requests to train its models. The flagship Gemini 4 Argon model is available only on a paid plan. DeepSeek can be connected through Cline in the same way; for more details, see the article how to use DeepSeek in VS Code.
What Gemini can do for your work (DevOps, SEO, scripts)
- Write and debug Bash and Python scripts. Select a code fragment and ask: “Add error handling to this loop” or “Optimize this pipeline.”
- Generate configurations. For example, Nginx redirect rules when migrating a website or a multi-stage Dockerfile.
- Explain code. If you are reviewing someone else’s old code from GitHub, Gemini can explain the logic of a complex script line by line.
- Unit tests. Automatically generate tests for your automation tools.
- Find vulnerabilities. Get help identifying unsafe constructs in scripts and Docker images.
Advantages over browser-based chat
- Project context. Unlike a web interface, AI in the editor can see the project structure, open files, and dependencies, making its suggestions more accurate.
- Autocomplete. Code suggestions appear as you type, similar to GitHub Copilot.
- Terminal. AI helps compose commands for the integrated VS Code terminal.
Comparison: Gemini and Claude in VS Code
Anthropic also offers an official extension — Claude Code. The key difference lies in the pricing model and workflow: Antigravity provides autocomplete and a free agent with limits, while Claude Code works only as an agent and requires either a paid subscription or API-based billing.
| Gemini (Google Antigravity) | Claude (Claude Code) | |
|---|---|---|
| Marketplace extension | Google Antigravity, publisher Google | Claude Code (anthropic.claude-code) |
| VS Code version | 1.90 or later | 1.94 or later |
| Sign-in | Personal Google account | Paid Claude subscription or Claude Console account |
| Free access | Yes: unlimited autocomplete, agent with weekly limits | No: Claude’s free plan does not include Claude Code |
| Paid access | Google AI Pro and Ultra — higher limits | Pro — $20 per month ($17 when billed annually), Max — from $100, Team, Enterprise, or token-based API billing |
| Autocomplete while typing | Yes, with Tab | No, work is performed through the agent panel |
| Agent workflow | The agent performs tasks across the project | Reviewable work plan before starting, changes shown as diffs in VS Code’s built-in viewer, file and line mentions with @, multiple conversations in tabs |
| Model context window | Up to 1 million tokens (Gemini 4 Argon in the API) | Up to 1 million tokens (Opus 5.5, Sonnet 5.5) |
| API key in third-party extensions | Free tier for Flash models | No free tier |
What to choose:
- You want a free start and autocomplete while typing — Google Antigravity.
- You need an agent for large changes across multiple files with a review of every modification and are willing to pay — Claude Code.
- You want to choose the model yourself and pay only for tokens — Cline or Continue with a Gemini API, Anthropic, or OpenRouter key: one extension, any models.
Availability by country. Gemini API and Google AI Studio are not available in every country. The current list is provided on the Available regions page. If the service is unavailable in your country, you may need a VPN.