GH-CODESPACE-VIEW(1)

πŸ’… gh-codespace-view β€” bestie's guide to peeking at a codespace

okay so. this is gh-codespace-view, straight out of the GitHub CLI manual, and it's literally the command you run when you want the ✨details✨ about a codespace. not spawning one, not deleting one β€” just looking. it's giving "let me check on my baby" energy πŸŽ€.


🌸 NAME 🌸

gh-codespace-view β€” View details about a codespace πŸ‘‘

like, all the deets. the tea. the whole vibe check on that one codespace. 🫢


✨ SYNOPSIS ✨

gh codespace view [flags]

that's it. that's the whole thing. no positional args, just vibes and flags πŸ’…


🎯 OPTIONS 🎯

okay so here's where it gets juicy. every single flag, coming right up:

  • -c, --codespace <string> β€” Name of the codespace. this is how you point at which one you're obsessed with rn πŸŽ€
  • -q, --jq <expression> β€” Filter JSON output using a jq expression. you get to say "no, bestie, only these fields" and jq does the slaying πŸ”₯
  • --json <fields> β€” Output JSON with the specified fields. pick your faves from the list below, it's like a build-your-own output situation 🌈
  • -R, --repo <string> β€” Filter codespace selection by repository name (user/repo). narrowing it down by repo, iconic behavior πŸ’œ
  • --repo-owner <string> β€” Filter codespace selection by repository owner (username or org). same energy but by whoever owns the thing πŸ‘‘
  • -t, --template <string> β€” Format JSON output using a Go template; see gh help formatting. custom output, main character formatting energy ✨

πŸ¦‹ JSON FIELDS πŸ¦‹

these are the fields you can ask for. all of them. every last one, no cap πŸ’€βœ¨

billableOwner, createdAt, devcontainerPath, displayName, environmentId, gitStatus, idleTimeoutMinutes, lastUsedAt, location, machineDisplayName, machineName, name, owner, prebuild, recentFolders, repository, retentionExpiresAt, retentionPeriodDays, state, vscsTarget

that's twenty fields, bestie. twenty. choose wisely 🀭


πŸ’€ EXIT CODES πŸ’€

when the command finishes, it tells you how it went. this matters, fr fr:

  • 0: Successful execution β€” slay, it worked πŸ’–
  • 1: Error β€” something went sideways 😭
  • 2: Command canceled β€” u backed out, no judgment 🫢
  • 4: Authentication required β€” u gotta log in first, bestie πŸ™ˆ
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. πŸ‘ˆ like, check the specific command's help if you need more deets.

🌺 EXAMPLE 🌺

here are the literal examples, copied exactly, because I would never mess with your commands πŸ’…

# Select a codespace from a list of all codespaces you own
$ gh cs view

# View the details of a specific codespace
$ gh cs view -c codespace-name-12345

# View the list of all available fields for a codespace
$ gh cs view --json

# View specific fields for a codespace
$ gh cs view --json displayName,machineDisplayName,state

the first one? interactive picker energy. the second one? you already know which codespace. the third? lists every field for you. the fourth? cherry-picked fields, chef's kiss πŸ“


🧚 SEE ALSO 🧚

  • gh-codespace(1) β€” the big one. go read it if you want the whole codespace cinematic universe 🌈⭐

πŸ’œ sign-off πŸ’œ

k bye bestie, this page was brought to you by GitHub CLI v2.102.0, dated Oct 2026 β€” go check on your codespaces, they miss you πŸŽ€βœ¨

πŸ“¦ where this page comes from