GitLab Duo Chat

Tier: Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated
History

GitLab Duo Chat is your personal AI-powered assistant for boosting productivity. It can assist various tasks of your daily work with the AI-generated content.

For a limited time, the following users have free access to GitLab Duo Chat:

  • GitLab.com users who are members of at least one group with a Premium or Ultimate subscription.
  • GitLab self-managed users with a Premium or Ultimate subscription.
  • GitLab Dedicated users.

Eventually a subscription add-on will be required for continued access to GitLab Duo Chat. Learn more about Duo Pro and Duo Enterprise pricing.

Supported editor extensions

You can use GitLab Duo Chat in:

Visual Studio support is under active development. You can express interest in other IDE extension support in this issue.

Use GitLab Duo Chat in the GitLab UI

  1. In the upper-right corner, select GitLab Duo Chat. A drawer opens on the right side of your screen.
  2. Enter your question in the chat input box and press Enter or select Send. It may take a few seconds for the interactive AI chat to produce an answer.
  3. Optional. Ask a follow-up question.

To ask a new question unrelated to the previous conversation, you might receive better answers if you clear the context by typing /reset and selecting Send.

note
Only the last 50 messages are retained in the chat history. The chat history expires 3 days after last use.

Use GitLab Duo Chat in the Web IDE

History
  • Introduced in GitLab 16.6 as an experiment.
  • Changed to generally available in GitLab 16.11.

To use GitLab Duo Chat in the Web IDE on GitLab:

  1. Open the Web IDE:
    1. In the GitLab UI, on the left sidebar, select Search or go to and find your project.
    2. Select a file. Then in the upper right, select Edit > Open in Web IDE.
  2. Then open Chat by using one of the following methods:
    • On the left sidebar, select GitLab Duo Chat.
    • In the file that you have open in the editor, select some code.
      1. Right-click and select GitLab Duo Chat.
      2. Select Explain selected code, Generate Tests, or Refactor.
    • Use the keyboard shortcut: ALT+d (on Windows and Linux) or Option+d (on Mac)
  3. In the message box, enter your question and press Enter or select Send.

If you have selected code in the editor, this selection is sent along with your question to the AI. This way you can ask questions about this code selection. For instance, Could you simplify this?.

note
GitLab Duo Chat is not available in the Web IDE on self-managed.

Use GitLab Duo Chat in VS Code

History
  • Introduced in GitLab 16.6 as an experiment.
  • Changed to generally available in GitLab 16.11.

To use GitLab Duo Chat in GitLab Workflow extension for VS Code:

  1. Install and set up the Workflow extension for VS Code:
    1. In VS Code, download and install the GitLab Workflow extension for VS Code.
    2. Configure the GitLab Workflow extension.
  2. In VS Code, open a file. The file does not need to be a file in a Git repository.
  3. Open Chat by using one of the following methods:
    • On the left sidebar, select GitLab Duo Chat.
    • In the file that you have open in the editor, select some code.
      1. Right-click and select GitLab Duo Chat.
      2. Select Explain selected code or Generate Tests.
    • Use the keyboard shortcut: ALT+d (on Windows and Linux) or Option+d (on Mac)
  4. In the message box, enter your question and press Enter or select Send.

If you have selected code in the editor, this selection is sent along with your question to the AI. This way you can ask questions about this code selection. For instance, Could you simplify this?.

Use GitLab Duo Chat in JetBrains IDEs

History
  • Introduced as generally available in GitLab 16.11.

To use GitLab Duo Chat in the GitLab Duo plugin for JetBrains IDEs:

  1. Install and set up the GitLab Duo plugin for JetBrains IDEs:
    1. In the JetBrains marketplace, download and install the GitLab Duo plugin.
    2. Configure the GitLab Duo plugin.
  2. In a JetBrains IDE, open a project.
  3. Open Chat by using one of the following methods:
    • On the right tool window bar, select GitLab Duo Chat.
    • Use a keyboard shortcut: ALT + d on Windows and Linux, or Option + d on macOS.
    • In the file that you have open in the editor:
      1. Optional. Select some code.
      2. Right-click and select GitLab Duo Chat.
      3. Select Open Chat Window.
      4. Select Explain Code, Generate Tests, or Refactor Code.
    • Add keyboard or mouse shortcuts for each action under Keymap in the Settings.
  4. In the message box, enter your question and press Enter or select Send.

Watch a demo and get tips

For tips and tricks about integrating GitLab Duo Chat into your AI-powered DevSecOps workflows, read the blog post: 10 best practices for using AI-powered GitLab Duo Chat.

View examples of how to use GitLab Duo Chat.

Get code explained, refactored, or generate tests

In VS Code, JetBrains IDEs, or in the Web IDE, you can have code explained, refactored, or generate test for it.

  1. Select code in your editor.
  2. In the Chat box, type one the following slash commands:

Alternatively, use the context menu to perform these tasks.

When you use a slash command, you can also add additional instructions, for example: /tests using the Boost.Test framework.

Delete all conversations

To delete all previous conversations:

  • In the text box, type /clear and select Send.

Give feedback

Your feedback is important to us as we continually enhance your GitLab Duo Chat experience. Leaving feedback helps us customize the Chat for your needs and improve its performance for everyone.

To give feedback about a specific response, use the feedback buttons in the response message. Or, you can add a comment in the feedback issue.