GH-CODESPACE-CREATE(1) GitHub CLI manual GH-CODESPACE-CREATE(1)

# [NAME](#NAME)

gh-codespace-create - Create a codespace

# [SYNOPSIS](#SYNOPSIS)

**gh codespace create \[flags]**

# [OPTIONS](#OPTIONS)

[**-b**, **--branch** **&lt;string&gt;**](#b)

Repository branch

[**--default-permissions**](#default_permissions)

Do not prompt to accept additional permissions requested by the codespace

[**--devcontainer-path** **&lt;string&gt;**](#devcontainer_path)

Path to the devcontainer.json file to use when creating codespace

[**-d**, **--display-name** **&lt;string&gt;**](#d)

Display name for the codespace (48 characters or less)

[**--idle-timeout** **&lt;duration&gt;**](#idle_timeout)

Allowed inactivity before codespace is stopped, e.g. "10m", "1h"

[**-l**, **--location** **&lt;string&gt;**](#l)

Location: {EastUs|SouthEastAsia|WestEurope|WestUs2} (determined automatically if not provided)

[**-m**, **--machine** **&lt;string&gt;**](#m)

Hardware specifications for the VM

[**-R**, **--repo** **&lt;string&gt;**](#R)

Repository name with owner: user/repo

[**--retention-period** **&lt;duration&gt;**](#retention_period)

Allowed time after shutting down before the codespace is automatically deleted (maximum 30 days), e.g. "1h", "72h"

[**-s**, **--status**](#s)

Show status of post-create command and dotfiles

[**-w**, **--web**](#w)

Create codespace from browser, cannot be used with --display-name, --idle-timeout, or --retention-period

# [EXIT CODES](#EXIT_CODES)

0: Successful execution

1: Error

2: Command canceled

4: Authentication required

NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

# [SEE ALSO](#SEE_ALSO)

[**gh-codespace(1)**](/man/os/gh/gh-codespace.1)

Oct 2026

---

Document: gh-codespace-create(1) from gh 2.103.0-r0 (Chainguard OS)
Source: https://github.com/cli/cli
