GH-VARIABLE-LIST(1)

πŸ’… gh-variable-list(1) β€” the GitHub CLI manual, bestie edition πŸŽ€

Okay so picture this: it's gh-variable-list(1), straight out of the GitHub CLI manual, and she's here to help you list variables. That's it. That's the gig. Let's go ✨


🌸 NAME 🌸

gh-variable-list β€” literally just List variables, no cap 🫢


✨ SYNOPSIS ✨

gh variable list [flags]

Run it, add some flags if you're feeling spicy, and the variables come pouring out. Iconic behaviour honestly πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So you wanna list variables? Say less. You can do it on one of these levels, and you pick which one:

  • repository (this is the default, btw, so if you don't specify anything this is what you get πŸŽ€) β€” available to GitHub Actions runs or Dependabot in a repository
  • environment β€” available to GitHub Actions runs for a deployment environment in a repository
  • organization β€” available to GitHub Actions runs or Dependabot within an organization

Pick your level, get your list. Main character energy all around πŸ‘‘


πŸ”₯ OPTIONS πŸ”₯

  • -e, --env <string> β€” list variables for an environment. string is the environment name, bestie 🌈
  • -q, --jq <expression> β€” filter JSON output using a jq expression. Yes, the jq. She's here. Obsessed πŸ’œ
  • --json <fields> β€” output JSON with the specified fields. You choose the fields, you get the JSON ✨
  • -o, --org <string> β€” list variables for an organization. string is the org, obviously 🏒
  • -t, --template <string> β€” format JSON output using a Go template; see gh help formatting for the deets πŸŽ€

πŸ’– OPTIONS INHERITED FROM PARENT COMMANDS πŸ’–

  • -R, --repo <[HOST/]OWNER/REPO> β€” select another repository using the [HOST/]OWNER/REPO format. That bracket situation is doing a lot of heavy lifting but she's slaying 🫢

⭐ ALIASES ⭐

gh variable ls β€” same energy, shorter spelling. Use whichever, we don't gatekeep πŸ’…


🌟 JSON FIELDS 🌟

Here's the full lineup of fields you can ask for, exactly like this:

createdAt, name, numSelectedRepos, selectedReposURL, updatedAt, value, visibility

That's seven little icons, all accounted for πŸŽ€


🧚 EXIT CODES 🧚

Okay so this is the vibe check for whether things went well β€” memorize these fr fr:

  • 0: Successful execution β€” yay! we ate πŸŽ‰
  • 1: Error β€” something went sideways 😭
  • 2: Command canceled β€” you (or the universe) hit the brakes πŸ›‘
  • 4: Authentication required β€” you gotta log in first, bestie πŸ™ˆ
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. Don't come for me, I'm just the messenger πŸ’€

πŸ“ SEE ALSO πŸ“

gh-variable(1) β€” go say hi to her, she's the parent πŸ’–


And that's the page, bestie! This little masterpiece is brought to you by GitHub CLI v2.102.0, dated Oct 2026 β€” write that down, cite it in your group chat, whatever you need πŸŒΈβœ¨πŸ’…

πŸ“¦ where this page comes from