Guides

Work in a cloud workspace

A workspace is a persistent cloud computer for you or your coding agent. Its disk survives; it stops when idle and starts again when you open it.

Workspaces come with Pro and up. Every command below is in the sandscale workspace reference.

1. Pick a template

sandscale workspace templates list

A template is the machine your organization set up: image, size and tools. sandscale workspace templates show NAME lists its parameters.

2. Create it

sandscale workspace create payments-dev --template go-service

--param KEY=VALUE fills in a template’s parameters, if it has any. Building takes a little while the first time; sandscale workspace logs payments-dev shows the build.

3. Open it

sandscale workspace open payments-dev

open starts the workspace if it is stopped, waits until it runs, then connects you over SSH with a short-lived certificate and a checked host key. --terminal opens a terminal instead, and --ide browser opens it in the browser. Editors that connect over SSH use sandscale workspace ssh.

4. Reach its ports

sandscale workspace port-forward payments-dev 3000 5432:5432

Each port listens on 127.0.0.1 on your computer and reaches the workspace through SSH, until you press Ctrl+C. Nothing is opened to the internet.

5. Set a schedule

sandscale workspace schedule start payments-dev "30 8 * * 1-5" --timezone Europe/Berlin
sandscale workspace schedule stop payments-dev 8h

The first starts it at 08:30 on weekdays; the second stops it 8 hours after each start. Your organization’s policy can shorten what you set, and schedule show prints the values in force. A workspace also stops when idle. It uses your plan’s vCPU-hours only while it runs.

6. Stop or delete it

sandscale workspace stop payments-dev
const [ws] = (await sandscale.workspaces.list()).data;
await sandscale.workspaces.stop(ws.id, { region: ws.region });
ws = sandscale.workspaces.list().data[0]
sandscale.workspaces.stop(ws.id, region=ws.region)

Stopping keeps the disk. sandscale workspace delete NAME deletes the workspace and its disks, and may ask you to confirm it is you. The SDKs can list, start, stop and connect to workspaces; creating one is done with the CLI or the console.