Using a code assistant in Code Studios: Gemini#
This tutorial teaches you how to add the Gemini CLI Companion assistant to help you write code. You can start by creating your first Code Studio. We will guide you through the needed steps to empower your Code Studio with this assistant.
Prerequisites#
Dataiku >= 14.5
Administrator privileges for your user profile.
The Gemini CLI for Code Studios plugin must be installed.
Gemini API key or Google credentials (you need an account eligible to Gemini Code Assist)
Note
The Gemini CLI for Code Studios plugin needs to be installed. See the reference documentation for more information on installing plugins.
Adding Gemini CLI to a Code Studio#
Creating a Code Studio Template#
In your Dataiku instance, choose Administration from the Applications menu.
Navigate to the Code Studios tab.
Click the + Create Code Studio Template button.
Type a name for your template, such as
gemini-template, and then select Create.Click on the Definition tab.
Adding the Visual Studio Code block#
Use the + Add a Block and select the Visual Studio Code block.
Adding the Gemini CLI block#
Use the + Add a Block and select the Gemini CLI block.
Defining settings#
Operation mode#
The choice of your operation mode will determine how you authenticate with your Gemini model.
The options Connect to Gemini using the credentials of a Dataiku connection, and Manually enter a Gemini API key will allow you to use a Vertex AI or a Gemini connection. With these options, you will already be authenticated when launching your Code Studio.
The option Let Gemini authenticate (to log in with your Google account) will allow you to use the Gemini Code Assist related to your account. With this option, you will need to authenticate each time you launch Code Studio.
For this tutorial, we will try the first option (Dataiku connection) and the last option (Google account).
VS Code extension#
Selecting the Add VS Code extension checkbox will install the Gemini CLI Companion extension. If you decide to keep the checkbox unselected, you will use Gemini CLI without the benefits of the extension, like Open Editor File Context or Native Diffing.
Advanced parameters#
Selecting the Show advanced parameters checkbox will allow you to add advanced parameters to your Gemini CLI usage.
Gemini CLI version: use it if you need to set a specific version of Gemini CLI.
Default Gemini model name: use it if you want to set a specific model. For available models, see: Google Models
VS Code extension version: use it if you need to set a specific version of the dedicated Visual Studio Code extension for Gemini CLI.
Building the template#
You can now build your Code Studio image to use it. To do so, use the Build button. If you need more details on building a Code Studio template, refer to the tutorial My first Code Studio.
Using Gemini CLI in your Code Studio#
From your project, use the Code Studios from the Code menu to create and launch your Code Studio based on the template you defined. If you need detailed steps, the Launching your first Code Studio documentation will guide you.
Authenticating#
If you choose the Connect to Gemini using the credentials of a Dataiku connection, Gemini CLI is ready to use. From the Code Studio terminal, launch the command gemini and start using Gemini CLI.
If you choose the Let Gemini authenticate (to log in with your Google account) option in your settings, you will need an extra step to use Gemini CLI. From the Code Studio terminal, launch the command gemini.
Choose the option Sign in with Google. This option will generate an authentication URL. Use it in your browser and choose your Google account. This process gives you an authorization code that you will copy and paste into the terminal.
Using Gemini CLI#
At this point, your Code Studio is fully operational, and you can start using your environment to code with the assistance of all the features in Gemini CLI. You can find additional information on the usages of Code Studios in edit your code or in edit your Code Agent.
Wrapping up#
Congratulations, you’ve learned how to set up and launch a Code Studio in Dataiku that provides access to Gemini CLI.
