GH-CODESPACE-CREATE(1)

✨ gh-codespace-create, the GitHub CLI manual ✨

okay bestie, welcome to the gh-codespace-create page β€” it's the part of the GitHub CLI manual that teaches you how to literally summon a codespace out of thin air 🫢


🌸 NAME 🌸

gh-codespace-create β€” create a codespace πŸ’… (yes that's the whole job and she does it gorgeously)


πŸ¦‹ SYNOPSIS πŸ¦‹

gh codespace create [flags]

that's it. that's the whole vibe. just you, the command, and whatever flags you feel like sprinkling on top ✨


πŸŽ€ OPTIONS πŸŽ€

okay so here's the full menu, no skips, no cuts, all of it πŸ‘‘

  • -b, --branch <string> β€” which repository branch you want, like literally pick a branch bestie 🌿
  • --default-permissions β€” do not prompt you to accept the extra permissions the codespace is asking for, just go with the defaults and keep it moving πŸ™ˆ
  • --devcontainer-path <string> β€” the path to the devcontainer.json file to use when creating the codespace, iykyk 🧚
  • -d, --display-name <string> β€” a display name for your codespace, and it's gotta be 48 characters or less (the limit is real, don't fight it) ⭐
  • --idle-timeout <duration> β€” how long it can sit there doing nothing before the codespace gets stopped, e.g. "10m", "1h" πŸ’€
  • -l, --location <string> β€” the location: {EastUs|SouthEastAsia|WestEurope|WestUs2} β€” and no worries, it's determined automatically if you don't provide it 🌈
  • -m, --machine <string> β€” the hardware specifications for the VM, aka how much machine your machine gets πŸ”₯
  • -R, --repo <string> β€” repository name with owner: user/repo πŸ‘‘
  • --retention-period <duration> β€” allowed time after shutting down before the codespace is automatically deleted (maximum 30 days), e.g. "1h", "72h" β€” like a lil grace period before it's gone gone 😭
  • -s, --status β€” show status of post-create command and dotfiles πŸ“
  • -w, --web β€” create the codespace from the browser, but heads up: cannot be used with --display-name, --idle-timeout, or --retention-period πŸ’€
ngl the --web one is the picky icon of the group β€” she does not share the stage with those three flags, periodt.

πŸ’œ EXIT CODES πŸ’œ

so when the command wraps up, here's what the numbers mean:

  • 0: Successful execution β€” slay, it worked πŸŽ‰
  • 1: Error β€” okay we have a problem 😭
  • 2: Command canceled β€” you (or something) bailed πŸ™ˆ
  • 4: Authentication required β€” you gotta prove who you are first πŸ”
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. (basically, check the receipts, there might be more πŸ‘€)

🌟 SEE ALSO 🌟

  • gh-codespace(1) β€” go hang out with the rest of the codespace family, they're iconic 🫢

and that's the whole page, bestie πŸ’– no cap, you're now a gh-codespace-create expert.

made with love by the GitHub CLI, v2.102.0, dated Oct 2026 πŸŽ€

πŸ“¦ where this page comes from