GitLab for VS Code extension
The GitLab for VS Code extension integrates GitLab Duo and other GitLab features directly into your IDE.
To get started, install and configure the extension. For added security, you can set up the extension in a Visual Studio Code Dev Container.
When configured, this extension brings the GitLab features you use every day directly into your VS Code environment:
- Work with projects: Plan and track work with issues, review and discuss changes with merge requests, and share code snippets. Use GitLab Duo for AI-native planning and coding.
- Monitor and test CI/CD pipelines: Test your pipeline configuration. View pipeline status and job outputs.
- Secure your application: Review security findings and perform SAST scanning for your project.
- Browse repositories: Access a GitLab repository in read-only mode without cloning it.
When you view a GitLab project in VS Code, the extension shows you information about your current branch:
- The status of the branch’s most recent CI/CD pipeline.
- A link to the merge request for this branch.
- If the merge request includes an issue closing pattern, a link to the issue.
GitLab extension panels
After you install and set up the extension, you can access the following features:
- In the left sidebar, GitLab ( ): Manage issues and merge requests, run CI/CD commands, view pipeline status, and perform security scanning. You can also extend your view with custom queries.
- In the left sidebar, GitLab Duo Agent Platform ( ):
- The chat tab: Interact with GitLab Duo Agentic Chat, or use the New chat ( ) dropdown list to select a foundational or custom agent to work with.
- The flows tab: Use the Software Development Flow. Learn more about the difference between Chat and the flow.
- In the status bar, Duo ( ): Check the feature status of GitLab Duo Code Suggestions and review suggestions in your file as you author code.
- In the left sidebar, GitLab Duo Chat ( ): Interact with GitLab Duo Non-Agentic Chat.
If these features do not appear, see troubleshooting for guidance.
Customize keyboard shortcuts
You can assign different keyboard shortcuts for Accept Inline Suggestion, Accept Next Word Of Inline Suggestion, or Accept Next Line Of Inline Suggestion:
- In VS Code, run the
Preferences: Open Keyboard Shortcutscommand. - Find the shortcut you want to edit, and select Change keybinding ( ).
- Assign your preferred shortcuts to Accept Inline Suggestion, Accept Next Word Of Inline Suggestion, or Accept Next Line Of Inline Suggestion.
- Press Enter to save your changes.
Update the extension
To update your extension to the latest version:
- In Visual Studio Code, go to Settings > Extensions.
- Search for GitLab published by GitLab (
gitlab.com). - From Extension: GitLab, select Update to {later version}.
- Optional. To enable automatic updates in the future, select Auto-Update.
Install the pre-release version
GitLab publishes pre-release builds of the extension to the VS Code Extension Marketplace.
To install the pre-release build:
- Open VS Code.
- Under Extensions > GitLab, select Switch to Pre-release Version.
- Select Restart Extensions.
Check GitLab Duo status
- In Visual Studio Code, on the bottom status bar, select the GitLab icon ( ).
- A menu opens under the VS Code search box, and the GitLab for VS Code extension shows the status. Any errors are displayed next to Status:.
For GitLab Duo Non-Agentic Chat, you can also check the status of Chat.