Create a workspace
Create a workspace in Codesphere.
Specify a (private) git repository or start an empty workspace. Environment variables can be set to initialize the workspace with a specific environment. The command will wait for the workspace to become running or a timeout is reached.
To decide which plan suits your needs, run 'cs list plans'
cs create workspace [flags]
# Create an empty workspace, using plan 20
$ cs create workspace my-workspace -p 20
# Create a workspace with a publicly exposed development domain
$ cs create workspace my-workspace --public-dev-domain=false
# Create a workspace from a git repository
$ cs create workspace my-workspace -r https://github.com/codesphere-cloud/landingpage-temp.git
# Create a workspace and set environment variables
$ cs create workspace my-workspace -r https://github.com/codesphere-cloud/landingpage-temp.git -e DEPLOYMENT=prod -e A=B
# Create a workspace and connect to VPN myVpn
$ cs create workspace my-workspace -r https://github.com/codesphere-cloud/landingpage-temp.git --vpn myVpn
# Create a workspace and wait 30 seconds for it to become running
$ cs create workspace my-workspace -r https://github.com/codesphere-cloud/landingpage-temp.git --timeout 30s
# Create a workspace from branch 'staging'
$ cs create workspace my-workspace -r https://github.com/codesphere-cloud/landingpage-temp.git -b staging
# Create a workspace from a private git repository
$ cs create workspace my-workspace -r https://github.com/my-org/my-private-project.git -P
--base-image string Base image to use for the workspace, e.g. 'ubuntu-24.04'
-b, --branch string branch to check out
-e, --env stringArray Environment variables to set in the workspace in key=value form (e.g. --env DEPLOYMENT=prod)
-h, --help help for workspace
-p, --plan int Plan ID for the workspace (default 8)
-P, --private Use private repository
--public-dev-domain Whether to create enable a public development domain (defaults to the public api default)
-r, --repository string Git repository to create the workspace from
--timeout duration Time to wait for the workspace to start (e.g. 5m for 5 minutes) (default 10m0s)
--vpn string Vpn config to use
-a, --api string URL of Codesphere API (can also be CS_API)
-t, --team int Team ID (relevant for some commands, can also be CS_TEAM_ID) (default -1)
-v, --verbose Verbose output
-w, --workspace int Workspace ID (relevant for some commands, can also be CS_WORKSPACE_ID) (default -1)
- cs create - Create codesphere resource