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:
- the project first π₯
- then each parent group, closest first π§
- 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 ajqexpression β¨ (for the gworls who like their data sculpted)-F,--output="text"β format the output as:text,jsonπ¦-s,--scope=""β theenvironment_scopeof 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 eitherOWNER/REPOorGROUP/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 β¨
glab-variable(1)β the whole variable family, go say hi π
π¦ 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
- 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