gh codespace create --repo owner/repo --branch main

Category: GitHub CLI

gh codespace create --repo owner/repo --branch main

Create a codespace for a repo and branch

Provisions a new codespace, a cloud-hosted dev environment, for owner/repo on branch main. Codespaces run in a container configured by devcontainer.json. The machine type defaults sensibly; tune it with --machine.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.