glab(1)
π glab-deploy-token-create π
okay bestie, welcome to the glab(1) manual page for deploy tokens β this is the group-chat explainer version, but the facts are exactly the facts. β¨
β¨ NAME β¨
glab-deploy-token-create β Create a deploy token.
π¦ SYNOPSIS π¦
glab deploy-token create [flags]
π DESCRIPTION π
Create a deploy token for a project or a group. Periodt.
β οΈ The token value is printed only once, when the token is created, and cannot be retrieved later. Use --output json to capture it from a script. Like, save it somewhere cute immediately β because it is not coming back, bestie. π
A deploy token authenticates as a username and token pair, so both values from the output are needed to use it. π
The token does not expire unless --expires-at is given. β³
Every token must be granted at least one scope with --scope. For the scopes you can grant, see https://docs.gitlab.com/user/project/deploy_tokens/#scope. π
πΈ OPTIONS πΈ
-E,--expires-at=β Expiry of the token, asYYYY-MM-DD(00:00 UTC) or an RFC 3339 timestamp. The token does not expire if omitted.-g,--group=""β Create a deploy token for a group instead of a project. Accepts a group ID or full path.--jq=""β Filter JSON output with a jq expression.-F,--output="text"β Format output as:text,json.-R,--repo=""β Select another repository. You can use eitherOWNER/REPOorGROUP/NAMESPACE/REPO. The full URL or Git URL is also accepted.-S,--scope=[]β Scope to grant the token. Multiple scopes can be comma-separated or specified by repeating the flag.--username=""β Username for the token. Defaults to'gitlab+deploy-token-'.
π«Ά OPTIONS INHERITED FROM PARENT COMMANDS π«Ά
-h,--help[=false]β Show help for this command.
π₯ EXAMPLE π₯
# 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)"'
π SEE ALSO π
glab-deploy-token(1) β go check that one too, bestie π
π«Ά Auto generated by spf13/cobra Β· dated Nov 2026 Β· this is the glab(1) manual, bestie. π
π¦ where this page comes from
- arch rolling: glab 1.128.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms