# GitLab CI/CD

IntelliJ IDEA recognizes and offers coding assistance for `.gitlab-ci.yml` files, where you can define instructions for GitLab CI/CD pipelines. For more details, refer to the [GitLab documentation](https://docs.gitlab.com/topics/build_your_application/).

Procedure: Enable the GitLab plugin

This functionality relies on the [GitLab](https://plugins.jetbrains.com/plugin/22857-gitlab)  plugin, which  is bundled and enabled in IntelliJ IDEA   by default. If the relevant features are not available, make sure that you did not disable the plugin.

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Plugins`.

2. Open the Installed tab, find the GitLab plugin, and select the checkbox next to the plugin name.

## Features

The following features are supported:

* [Syntax highlighting](configuring-colors-and-fonts.html) IntelliJ IDEA provides syntax highlighting for all components of GitLab CI/CD configuration files. You can customize the color scheme for different parts of the configuration: * YAML structure of your configuration file: `Settings | Editor | Color Scheme | YAML` * [CI/CD variable expressions](https://docs.gitlab.com/ci/jobs/job_rules/#cicd-variable-expressions): `Settings | Editor |Color Scheme | GitLab CI Expression` * [Shell script injections](#shell-injections): `Settings | Editor |Color Scheme | Shell Script`

* [Inspections](https://www.jetbrains.com.cn/en-us/help/inspectopedia/GitLab-CI-CD.html) IntelliJ IDEA helps you detect configuration issues in your GitLab CI/CD configuration file in real time. This includes duplicated job usage, undefined jobs, and undefined stages.

* [Code completion](auto-completing-code.html) Get completion suggestions for the pipeline configuration syntax, keywords, and CI/CD variables. ![Code completion for pipeline configuration syntax](https://resources.jetbrains.com.cn/help/img/idea/2026.2/gitlab-ci-completion.png)

* [Code navigation](navigating-through-the-source-code.html#go_to_declaration) Quickly navigate between `stage` and `job` declarations and usages in your CI/CD configuration file.

* [Quick documentation](viewing-reference-information.html) Hover over a symbol or use the Documentation tool window (`Ctrl+Q` (Windows), `F1` (macOS), `⌃ J` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Ctrl+Q` (XWin), `Ctrl+Q` (GNOME), `Ctrl+Q` (KDE), `Ctrl+Q` (Emacs), `Ctrl+Q` (Sublime Text), `Ctrl+Q` (Sublime Text (macOS)), `Ctrl+Q` (NetBeans), `Ctrl+K, I` (Visual Studio), `⌘ K, I` (Visual Studio (macOS)), `Alt+Middle-Click` (Eclipse), `⌥ Middle-Click` (Eclipse (macOS))) to view quick documentation, including links to the official GitLab CI reference. ![Quick documentation for GitLab CI configuration](https://resources.jetbrains.com.cn/help/img/idea/2026.2/gitlab-ci-quick-doc.png)

* [Find usages](find-highlight-usages.html) Search for usages of `stage` and `job` symbols directly in your configuration file.

* [Rename refactoring](rename-refactorings.html) You can change the name of `stage` and `job` symbols in declarations and usages by applying the Rename refactoring (`Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `Ctrl+R` (NetBeans), `Ctrl+R, R` (Visual Studio), `⌘ R, R` (Visual Studio (macOS)), `Alt+Shift+R` (Eclipse), `⇧ F6` (Eclipse (macOS))).

* Detection of Shell script language injections IntelliJ IDEA automatically detects Shell script injections in `before_script`, `script`, and `after_script` blocks of your configuration file and marks them as Injected Language: Shell Script. The IDE treats these code snippets as full-featured Shell scripts. You can edit Shell script fragments, explain them, and benefit from language-specific features, like syntax highlighting and code completion. You can disable this behavior using the Switch shell script injection intention action on the injected section in your configuration file. Note that switching Shell script injections on or off affects the whole project. ![Shell script injection in a GitLab CI configuration file](https://resources.jetbrains.com.cn/help/img/idea/2026.2/shell-script-injection-gitlab-ci.png)

## Troubleshooting

### Missing coding assistance features

To ensure full support of GitLab CI/CD, check that the correct JSON schema is used for your `.gitlab-ci.yml` file.

IntelliJ IDEA automatically loads a set of popular schemas, including GitLab's CI schema (usually named `gitlab-ci`).

If features like code completion, inspections, or navigation are missing or not working as expected, the issue may be related to JSON schema configuration.

Procedure: Configure a JSON schema

* Open your `.gitlab-ci.yml` file in the editor and check the JSON Schema widget in the bottom right corner. Make sure that `gitlab-ci` is selected.

![JSON Schema widget](https://resources.jetbrains.com.cn/help/img/idea/2026.2/gitlab-ci-json-schema.png)

* If the schema is not listed:

1. Download it manually from [https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json](https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json).

2. In IntelliJ IDEA, go to `Settings | Languages & Frameworks  | Schemas and DTDs | JSON Schema Mappings` and [add a custom JSON
schema mapping](json.html#ws_json_schema_add_custom_procedure).

3. Assign the added schema to your `.gitlab-ci.yml` file using the JSON Schema widget.

