glab(1)

πŸ’… glab(1) β€” glab-variable-get

ok so real talk, bestie, this is a page from the glab manual (yes, that glab, the GitLab CLI) and today's main character is glab-variable-get. it's a whole vibe, i promise πŸŽ€


✨ NAME ✨

glab-variable-get β€” get a variable for a project or group 🫢

✨ SYNOPSIS ✨

glab variable get  [flags]

(yes king, that's the whole incantation πŸ”₯)

✨ DESCRIPTION ✨

so what it does: it prints out the value of one variable, and you find it by its key πŸ”‘. simple. chic. iconic.

want a variable that lives in a specific environment? you're gonna use --scope for that 🌸. and if you'd rather read a group variable instead of a project one? that's --group's whole job, she's got you πŸ’….

ok now here's the tea β˜• β€” by default this command reads one level only. that's it. one. no wandering off πŸ”’.

but if you pass --inherited, it'll fall back to the groups above the project, and then to the instance, following the exact order CI resolves a variable in:

  1. the project first πŸ₯‡
  2. then each parent group, closest first 🧚
  3. then instance variables 🌈

and a very important lil detail: a level that doesn't define the key, or that you can't read, is just skipped πŸ’€ β€” no drama, no error, it moves on. and instance variables apply to every environment, which means --scope does not filter them πŸ™ˆ (that's just how it is, bestie).

πŸ’– quick vibe check: this is a get. it reads a thing. it does not set, edit, or delete anything. no cap.

✨ OPTIONS ✨

  • -g, --group="" β€” get the variable for a group instead πŸ«‚
  • --inherited[=false] β€” if the key isn't defined at the level you picked, go look in the groups above it, and then in instance variables. the fallback queen πŸ‘‘
  • --jq="" β€” filter the JSON output with a jq expression ✨ (for the gworls who like their data sculpted)
  • -F, --output="text" β€” format the output as: text, json πŸ“¦
  • -s, --scope="" β€” the environment_scope of the variable. values: all (written as (), empty), or specific environments 🌍

✨ OPTIONS INHERITED FROM PARENT COMMANDS ✨

these aren't even hers, she's just holding them for her parents πŸŽ€

  • -h, --help[=false] β€” show help for this command πŸ†˜
  • -R, --repo="" β€” select another repository. you can use either OWNER/REPO or GROUP/NAMESPACE/REPO. the full URL or Git URL is also accepted 🌐 (flexible? we love her)

✨ EXAMPLE ✨

here's how the girlies actually run it πŸ’…:

glab variable get VAR_KEY
glab variable get -g GROUP VAR_KEY
glab variable get -s SCOPE VAR_KEY

# Read the project, then its parent groups, then the instance
glab variable get --inherited VAR_KEY

✨ SEE ALSO ✨


πŸ¦‹ and that's the page!! go get those variables, bestie, you're literally gonna slay it ✨

auto generated by spf13/cobra Β· Nov 2026 Β· glab(1) β€” mwah, xoxo πŸ’‹

πŸ“¦ where this page comes from