Chat with Gemini in IDX

Project IDX facilitates your development workflows with an AI-assisted chatbot. Before you use any of the chat assistance from Gemini in IDX, make sure you add Gemini to your workspace.

To learn more, see Generative Code Assistance.

Get code help with Gemini chat

  1. Open Project IDX. If you haven't already, add Gemini to your workspace.

  2. Click the Gemini icon at the bottom of the workspace or press Cmd+Shift+Space (Ctrl+Shift+Space on ChromeOS, Windows or Linux). The Gemini chat sidebar appears.

  3. Ask Gemini questions and get code suggestions.

Use slash commands in Gemini chat

You can guide the output Gemini chat provides by using slash commands, shortcuts prefaced with a forward slash (/). Enter / at the beginning of your Gemini chat prompt and select the action you want from the list of available slash commands.

For example, /generate acts as a prompt shortcut to generate code snippets. Enter /generate followed by a short description of what you want.

/generate css for a black background returns the following code snippet:

body {
  background-color: black;

/* This CSS code sets the background color of the <body> element to black. This will make the background of the entire web page black. */

Manage your chat threads

You can keep different topics separate in your Gemini chats by starting different threads. You can then refer back to earlier threads based on topic.

To start a new chat:

  1. Click the plus icon or select New Chat from the dropdown in the chat header bar.

  2. Enter your prompt.

The chat header bar with chat thread expanded

To switch to another chat thread:

  1. Expand the dropdown with your chat threads in the chat header bar.

  2. Select the chat thread you want to access.

  3. Continue that chat thread or refer back to previous chats with Gemini in IDX.

To delete a chat thread:

  1. Select the chat thread you want to delete from the chat thread dropdown in the chat header bar.

  2. Click the trash icon in the chat header bar. Confirm that you want to delete the chat thread.

View code citations in chat

To help you verify the code suggestions, IDX shares information about the original source and associated licenses. You can see a complete log of code citations from the Gemini chat window by clicking the License Log icon in the chat header bar.

License log icon in the chat header bar

To learn more about Google code citations, see Generative Code Assistance.