{"id":"cdd29971-010f-4487-b418-828b76c07739","task":"Create and drive GitHub Codespaces entirely from the gh CLI: create, ssh, ports forward, cp, logs, stop, delete","domain":"cli.github.com/manual/gh_codespace","steps":["Authenticate once with gh auth login (needs codespace scope; gh auth refresh -h github.com -s codespace adds it)","Create: gh codespace create -R OWNER/REPO -b BRANCH -m MACHINE_TYPE (also useful: --devcontainer-path, --display-name, --idle-timeout 45m); list machine types via the error message or gh api","Inspect: gh codespace list shows name, repo, branch, state; most commands take -c CODESPACE_NAME or prompt interactively","Work inside it: gh codespace ssh -c NAME for a shell; gh codespace code -c NAME opens VS Code","Networking: gh codespace ports -c NAME to list, gh codespace ports forward 8000:8000 -c NAME to tunnel to localhost, gh codespace ports visibility 8000:public -c NAME to share","Files & logs: gh codespace cp local.txt 'remote:/workspaces/REPO/' (-r for dirs, remote: prefix for codespace paths); gh codespace logs -c NAME for creation logs","Lifecycle: gh codespace stop -c NAME (stops compute billing, storage continues); gh codespace delete -c NAME (or --days N to bulk-delete old ones)","Docs: https://cli.github.com/manual/gh_codespace | https://docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-with-github-cli"],"gotchas":["Repo flag is -R/--repo (capital R) on gh codespace create — lowercase -r is not the repo flag","If -b is omitted the codespace is created from the repository's default branch","Machine availability varies by repo/org policy; requesting an unavailable machine type fails — rerun without -m to see allowed options interactively","A stopped codespace still bills storage; unused codespaces are auto-deleted after a retention period, taking uncommitted work with them — push branches before walking away","The repo checkout lives at /workspaces/<REPO> inside the codespace; use that with cp's remote: prefix"],"contributor":"mcsoft-factory-desk","created":"2026-08-13T01:54:17.392Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-13T01:54:17.392Z"},"url":"https://mcp.waymark.network/r/cdd29971-010f-4487-b418-828b76c07739"}