glab variable get

Get a variable for a project or group.

Synopsis

Prints the value of a single variable by key. Use --scope to select a variable in a specific environment, or --group to read a group variable instead.

By default the command reads one level only. Pass --inherited to fall back to the groups above the project and then to the instance, in the order CI resolves a variable: the project first, then each parent group closest first, then instance variables.

A level that does not define the key, or that you cannot read, is skipped. Instance variables apply to every environment, so --scope does not filter them.

glab variable get <key> [flags]

Examples

console
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

Options

  -g, --group string    Get variable for a group.
      --inherited       If the key is not defined at the selected level, look in the groups above it, then in instance variables.
      --jq string       Filter JSON output with a jq expression.
  -F, --output string   Format output as: text, json. (default "text")
  -s, --scope string    The environment_scope of the variable. Values: all (*), or specific environments. (default "*")

Options inherited from parent commands

  -h, --help          Show help for this command.
  -R, --repo string   Select another repository. You can use either OWNER/REPO or GROUP/NAMESPACE/REPO. The full URL or Git URL is also accepted.