Skip to content
Use sandboxesRun a sandbox
Use sandboxes

Run a sandbox

Start a cell, run a command in it, and put it to sleep when you finish. A cell is the API name for a sandbox.

These examples use the heli helper from API keys.

Start a cell

Open trial setup if your account needs a compute plan. Open Agent setup and select Prepare API project. Use its project name in the first request. Pick a unique sandbox name.

Terminal
heli /v1/cells -H 'Content-Type: application/json' \
  -d '{"name":"api-demo","project":"YOUR_PROJECT","wait":true}'

Wait until the cell starts before running a command. If the response says queued, run heli /v1/fleet/cells/api-demo to check its state. Substitute your sandbox name if you changed it.

Run a command

Terminal
heli /v1/cells/api-demo/exec -H 'Content-Type: application/json' \
  -d '{"argv":["uname","-s"]}'

Look for Linux in stdout and 0 in rc.

Put it to sleep

Put the sandbox to sleep when you finish. Sleep preserves the cell’s files. Open the cell in Sandboxes when you need it again.

Terminal
heli /v1/cells/api-demo/sleep -X POST

Talk to an agent, read output, manage a cell

Verify the cell name before permanent removal.