docs/dev-tools/backends/gitlab.md
The gitlab backend installs release assets directly from GitLab repositories. It is ideal for tools that distribute pre-built binaries through GitLab releases.
The code for this backend is in the mise repository at ./src/backend/github.rs.
GitLab release links have a display name as well as a download URL.
asset_pattern matches the display name, which may differ from the filename.
For example, GitLab Runner calls its Linux binary binary: Linux amd64.
Add this to a project's mise.toml for Linux x64 or macOS arm64:
[tools."gitlab:gitlab-org/gitlab-runner"]
version = "19.3.1"
bin = "gitlab-runner"
[tools."gitlab:gitlab-org/gitlab-runner".platforms]
linux-x64 = { asset_pattern = "binary: Linux amd64" }
macos-arm64 = { asset_pattern = "binary: macOS arm64" }
mise install
mise exec -- gitlab-runner --version
This installs the executable; it does not register a runner or create a service. For another platform or release, inspect the project's release links and adjust the pattern. Version listing uses releases with attached links, not arbitrary Git tags or GitLab's generated source archives.
For private repositories or higher API limits, mise supports several GitLab token sources.
mise checks these sources in order and uses the first token found:
MISE_GITLAB_ENTERPRISE_TOKEN (for non-gitlab.com hosts)MISE_GITLAB_TOKENGITLAB_TOKENcredential_command (if set)gitlab_tokens.toml (per host)config.yml, if enabled)git credential fill (if gitlab.use_git_credentials=true)export MISE_GITLAB_TOKEN="glpat-xxxxxxxx"
For self-hosted GitLab instances:
export MISE_GITLAB_ENTERPRISE_TOKEN="glpat-yyyyyyyy"
gitlab_tokens.toml)# ~/.config/mise/gitlab_tokens.toml
[tokens."gitlab.com"]
token = "glpat-xxxxxxxx"
[tokens."gitlab.mycompany.com"]
token = "glpat-yyyyyyyy"
credential_commandSet this in your global ~/.config/mise/config.toml. Project configuration
cannot set credential_command. The command must print only the token to stdout:
[settings.gitlab]
credential_command = "op read 'op://Private/GitLab Token/credential'"
mise executes this command with the configured default inline shell. The target hostname is available as MISE_CREDENTIAL_HOST, and the provider name (gitlab) is available as MISE_CREDENTIAL_PROVIDER. For compatibility, recognized sh-compatible shells (ash, bash, dash, ksh, sh, and zsh) also receive the hostname as $1/${1}.
:::: warning Planned deprecation
The legacy $1/${1} hostname argument is deprecated. Use MISE_CREDENTIAL_HOST instead. mise will start warning in 2026.11.0, and $1 compatibility will be removed in 2027.11.0.
::::
mise can read tokens from glab config as a fallback. It checks:
$GLAB_CONFIG_DIR/config.yml~/.config/glab-cli/config.yml — glab's legacy location on every platform, which glab still
prefers when the file exists$XDG_CONFIG_HOME/glab-cli/config.yml~/Library/Application Support/glab-cli/config.yml (macOS)%LOCALAPPDATA%\glab-cli\config.yml (Windows — glab resolves XDG_CONFIG_HOME to
%LOCALAPPDATA% there, unlike gh, which uses %APPDATA%)Disable this fallback with:
[settings.gitlab]
glab_cli_tokens = false
git credential fill fallbackAs a last resort, mise can query git credential helpers:
[settings.gitlab]
use_git_credentials = true
This uses git credential fill and supports credentials stored by helpers such as macOS Keychain.
Use mise token gitlab to see which token mise would use for a given host:
mise token gitlab
mise token gitlab gitlab.mycompany.com
Token diagnostics are masked by default. --unmask prints the actual credential;
use it only when you need the secret itself, and keep it out of shared logs.
The following tool-options are available for the gitlab backend—these
go in [tools] in mise.toml.
When no asset_pattern is specified, mise automatically selects the best asset for your platform. It scores assets on:
For most tools, you can install without specifying a pattern:
mise install gitlab:user/repo
::: tip
The autodetection logic is implemented in src/backend/asset_matcher.rs, which is shared by the GitHub, GitLab, and Forgejo backends.
:::
asset_patternSpecifies a glob matched against the release link's display name. This is useful when there are multiple assets for your OS/arch combination or when you need to override autodetection.
[tools."gitlab:gitlab-org/gitlab-runner"]
version = "latest"
bin = "gitlab-runner"
asset_pattern = "binary: Linux amd64"
matchingNarrows asset selection to names containing the given substring, while keeping platform autodetection. Unlike asset_pattern (which replaces autodetection entirely), matching only refines the candidate set — autodetection still chooses the correct OS/arch from the narrowed list, so a single config stays portable across platforms.
This is the option to reach for when a repository ships multiple binaries as separate per-platform assets and autodetection can't tell which one you want.
[tools]
# When a release ships several binaries per platform (e.g. `mytool-cli` and
# `mytool-server`), matching picks one on every OS/arch without hardcoding a
# platform-specific asset_pattern.
"gitlab:owner/repo" = { version = "latest", matching = "mytool-cli" }
Tool options can also be passed inline on the command line using [key=value] syntax:
mise use "gitlab:owner/repo[matching=mytool-cli]"
matching is a case-sensitive substring test, so a value that is also a substring of another asset's name (e.g. matching = "tool" when both tool-* and tool-extras-* are published) won't uniquely select your binary. Use matching_regex with an anchor when you need a precise match.
If asset_pattern is also set, it takes precedence and matching/matching_regex are ignored — asset_pattern replaces autodetection entirely, so there is no candidate set left for them to narrow. They are ignored silently: when asset_pattern is set, a matching_regex is never consulted and an invalid one is not reported, since mise does not error on a superseded option.
matching_regexLike matching, but the asset name must match the given regular expression. Use this when a substring isn't selective enough. The match is case-sensitive; use an inline (?i) flag for case-insensitive matching.
[tools]
"gitlab:owner/repo" = { version = "latest", matching_regex = "^mytool-cli-" }
If both matching and matching_regex are set, an asset must satisfy both (logical AND)
to remain a candidate.
::: warning
matching/matching_regex are not part of the install path — it is keyed by the tool
name (owner/repo, or a tool_alias) and version. To install two binaries from the same
release, give each its own tool_alias
so they get distinct install directories; reusing the same gitlab:owner/repo string with
different matching values resolves to the same directory and the second install overwrites
the first.
:::
version_prefixSpecifies a custom version prefix for release tags. By default, mise handles the common v prefix (e.g., v1.0.0), but some repositories use different prefixes like release-, version-, or no prefix at all.
When version_prefix is configured, mise will:
[tools]
"gitlab:user/repo" = { version = "latest", version_prefix = "release-" }
Examples:
version_prefix = "release-":
1.0.0 → mise searches for release-1.0.0 tag1.0.0 (prefix stripped)version_prefix = "" (empty string):
1.0.0 → mise searches for 1.0.0 tag (no prefix)To use different asset patterns per platform:
[tools."gitlab:gitlab-org/gitlab-runner"]
version = "latest"
bin = "gitlab-runner"
[tools."gitlab:gitlab-org/gitlab-runner".platforms]
linux-x64 = { asset_pattern = "binary: Linux amd64" }
macos-arm64 = { asset_pattern = "binary: macOS arm64" }
checksumSet an expected digest for a specific version and artifact. Replace the placeholder below with the full SHA-256 digest obtained from a trusted source:
[tools."gitlab:owner/repo"]
version = "1.0.0"
asset_pattern = "tool-1.0.0-x64.tar.gz"
checksum = "sha256:REPLACE_WITH_THE_64_HEX_DIGIT_DIGEST"
Instead of specifying the checksum here, you can use mise.lock to manage checksums.
Each platform needs its own digest. These values are placeholders; fill them from the publisher before installing, or generate mise.lock.
[tools."gitlab:gitlab-org/gitlab-runner"]
version = "19.3.1"
bin = "gitlab-runner"
[tools."gitlab:gitlab-org/gitlab-runner".platforms]
linux-x64 = {
asset_pattern = "binary: Linux amd64",
checksum = "sha256:REPLACE_WITH_THE_64_HEX_DIGIT_DIGEST",
}
macos-arm64 = {
asset_pattern = "binary: macOS arm64",
checksum = "sha256:REPLACE_WITH_THE_64_HEX_DIGIT_DIGEST",
}
sizeOptionally check the expected byte count. The number below is illustrative; use the selected artifact's actual size and pin its version. A size check does not authenticate the publisher or replace a checksum:
[tools]
"gitlab:owner/repo" = { version = "1.0.0", size = "12345678" }
Use each artifact's actual byte count; the following numbers illustrate the syntax:
[tools."gitlab:gitlab-org/gitlab-runner"]
version = "19.3.1"
bin = "gitlab-runner"
[tools."gitlab:gitlab-org/gitlab-runner".platforms]
linux-x64 = { asset_pattern = "binary: Linux amd64", size = "12345678" }
macos-arm64 = { asset_pattern = "binary: macOS arm64", size = "9876543" }
strip_componentsNumber of directory components to strip when extracting archives:
[tools]
"gitlab:owner/repo" = { version = "1.0.0", strip_components = 1 }
::: info
When both strip_components and bin_path are unset, mise automatically applies strip_components = 1 when the extracted archive contains exactly one directory at the root level and no files. This is common with tools like ripgrep that package their binaries in a versioned directory (e.g., ripgrep-14.1.0-x86_64-unknown-linux-musl/rg). Auto-detection places the binary directly in the install path where mise expects it.
:::
binRename the downloaded binary to a specific name. This is useful for single-binary downloads with platform-specific names:
[tools."gitlab:myorg/mytool"]
version = "1.0.0"
asset_pattern = "mytool-linux-x86_64"
bin = "mytool" # Rename from mytool-linux-x86_64 to mytool
::: info
When downloading single binaries (not archives), mise automatically removes OS/arch suffixes from the filename. For example, mytool-linux-x86_64 becomes mytool. Use the bin option only when you need a specific custom name.
:::
rename_exeRename the executable after extracting it from an archive. This is useful when the archive contains a binary with a platform-specific name:
[tools."gitlab:myorg/mytool"]
version = "latest"
asset_pattern = "mytool_linux.zip"
rename_exe = "mytool" # Rename the extracted binary to mytool
::: tip
Use rename_exe for archives whose binary has a different name than you want. Use bin for single-binary downloads (non-archives).
:::
no_appSkip macOS .app bundle assets during autodetection and prefer standalone CLI binaries. This is useful when a repository provides both a macOS .app bundle (often an Xcode extension or GUI application) and a standalone command-line tool:
[tools."gitlab:myorg/mytool"]
version = "latest"
no_app = true
When no_app = true:
.app. (e.g., Tool.app.zip, Tool.for.Xcode.app.zip) are penalized during autodetection.app. assets are already penalized by platform matchingasset_pattern values are used as-isbin_pathPaths are relative to the install directory after strip_components is
applied. Setting bin_path disables automatic root stripping. For an archive
shaped like tool-VERSION/bin/tool, either retain the outer directory and use
bin_path = "tool-{{ version }}/bin", or set both strip_components = 1 and
bin_path = "bin".
::: v-pre
Specify the directory containing binaries within the extracted archive, or where to place the downloaded file. This supports Tera templating with {{ version }} and the {{ os() }} / {{ arch() }} functions:
:::
[tools."gitlab:owner/repo"]
version = "1.0.0"
strip_components = 1
bin_path = "bin" # for an archive shaped like tool-VERSION/bin/tool
Both take keyword arguments that remap the value mise would emit (linux, macos,
windows for os(); x64, arm64 for arch()), for when upstream names the directory
differently:
[tools."gitlab:owner/repo"]
version = "latest"
# expands to tool-1.0.0-linux-x86_64/bin
strip_components = 0
bin_path = 'tool-{{ version }}-{{ os() }}-{{ arch(x64="x86_64", arm64="aarch64") }}/bin'
::: tip Use a single-quoted TOML string when the template contains double quotes, as above. :::
::: v-pre
There are no bare {{ os }} / {{ arch }} variables, and no {{ x86_64_arch }}-style
aliases — {{ arch(x64="x86_64", arm64="aarch64") }} is how you get those names.
:::
Binary path lookup order:
bin_path is specified, use that directorybin_path is not set, look for a bin/ directory in the install pathbin/ directory exists, search subdirectories for bin/ directoriesbin/ directories are found, search immediate subdirectories for executable files. If an executable is found directly within a subdirectory, that subdirectory is treated as a binary path.filter_binsList of binaries to symlink into a filtered .mise-bins directory. This is useful when the tool comes with extra binaries that you do not want to expose on PATH.
[tools]
"gitlab:myorg/mytool" = { version = "1.0.0", filter_bins = "mybin" }
"gitlab:myorg/other-tool" = { version = "1.0.0", filter_bins = ["mybin", "helper"] }
When enabled:
.mise-bins subdirectory is created with symlinks only to the specified binariesapi_urlFor self-hosted GitLab instances, specify the API URL. mise uses this URL for release listing and release asset lookup, and may also use it to download assets when browser download URLs are not reachable or the instance is custom or private:
[tools]
"gitlab:myorg/mytool" = { version = "latest", api_url = "https://gitlab.mycompany.com/api/v4" }
To install a tool from a private repository on gitlab.com, set the MISE_GITLAB_TOKEN environment variable for authentication:
export MISE_GITLAB_TOKEN="your-token"
For a self-hosted GitLab instance, set the api_url tool option and, optionally, the MISE_GITLAB_ENTERPRISE_TOKEN environment variable for authentication:
export MISE_GITLAB_ENTERPRISE_TOKEN="your-token"
gitlab:gitlab-org/gitlab-runnergitlab:gitlab-org/[email protected]