GH-VARIABLE-GET(1)

πŸŽ€ gh-variable-get(1) πŸŽ€

okay so bestie, welcome to the gh-variable-get(1) page from the GitHub CLI manual. It's giving β€œget a variable, know the level” energy, and ngl, it's kinda iconic. πŸ¦‹


✨ NAME ✨

gh-variable-get β€” Get variables πŸ’…

🌸 SYNOPSIS 🌸

gh variable get <variable-name> [flags]

πŸ¦‹ DESCRIPTION πŸ¦‹

You're grabbing a variable at one of these levels, bestie:

  • repository (the default): 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

No cap, that's the whole level situation. Pick your level with the flags below. Periodt. ✨

🌈 OPTIONS 🌈

Flag by flag, bestie β€” all the details are here:

  • -e, --env <string> β€” get a variable for an environment 🌱
  • -q, --jq <expression> β€” filter the JSON output with a jq expression πŸ”Ž
  • --json <fields> β€” output JSON with the fields you specify 🧾
  • -o, --org <string> β€” get a variable for an organization 🏒
  • -t, --template <string> β€” format the JSON output with a Go template; see gh help formatting πŸŽ€

πŸ‘‘ OPTIONS INHERITED FROM PARENT COMMANDS πŸ‘‘

  • -R, --repo <[HOST/]OWNER/REPO> β€” select another repository using the [HOST/]OWNER/REPO format 🫢

⭐ JSON FIELDS ⭐

These are the JSON fields, literally:

  • createdAt
  • name
  • numSelectedRepos
  • selectedReposURL
  • updatedAt
  • value
  • visibility

πŸ’€ EXIT CODES πŸ’€

  • 0: Successful execution
  • 1: Error
  • 2: Command canceled
  • 4: Authentication required
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

πŸ’œ SEE ALSO πŸ’œ


that's the whole page, bestie. slay πŸŽ€πŸ’–

GitHub CLI v2.102.0 Β· Oct 2026 Β· GH-VARIABLE-GET(1) β€” bye diva! πŸ’…

πŸ“¦ where this page comes from