Installation and Setup of Gemini in VS Code
Learn how to install and activate Gemini Code Assist in Visual Studio Code and generate your first code using a natural language prompt.
With the fundamentals covered, we can now move from theory into practice. In this lesson, we aim to install, configure, and validate Gemini Code Assist in our development environment. This step transforms the concept of an AI collaborator from an abstract idea into a practical tool we can use directly in our workflow.
Gemini Code Assist integrates with various popular development environments, including the JetBrains family of IDEs, such as IntelliJ, PyCharm, and Android Studio. Our work throughout this course will use Visual Studio Code, leveraging its versatility and extensive ecosystem.
Note: It is important to install Visual Studio Code on your system to follow the steps. However, if you want to install it on your local machine, you can download it from the official website.
The entire setup process is straightforward. It begins by adding the extension directly from the VS Code Marketplace.
Step 1: Installing the Gemini Code Assist extension
Our first step is to add the official Gemini Code Assist extension to Visual Studio Code. This straightforward process is handled directly within the editor’s built-in marketplace.
First, we need to open the “EXTENSIONS” view by clicking the icon that looks like a set of stacked blocks in the VS Code “Activity Bar” on the left-hand side of your window. Alternatively, we can use the keyboard shortcut
Ctrl+Shift+X
(orCmd+Shift+X
on macOS) to open it.
In the search bar at the top of the “EXTENSIONS” view, type “Gemini Code Assist.” As we type, a list of extensions will appear. It is crucial to select the official extension published by Google. This ensures we are installing the correct and secure version of the tool.
Click the blue “Install” button for the official Gemini Code Assist extension. The installation process will begin, and it should only take a moment. Once it is complete, the button will change to show that the extension is installed, and we may see a new Gemini logo icon appear in your activity bar.
With the extension successfully installed, our next step is to sign in and authorize it with our Google account.
Step 2: Signing in and connecting our account
With the extension installed, our next step is to authorize it by connecting our Google account. This is what activates Gemini’s capabilities and allows it to communicate with Google’s foundation models.
In the VS Code “Activity Bar” on the left, click the new “Gemini” icon. ...