glab(1)
โจ NAME โจ
glab-token-rotate โ bestie, this is the glow-up command: it rotates user, group, or project access tokens ๐
(oh and hi, you're reading the glab(1) manual, welcome to the group chat ๐ซถ)
๐ธ SYNOPSIS ๐ธ
glab token rotate [] [flags]
๐ฆ DESCRIPTION ๐ฆ
okay so real talk: rotating a token revokes the existing one and creates a brand new one with a fresh secret value and a new expiration date. The old token stops working immediately โ like, not "in a minute", not "after the cache clears", immediately โ so you literally must go update every single client that's using it with the new value this command hands back to you. No cap, don't skip that part ๐ญ
If multiple tokens share the same name, you gotta specify the token ID so you pick the correct one. Names are not unique bestie, act accordingly.
The token expires at 00:00 UTC on a date calculated by adding the duration to today's date. Default duration is 30 days. You can specify a different duration in days (d), weeks (w), or hours (h). Heads up: --duration and --expires-at are mutually exclusive โ pick one, you can't have both ๐
Administrators can rotate personal access tokens that belong to other users. iconic admin energy, honestly ๐
Use --self to rotate the token currently used for authentication. This command requires GitLab 17.9 or later, so vibe check your instance version first.
๐ OPTIONS ๐
-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 at00:00 UTCon the calculated date โฐ-E,--expires-at=0001-01-01โ Sets the token's expiration date and time, inYYYY-MM-DDformat. If not specified,--durationis used.-g,--group=""โ Rotate group access token. Ignored if a user or repository argument is set. (like, it just minds its own business ๐)--jq=""โ Filter JSON output with ajqexpression.-F,--output="text"โ Format output as:text,json.'text'provides the new token value;'json'outputs the token with metadata.-R,--repo=""โ Select another repository. You can use eitherOWNER/REPOorGROUP/NAMESPACE/REPO. The full URL or Git URL is also accepted.--self[=false]โ Rotate the access token currently used for authentication ๐ช-U,--user=""โ Rotate personal access token. Use@mefor the current user.
๐ฎ OPTIONS INHERITED FROM PARENT COMMANDS ๐ฎ
-h,--help[=false]โ Show help for this command. the classic, the icon, the legend ๐ซ
๐ EXAMPLE ๐
# Rotate project access token of current project (default 30 days)
glab token rotate my-project-token
# Rotate project access token with explicit expiration date
glab token rotate --repo user/repo my-project-token --expires-at 2025-08-08
# Rotate group access token with 7 day lifetime
glab token rotate --group group/sub-group my-group-token --duration 7d
# Rotate personal access token with 2 week lifetime
glab token rotate --user @me my-personal-token --duration 2w
# Rotate a personal access token of another user (administrator only)
glab token rotate --user johndoe johns-personal-token --duration 90d
# Rotate the current authentication token
glab token rotate --self --duration 90d
see how easy that was? slay ๐
๐ SEE ALSO ๐
glab-token(1) โ go read the parent page too, iykyk ๐ง
quick recap so you don't get caught slipping: the old token dies the second you run this, so update your clients with the new value this command returns. periodt.
Auto generated by spf13/cobra โจ that's the source/version, and this lil cutie is dated Nov 2026 โ catch you in the next glab(1) page, 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