.nh .TH "glab" "1" "Sep 2026" "Auto generated by spf13/cobra" "" .SH NAME glab-artifact-registry-get-token - Get a short-lived access token for the GitLab Artifact Registry. (EXPERIMENTAL) .SH SYNOPSIS \fBglab artifact-registry get-token [flags]\fP .SH DESCRIPTION Exchange a GitLab credential for a short-lived access token scoped to the GitLab Artifact Registry. The command prints the bare token to stdout, so a shell can capture it directly, for example to feed \fBdocker login\fR\&. .PP Prerequisites: .IP \(bu 2 A GitLab Enterprise Edition (EE) instance on GitLab 19.1 or later. .IP \(bu 2 Token exchange enabled on the instance (the \fBgate_token_exchange_endpoint\fR feature flag). .PP This feature is an experiment and is not ready for production use. It might be unstable or removed at any time. For more information, see https://docs.gitlab.com/policy/development_stages_support/. .SH OPTIONS \fB--duration\fP=15m0s How long the token should remain valid. Must be between 1s and 12h0m0s. .PP \fB--hostname\fP="" GitLab hostname to request the token from. Defaults to the configured GitLab instance. .PP \fB--jq\fP="" Filter JSON output with a jq expression. .PP \fB-F\fP, \fB--output\fP="text" Format output as: text, json. .SH OPTIONS INHERITED FROM PARENT COMMANDS \fB-h\fP, \fB--help\fP[=false] Show help for this command. .SH EXAMPLE .EX # Get a token using the default duration glab artifact-registry get-token # Get a token valid for one hour glab artifact-registry get-token --duration 1h # Get a token as JSON, including its expiry glab artifact-registry get-token --output json .EE .SH SEE ALSO \fBglab-artifact-registry(1)\fP