glab(1)

πŸ’… glab-variable-update β€” the glow-up your CI variables deserve

okay bestie, so this is a page from the glab manual β€” yes, the GitLab CLI one β€” and it's all about the glab variable update command. Buckle up, we're updating an existing variable for a project or a group. No new variables here, only glow-ups. πŸŽ€


✨ NAME ✨

glab-variable-update β€” literally just: update an existing variable for a project or group. That's the whole vibe. πŸ’–


🌸 SYNOPSIS 🌸

glab variable update   [flags]

that's it, that's the shape of it. flags go brrr. πŸ¦‹


πŸ’« DESCRIPTION πŸ’«

okay so first thing β€” you can pipe the variable value in from standard input. very < secret.txt of you, we love that. 🫢

and if you wanna update a variable for a group instead of the current project, pass --group. easy.

heads up bestie: the --scope flag does not apply to group variables. like, at all. not its lane. πŸ’€

also super important, and honestly kind of iconic: only the attributes you actually pass get changed. everything else stays exactly where it is. so --protected, --masked, --raw, --type and --description all keep their current values unless you specifically set them. no surprise glow-downs here. ✨

and if you wanna turn one of those boolean attributes off? say it with your chest: --protected=false. that's the move. πŸ‘‘


πŸ”₯ OPTIONS πŸ”₯

  • -d, --description="" β€” sets the description of a variable. give it a little lore. πŸ“
  • -g, --group="" β€” sets the variable for a group. group chat energy, not project chat energy.
  • -m, --masked[=false] β€” whether the variable is masked. 🎭
  • -p, --protected[=false] β€” whether the variable is protected. keep it safe, keep it iconic. πŸ›‘οΈ
  • -r, --raw[=false] β€” whether the variable is treated as a raw string. no processing, just vibes.
  • -s, --scope="" β€” the environment_scope of the variable. values: all (which is the default, empty), or specific environments. (remember: doesn't apply to group variables, bestie πŸ«₯)
  • -t, --type="env_var" β€” the type of a variable: env_var, file. pick your fighter. ⭐
  • -v, --value="" β€” the value of a variable. the actual content. the main character. πŸ’…

🌈 OPTIONS INHERITED FROM PARENT COMMANDS 🌈

these come from the parent command, they're like the family heirlooms:

  • -h, --help[=false] β€” shows help for this command. when in doubt, ask for help. πŸ™ˆ
  • -R, --repo="" β€” selects another repository. you can use either OWNER/REPO or GROUP/NAMESPACE/REPO. the full URL or Git URL is also accepted. so many options, all valid. ✨

πŸ¦‹ EXAMPLE πŸ¦‹

okay here's the part where it gets good. live footage of the command in action:

glab variable update WITH_ARG "some value"
glab variable update FROM_FLAG -v "some value"
glab variable update FROM_ENV_WITH_ARG "${ENV_VAR}"
glab variable update FROM_ENV_WITH_FLAG -v"${ENV_VAR}"
glab variable update FROM_FILE < secret.txt
cat file.txt | glab variable update SERVER_TOKEN
cat token.txt | glab variable update GROUP_TOKEN -g mygroup

look at all those ways to feed a value in β€” arg, flag, env var, env var in a flag, stdin redirect, pipe, pipe into a group variable. genuinely obsessed. πŸ˜­πŸ’–


⭐ SEE ALSO ⭐


and that's the page, bestie! πŸŽ€ this little beauty was auto generated by spf13/cobra, dated Nov 2026, and it lives in the glab(1) manual. periodt. πŸ’œβœ¨

πŸ“¦ where this page comes from