glab(1)

πŸ’… glab-token-create β€” NAME ✨

okay so bestie, this is glab-token-create from the glab(1) manual, and it Creates user, group, or project access tokens. that's literally the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS

glab token create  [flags]

🌸 DESCRIPTION

so it makes a brand new access token for a user, a group, or a project. by default it's giving project access token energy β€” unless you specify a user or group name, then it switches up. slay. ✨

the expiration date? she's calculated by adding the duration (default: 30 days) to the current date, and expiration happens at midnight UTC on that calculated date. you can flex a different duration using days (d), weeks (w), or hours (h), or just hand over an explicit end date. your call, main character. πŸ’–

the token name must be unique β€” no cap, no duplicates. the token itself gets printed to stdout. πŸ”₯

Administrators can create full-featured personal access tokens for themselves and for other users. πŸ‘‘

Non-administrators can only create personal access tokens for themselves (@me). and those tokens have to use the scope 'k8s_proxy' β€” that's the rule, periodt. for the tea, see the GitLab documentation for the User tokens API ⟨https://docs.gitlab.com/api/user_tokens/#create-a-personal-access-token⟩. 🧚


πŸ’… OPTIONS

  • -A, --access-level=no β€” the access level of the token: one of 'guest', 'reporter', 'developer', 'maintainer', 'owner'. pick your fighter. 🫢
  • --description="" β€” sets the token's description. give it a lil personality. πŸ’œ
  • -D, --duration=30d β€” sets the token lifetime in days. accepts: days (30d), weeks (4w), or hours in multiples of 24 (24h, 168h, 720h). maximum: 365d. the token expires at midnight UTC on the calculated date. ⏰
  • -E, --expires-at=0001-01-01 β€” sets the token's expiration date and time, in YYYY-MM-DD format. if you don't specify it, --duration is used instead. πŸ—“οΈ
  • -g, --group="" β€” create a group access token. ignored if a user or repository argument is set. πŸ™ˆ
  • --jq="" β€” filter JSON output with a jq expression. for the data girlies. ⭐
  • -F, --output="text" β€” format output as 'text' for the token value, or 'json' for the actual API token structure. 🌈
  • -R, --repo="" β€” select another repository. you can use either OWNER/REPO or GROUP/NAMESPACE/REPO. the full URL or Git URL is also accepted. πŸ”—
  • -S, --scope=[read_repository] β€” scopes for the token. multiple scopes can be comma-separated or specified by repeating the flag. for a list, see https://docs.gitlab.com/security/tokens/access_token_scopes/. πŸ’«
  • -U, --user="" β€” create a personal access token. for the current user, use @me. πŸ’–

πŸ‘‘ OPTIONS INHERITED FROM PARENT COMMANDS

  • -h, --help[=false] β€” show help for this command. the lil helper. πŸŽ€

πŸ”₯ EXAMPLE

# Create project access token for current project (default 30 days)
glab token create --access-level developer --scope read_repository --scope read_registry my-project-token

# Create project access token with 7 day lifetime
glab token create --repo user/my-repo --access-level owner --scope api my-project-token --duration 7d

# Create a group access token expiring in 2 weeks
glab token create --group group/sub-group --access-level owner --scope api my-group-token --duration 2w

# Create a personal access token for current user with 90 day lifetime
glab token create --user @me --scope k8s_proxy my-personal-token --duration 90d

# (administrator only) Create a personal access token for another user
glab token create --user johndoe --scope api johns-personal-token --duration 180d

# Create a token with explicit expiration date
glab token create --access-level developer --scope api my-token --expires-at 2025-12-31

πŸ¦‹ SEE ALSO

  • glab-token(1) β€” go read that one too, bestie, iykyk. πŸ’œ

ok that's the whole page!! it was Auto generated by spf13/cobra, version vibes from Nov 2026, and yes the manual is glab(1) β€” mwah, go create some tokens, you ate πŸ’…βœ¨πŸŽ€
πŸ“¦ where this page comes from