Skip to main content

Run a command

Responses include stdout, stderr, and exit code. Options: A command that exceeds its timeout raises CommandTimeoutError in the SDK. For work that should outlive the request, use a background job.

Background jobs

Background jobs keep running in the sandbox, independent of the command connection, while you poll for completion. They persist until they finish or the sandbox terminates.
Make sure the sandbox timeout is long enough for the job, or set it negative for no deadline.

SSH

Open an interactive shell in a running sandbox:
The CLI generates an ephemeral key pair, creates a session, and connects automatically. The session is revoked and the key deleted on disconnect. OpenSSH (ssh) must be installed locally, and the sandbox must be RUNNING. By default you get a /bin/sh login shell as the sandbox’s default user in its working directory. Only interactive shells and remote commands are supported: port forwarding (-L/-R), agent forwarding, scp, and sftp are not. Use file transfers to move files.
SSH sessions do not count as activity for the idle timeout, so a sandbox with an open SSH connection can still be shut down.