.nh .TH "glab" "1" "Nov 2026" "Auto generated by spf13/cobra" "" .SH NAME glab-deploy-token-create - Create a deploy token. .SH SYNOPSIS \fBglab deploy-token create [flags]\fP .SH DESCRIPTION Create a deploy token for a project or a group. .PP The token value is printed only once, when the token is created, and cannot be retrieved later. Use \fB--output json\fR to capture it from a script. .PP A deploy token authenticates as a username and token pair, so both values from the output are needed to use it. .PP The token does not expire unless \fB--expires-at\fR is given. .PP Every token must be granted at least one scope with \fB--scope\fR\&. For the scopes you can grant, see https://docs.gitlab.com/user/project/deploy_tokens/#scope. .SH OPTIONS \fB-E\fP, \fB--expires-at\fP= Expiry of the token, as YYYY-MM-DD (00:00 UTC) or an RFC 3339 timestamp. The token does not expire if omitted. .PP \fB-g\fP, \fB--group\fP="" Create a deploy token for a \fBgroup\fR instead of a project. Accepts a group ID or full path. .PP \fB--jq\fP="" Filter JSON output with a jq expression. .PP \fB-F\fP, \fB--output\fP="text" Format output as: text, json. .PP \fB-R\fP, \fB--repo\fP="" Select another repository. You can use either OWNER/REPO or GROUP/NAMESPACE/REPO. The full URL or Git URL is also accepted. .PP \fB-S\fP, \fB--scope\fP=[] Scope to grant the token. Multiple scopes can be comma-separated or specified by repeating the flag. .PP \fB--username\fP="" Username for the token. Defaults to 'gitlab+deploy-token-\&'. .SH OPTIONS INHERITED FROM PARENT COMMANDS \fB-h\fP, \fB--help\fP[=false] Show help for this command. .SH EXAMPLE .EX # Create a read-only deploy token for the current project glab deploy-token create ci-reader --scope read_repository # Create a token that can also pull images from the container registry glab deploy-token create ci-reader --scope read_repository --scope read_registry # Create a token for a specific project, with a custom username glab deploy-token create ci-reader --scope read_repository --username ci-reader --repo user/my-repo # Create a token that is valid until the end of 2027 glab deploy-token create ci-reader --scope read_repository --expires-at 2028-01-01 # Create a group deploy token glab deploy-token create ci-reader --scope read_repository --group group/sub-group # Create the token that CI/CD jobs receive as CI_DEPLOY_USER and CI_DEPLOY_PASSWORD glab deploy-token create gitlab-deploy-token --scope read_registry # Create a token and print its username and value from a script glab deploy-token create ci-reader --scope read_repository --output json --jq '"\\(.username) \\(.token)"' .EE .SH SEE ALSO \fBglab-deploy-token(1)\fP