GH-CODESPACE-DELETE(1)

πŸ’… gh-codespace-delete β€” bestie's guide to yeeting codespaces

okay so this is from the GitHub CLI manual (yes, that one 🫢), and it's the page for gh-codespace-delete β€” the command that literally deletes codespaces. clean slate energy. ✨


πŸŽ€ SYNOPSIS

gh codespace delete [flags]

that's it. that's the whole vibe. flags do all the heavy lifting, iykyk.


πŸ’– DESCRIPTION

so basically, you delete codespaces based on selection criteria β€” like, you pick which ones get the axe. πŸ’€

here's the tea on what you can do:

  • delete all the codespaces belonging to the authenticated user
  • or delete codespaces for a specific repository
  • or, alternatively, delete only the codespaces that are older than N days

and one more thing πŸ‘‘ β€” organization administrators may delete any codespace billed to the organization. yes, any. admin main character energy, fr fr.


✨ OPTIONS ✨

  • --all β€” delete all the codespaces. all of them. every single one. 🧹
  • -c, --codespace <string> β€” the name of the codespace. so you can be all "just this one, thanks πŸ’…"
  • --days <N> (default 0) β€” delete codespaces older than N days. the little default of 0 is just sitting there, doing its thing.
  • -f, --force β€” skip the confirmation prompt for codespaces that contain unsaved changes. 🫣 lowkey dangerous but okay bestie, go off. that confirmation exists for a reason β€” it's the "hey you're about to lose your work" check β€” so this flag is you saying "I know, I'm sure."
  • -o, --org <login> β€” the login handle of the organization. admin-only, so don't come for this flag unless you're built for it. πŸ”₯
  • -R, --repo <string> β€” filter codespace selection by repository name, in user/repo form. specify exactly like that: user/repo.
  • --repo-owner <string> β€” filter codespace selection by repository owner (username or org). different from --repo, don't mix them up, k? πŸ™ˆ
  • -u, --user <username> β€” the username to delete codespaces for. this one is used with --org, so that's the pairing. 🫢

🌈 EXIT CODES

like, what the exit code is telling you:

  • 0 β€” successful execution ✨ slay, it worked
  • 1 β€” error 😭 something went off
  • 2 β€” command canceled πŸ™…β€β™€οΈ you (or someone) backed out
  • 4 β€” authentication required πŸ” like, log in first bestie
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. always double check, no cap.

πŸ¦‹ SEE ALSO

  • gh-codespace(1) β€” the parent codespace page. go read it, it's giving essential context πŸ’œ

that's the whole page, bestie! πŸŽ€ this was GitHub CLI v2.102.0, dated Oct 2026 β€” so like, very current, very iconic. go forth and delete responsibly. --force is not your friend unless you mean it. periodt. πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from