| Crates.io | gitlab-ci-ls |
| lib.rs | gitlab-ci-ls |
| version | 1.2.2 |
| created_at | 2024-04-03 13:37:55.108065+00 |
| updated_at | 2025-09-23 21:18:20.136452+00 |
| description | Language server for Gitlab CI |
| homepage | |
| repository | https://github.com/alesbrelih/gitlab-ci-ls |
| max_upload_size | |
| id | 1195049 |
| size | 1,231,040 |
This is an independent project and not an official GitLab product.
It is intended to be used alongside yaml-language-server (yamlls), providing specialized support for GitLab CI files without replacing yamlls.
jobs, includes, variables,
needs, extends, components, stages and variables.jobs, extends and stages.extends, stages, needs, variables, included projects files and components.extends references, stage definitions, job needs usage and components.It also supports jump to included files. In case it is a remote file it tries to downloading using current workspace git setup and caches it locally.
Note that this video doesn't include all functionalities.
Initialization options:
false.gitlab-ci-ls.yml)For projects that do not have a standard .gitlab-ci.yml file at their root (e.g., GitLab CI template projects that define reusable components without a pipeline of their own), you can specify the root CI files using a .gitlab-ci-ls.yml file in your project's root directory. This allows the language server to correctly identify and process your GitLab CI configurations.
The .gitlab-ci-ls.yml file should contain a root_files key, which is a list of paths to your main GitLab CI files. These paths can be:
.gitlab-ci.yml or .gitlab-ci.yaml files.
Example: ["path/to/my-pipeline.gitlab-ci.yml"].gitlab-ci.yml or .gitlab-ci.yaml files within the specified directories.
Example: ["pipelines/"]["templates/**/*.gitlab-ci.yml"]You can combine these types in a single list to cover all your root CI files.
Example .gitlab-ci-ls.yml:
root_files:
- pipeline1/.gitlab-ci.yml
- pipeline2/.gitlab-ci.yml
- shared-templates/**/*.gitlab-ci.yml
- ci-configs/
Hint: On Linux you have to install the package libssl-dev (On Debian based distributions) respectively openssl-devel (On RedHat based distributions) when you use Cargo or Mason installation.
brew install alesbrelih/gitlab-ci-ls/gitlab-ci-lscargo install gitlab-ci-lscargo build --release
Executable can then be found at target/release/gitlab-ci-ls
Easiest way to use this using neovim is to install it using mason with combination of mason-lspconfig.
Important: To use it now you will have to set correct file type. Before it was attached on
yaml file types, but I have decided that it brings too much confusion.
Example how to add it:
vim.filetype.add({
pattern = {
['%.gitlab%-ci%.ya?ml'] = 'yaml.gitlab',
},
})
Extension can be found here.
This extension supports configuration which needs to be set up because gitlab-ci-ls itself isn't installed along with the extension but it needs to be downloaded from releases, brew or built from source.

To use gitlab-ci-ls with Emacs lsp-mode, reference the below sample
configuration.
(add-to-list 'lsp-language-id-configuration '("\\.gitlab-ci\\.yml$" . "gitlabci"))
(add-to-list 'lsp-language-id-configuration '("/ci-templates/.*\\.yml$" . "gitlabci"))
(lsp-register-custom-settings
'(("gitlabci.cache" "/path/where/remote/folders/will/be/cached")
("gitlabci.log_path" "/tmp/gitlab-ci-ls.log")))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("gitlab-ci-ls"))
:activation-fn (lsp-activate-on "gitlabci")
:server-id 'gitlabci
:priority 10
:initialization-options (lambda () (gethash "gitlabci" (lsp-configuration-section "gitlabci")))))