- Supported editor extensions
- The context Chat is aware of
- Use GitLab Duo Chat in the GitLab UI
- Use GitLab Duo Chat in the Web IDE
- Use GitLab Duo Chat in VS Code
- Use GitLab Duo Chat in Visual Studio for Windows
- Use GitLab Duo Chat in JetBrains IDEs
- Watch a demo and get tips
- Give feedback
GitLab Duo Chat
- Introduced as an experiment for SaaS in GitLab 16.0.
- Changed to beta for SaaS in GitLab 16.6.
- Introduced as a beta for self-managed in GitLab 16.8.
- Changed from Ultimate to Premium tier in GitLab 16.9 while in beta.
- Changed to generally available in GitLab 16.11.
- Freely available for Ultimate and Premium users for a limited time.
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.
On October 17, 2024, 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:
- The GitLab UI
- The GitLab Web IDE (VS Code in the cloud)
- VS Code, with the GitLab Workflow extension for VS Code
- JetBrains IDEs, with the GitLab Duo Plugin for JetBrains
- Visual Studio for Windows, with the GitLab Extension for Visual Studio
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.
|
Merge requests | From the merge request, ask about this merge request , this , or the URL. For more information, see Ask about a specific merge request.
|
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. |
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
- In the upper-right corner, select GitLab Duo Chat. A drawer opens on the right side of your screen.
- 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.
- 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.
Use GitLab Duo Chat in the Web IDE
- 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:
- Open the Web IDE:
- In the GitLab UI, on the left sidebar, select Search or go to and find your project.
- Select a file. Then in the upper right, select Edit > Open in Web IDE.
- 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.
- Right-click and select GitLab Duo Chat.
- Select Explain selected code, Generate Tests, or Refactor.
- Use the keyboard shortcut: ALT+d (on Windows and Linux) or Option+d (on Mac)
- 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 VS Code
- 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:
- Install and set up the Workflow extension for VS Code:
- In VS Code, download and install the GitLab Workflow extension for VS Code.
- Configure the GitLab Workflow extension.
- In VS Code, open a file. The file does not need to be a file in a Git repository.
- 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.
- Right-click and select GitLab Duo Chat.
- Select Explain selected code or Generate Tests.
- Use the keyboard shortcut: ALT+d (on Windows and Linux) or Option+d (on Mac)
- 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?
.
In the editor window
- Generally available in the GitLab Workflow extension for VS Code 5.15.0.
To open GitLab Duo Chat in the editor window, use any of these methods:
- From a keyboard shortcut, by pressing:
- MacOS: Option + c
- Windows and Linux: ALT + c
- In the currently open file in your IDE, by selecting some code.
- Right-clicking, then selecting GitLab Duo Chat > Open Quick Chat.
After Quick Chat opens:
- In the message box, enter your question. The available commands are shown while you enter text:
- Enter
/
to display all available commands. - Enter
/re
to display/refactor
.
- Enter
- To send your question, select Send, or press Command + Enter.
- To exit chat, either select the chat icon in the gutter, or press Escape while focused on the chat.
Use GitLab Duo Chat in Visual Studio for Windows
To use GitLab Duo Chat in the GitLab extension for Visual Studio:
- Install and set up the extension for Visual Studio:
- In Visual Studio, download and install the GitLab extension for Visual Studio.
- Configure the GitLab extension for Visual Studio.
- In Visual Studio, open a file. The file does not need to be a file in a Git repository.
- Open Chat by using one of the following methods:
- In the top menu bar, click on Extensions and then select Open Duo Chat.
- In the file that you have open in the editor, select some code.
- Right-click and select GitLab Duo Chat.
- Select Explain selected code or Generate Tests.
- 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 refactor this?
.
Use GitLab Duo Chat in JetBrains IDEs
- Introduced as generally available in GitLab 16.11.
To use GitLab Duo Chat in the GitLab Duo plugin for JetBrains IDEs:
- Install and set up the GitLab Duo plugin for JetBrains IDEs:
- In the JetBrains marketplace, download and install the GitLab Duo plugin.
- Configure the GitLab Duo plugin.
- In a JetBrains IDE, open a project.
- Open GitLab Duo Chat in either a chat window or an editor window:
In a chat window
To open GitLab Duo Chat in a chat window, use any of these methods:
- On the right tool window bar, by selecting GitLab Duo Chat.
- From a keyboard shortcut, by pressing:
- MacOS: Option + d
- Windows and Linux: ALT + d
- In the file that you have open in the editor:
- Optional. Select some code.
- Right-click and select GitLab Duo Chat.
- Select Open Chat Window.
- Select Explain Code, Generate Tests, or Refactor Code.
- Adding keyboard or mouse shortcuts for each action under Keymap in the Settings.
After GitLab Duo Chat opens:
- In the message box, enter your question. The available commands are shown while you enter text:
- Enter
/
to display all available commands. - Enter
/re
to display/refactor
and/reset
.
- Enter
- To send your question, press Enter or select Send.
- Use the buttons within code blocks in the responses to interact with them.
In the editor window
- Generally available in GitLab Duo 3.0.0.
To open GitLab Duo Chat in the editor window, use any of these methods:
- From a keyboard shortcut, by pressing:
- MacOS: Option + c
- Windows and Linux: ALT + c
- In the currently open file in your IDE, by selecting some code, then, in the floating toolbar, selecting GitLab Duo Quick Chat ().
- Right-clicking, then selecting GitLab Duo Chat > Open Quick Chat.
After Quick Chat opens:
- In the message box, enter your question. The available commands are shown while you enter text:
- Enter
/
to display all available commands. - Enter
/re
to display/refactor
and/reset
.
- Enter
- To send your question, press Enter.
- Use the buttons around code blocks in the responses to interact with them.
- To exit chat, either select Escape to close, or press Escape while focused on the chat.
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.