Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Gemini Code CompletionNew to Visual Studio Code? Get it now.
Gemini Code Completion

Gemini Code Completion

SZR

|
7 installs
| (0) | Free
AI-powered inline code completion using Google Gemini API
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Gemini Code Completion

AI-powered inline code completion for VS Code using Google's Gemini API.

Features

  • 🚀 Real-time inline completions powered by Google Gemini
  • 🧠 Smart context-aware suggestions with configurable context size
  • ⚡ Fast with built-in completion caching
  • 🔧 Configurable - choose your model, temperature, tokens, and more
  • 🎯 Works with any language supported by VS Code
  • 🔐 Secure - your API key is stored locally in VS Code settings

Prerequisites

  1. Google Account with access to Google AI Studio
  2. API Key - Get a free Gemini API key from aistudio.google.com
  3. VS Code 1.82.0 or later

Installation

  1. Clone or download this repository
  2. Install dependencies:
    npm install
    
  3. Build the extension:
    npm run compile
    
  4. Package for local testing:
    vsce package
    
  5. Install the .vsix file in VS Code: Extensions → Install from VSIX

Or install directly from VS Code Extensions Marketplace (when published).

Quick Start

  1. Set API Key:

    • Run command: Gemini: Set API Key
    • Paste your Gemini API key (starts with AIza...)
    • Key is stored securely in VS Code settings
  2. Start using completions:

    • Type code in any file
    • Completion suggestions appear after the debounce delay (default 500ms)
    • Press Tab or Enter to accept
    • Press Esc to dismiss

Configuration

Access settings via VS Code Settings (Cmd+, or Ctrl+,):

Core Settings

Setting Type Default Description
geminiCodeCompletion.enabled boolean true Enable/disable completions
geminiCodeCompletion.apiKey string - Your Gemini API key
geminiCodeCompletion.model string gemini-2.5-flash Model to use

Generation Settings

Setting Type Default Description
geminiCodeCompletion.maxTokens number 256 Max tokens in response
geminiCodeCompletion.temperature number 0.2 Creativity (0.0–1.0)
geminiCodeCompletion.debounceDelay number 500 Delay (ms) before requesting
geminiCodeCompletion.contextLines number 60 Lines of context to send

Available Models

  • gemini-2.5-flash - Fast, free tier (recommended for coding)
  • gemini-2.5-pro - More capable, premium
  • gemini-3-flash-preview - Latest Gemini 3, fast
  • gemini-3.1-pro-preview - Most capable, premium only
  • gemini-3.1-flash-lite-preview - Lightweight & efficient

Commands

Command Shortcut Description
Gemini: Set API Key - Configure your API key securely
Gemini: Enable Code Completion - Turn on completions
Gemini: Disable Code Completion - Turn off completions
Gemini: Select Model Click status bar Choose a different Gemini model
Gemini: Clear Completion Cache - Clear cached completions

Development

Building

npm run compile    # Compile TypeScript → JavaScript
npm run watch      # Watch for changes and compile
npm run lint       # Check code with ESLint

Debugging

  1. Open the workspace in VS Code
  2. Press F5 or go to Run → Start Debugging
  3. A new VS Code window opens with the extension loaded
  4. Set breakpoints and debug as normal
  5. Output channel shows extension logs: Output → Gemini Code Completion

Testing

npm run test       # Run extension tests

Project Structure

.
├── src/
│   └── extension.ts         # Main extension code
├── out/                     # Compiled JavaScript (generated)
├── .vscode/
│   ├── launch.json         # Debug configuration
│   ├── tasks.json          # Build tasks
│   └── settings.json       # Workspace settings
├── package.json            # Project manifest
├── tsconfig.json           # TypeScript config
└── README.md               # This file

Troubleshooting

"No API key configured"

  • Run Gemini: Set API Key command
  • Verify the key starts with AIza...

Completions not appearing

  1. Check the Output → Gemini Code Completion channel for errors
  2. Verify your API key is valid
  3. Check that geminiCodeCompletion.enabled is true
  4. Try selecting a different model with Gemini: Select Model

Rate limit errors

  • Wait a moment before triggering more completions
  • Switch to a different model
  • Check your API quota at aistudio.google.com

Slow completions

  • Increase debounceDelay to reduce requests
  • Reduce contextLines to send less context
  • Try gemini-2.5-flash instead of gemini-2.5-pro

Security & Privacy

  • Your API key is never sent anywhere except to Google's servers
  • Keys are stored securely in VS Code's local settings
  • No analytics or telemetry is collected by this extension
  • All completions requests go directly to Google's Generative AI API

License

MIT

Support & Contributing

  • Report issues: GitHub Issues
  • Contributing: Pull requests welcome!

Related

  • Google Generative AI SDK
  • VS Code Extension API
  • Google AI Studio
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft