GitHub/Codespace/Q/How can I rename my GitHub Codespace from within the codespace?
Properties
- logseq-entity
- Logseq/Entity/Question
How can I rename my GitHub Codespace from within the codespace?
AI Answer
- Answer/Official from Renaming a codespace - GitHub Docs
- Short answer: Use the
ghCLI (pre-installed and pre-authenticated in every codespace) to change the display name from a terminal inside the codespace. - Command:
- How it works:
$CODESPACE_NAMEis an environment variable automatically set inside every GitHub/Codespace to its permanent machine name (e.g.literate-space-parakeet-w5vg5ww5p793g7g9).- The
-d/--display-nameflag sets the human-readable label shown in the GitHub UI andgh codespace list. - Only the display name can be changed; the permanent name is fixed at creation time.
- Steps:
- Shorter alias:
gh cs edit -c $CODESPACE_NAME -d 'My New Name' - Alternative (outside the codespace): rename via github.com/codespaces → kebab menu → Rename, or with
gh codespace listto find the permanent name and thengh codespace edit.