Skip to content

Code Suggestions on GitLab SaaS (FREE SAAS BETA)

  • Introduced in GitLab 15.9 as Beta for early access Ultimate customers on GitLab.com.
  • Enabled as opt-in with GitLab 15.11 as Beta.
  • Moved from GitLab Ultimate to GitLab Premium in 16.0.
  • Moved from GitLab Premium to GitLab Free in 16.0.
  • Enabled by default in GitLab 16.1.

Write code more efficiently by using generative AI to suggest code while you're developing.

Usage of GitLab Duo Code Suggestions is governed by the GitLab Testing Agreement. Learn about data usage when using Code Suggestions.

Enable Code Suggestions

A group owner must enable Code Suggestions for your top-level group.

NOTE: If you are having issues enabling Code Suggestions, view the troubleshooting guide.

Use Code Suggestions

Prerequisites:

To use Code Suggestions:

  1. Determine if your user account is part of the percentage rollout. See Enable Code Suggestions for more information.
  2. Author your code. As you type, suggestions are displayed. Code Suggestions provide code snippets or complete the current line, depending on the cursor position.
  3. Describe the requirements in natural language. Be concise and specific. Code Suggestions generates functions and code snippets as appropriate.
  4. To accept a suggestion, press Tab.
  5. To ignore a suggestion, keep typing as you usually would.
  6. To explicitly reject a suggestion, press Esc.

Things to remember:

  • AI is non-deterministic, so you may not get the same suggestion every time with the same input.
  • Just like product requirements, writing clear, descriptive, and specific tasks results in quality generated code.

Disable Code Suggestions

Individual users can disable Code Suggestions by disabling the feature in their installed IDE editor extension.