---
name: "gh-codespace-create"
section: "1"
platform: "linux"
package: "github-cli"
version: "2.102.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gh-codespace-create"
---

# gh-codespace-create(1)

Create a codespace

## NAME

gh-codespace-create - Create a codespace

## SYNOPSIS

**gh codespace create \[flags\]**

## OPTIONS

- **-b**, **--branch** **\<string\>**

  Repository branch

- **--default-permissions**

  Do not prompt to accept additional permissions requested by the codespace

- **--devcontainer-path** **\<string\>**

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

- **-d**, **--display-name** **\<string\>**

  Display name for the codespace (48 characters or less)

- **--idle-timeout** **\<duration\>**

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

- **-l**, **--location** **\<string\>**

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

- **-m**, **--machine** **\<string\>**

  Hardware specifications for the VM

- **-R**, **--repo** **\<string\>**

  Repository name with owner: user/repo

- **--retention-period** **\<duration\>**

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

- **-s**, **--status**

  Show status of post-create command and dotfiles

- **-w**, **--web**

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

## 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

**[gh-codespace(1)](/gh-codespace/1.md)**
