GeminiBeginner

How to Set Up Gemini Code Assist in VS Code

Install the Gemini Code Assist extension, sign in, and get inline completions and chat inside VS Code.

7 minBeginner

Gemini Code Assist brings Gemini into VS Code as inline completions, a chat panel, and code actions. The individual tier is free with generous limits. This guide installs the extension, signs you in, and shows the two features you will use most.

What you need

  • VS Code installed and up to date
  • A Google account for the free individual tier
  • An internet connection for sign-in
  • About 6 minutes

Step 1: Install the extension

Open the Extensions view with the squares icon in the sidebar, search for Gemini Code Assist, and click Install on the entry published by Google. VS Code adds a Gemini icon to the activity bar when it finishes.

VS Code - Extensions
Search: Gemini Code Assist
Gemini Code Assist [Install]
Google * AI completions and chat
12M installs
The Gemini Code Assist extension in the marketplace.

Step 2: Sign in with Google

Click the Gemini icon in the activity bar, then Sign in. VS Code opens a browser tab for Google consent. After you approve, the editor shows your account in the panel and completions become active.

Step 3: Use inline completions

Start typing in any code file. Suggestions appear as gray ghost text ahead of your cursor. Press Tab to accept the whole suggestion, or keep typing to ignore it. Write a descriptive comment first to steer the suggestion.

main.py - VS Code
Explorer
main.py
utils.py
README.md
main.py
1# return the nth fibonacci number iteratively
2def fib(n):
3 a, b = 0, 1
4 for _ in range(n):
5 a, b = b, a + b
6 return a
Ghost-text completion after a guiding comment.

Step 4: Ask the chat panel

Open the Gemini chat panel and ask questions about the open file. You can select code first and reference it with the selection, which keeps answers grounded in your actual code rather than generic advice.

Toggle completions per language
If ghost text is distracting in some files, open settings and disable Code Assist for specific languages while keeping it on where you want it.

Result

You now have Gemini completing code as you type and answering questions in a side panel, without leaving VS Code. The comment-then-Tab habit and the selection-aware chat are the two workflows worth building muscle memory for.

Watch related tutorials

Tags
#vscode#code-assist#extension#ide#completions