GitLab Duo Chat

Tier: GitLab.com and Self-managed: Premium or Ultimate for a limited time. In the future, Premium with GitLab Duo Pro or Ultimate with GitLab Duo Pro or Enterprise. GitLab Dedicated: GitLab Duo Pro or Enterprise. 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.

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

For GitLab Dedicated, you must have GitLab Duo Pro or Enterprise.

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.

The context Chat is aware of

GitLab Duo Chat is sometimes aware of the context you’re working in. Other times, you must be more specific with your request.

In the GitLab UI, GitLab Duo Chat knows about these areas:

Area How to ask Chat
Epics From the epic, ask about this epic, this, or the URL. From any UI area, ask about the URL.
Issues From the issue, ask about this issue, this, or the URL. From any UI area, ask about the URL.
Code files From the single file, ask about this code or this file. From any UI area, ask about the URL.

In the IDEs, GitLab Duo Chat knows about these areas:

Area How to ask Chat
Selected lines in the editor With the lines selected, ask about this code or this file. Chat is not aware of the file; you must select the lines you want to ask about.
Epics Ask about the URL.
Issues Ask about the URL.
Open files Start working in a file, making sure that you have opened the files you want as used as context. For details, see open tabs as context.

In addition, in the IDEs, when you use any of the slash commands, like /explain, /refactor, /fix, or /tests, Duo Chat has access to the code you selected.

Duo Chat always has access to:

  • GitLab documentation.
  • General programming and coding knowledge.

We are continuously working to expand contextual awareness of Chat to include more types of content.

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 or /clear 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.

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.