Skip to content

CLI reference

ry sandbox

Markdown

Short-lived machines for one task each - created from a template, removed at their deadline.

ry sandbox [options] [command]

Create a sandbox from build:<id> or app:<name> and wait until it runs.

ry sandbox create [options] <template>

Options:

  • --ttl <duration>: How long it lives, e.g. 10m, 2h (default 5m, at most 24h).
  • --cpus <n>: vCPUs (default 1).
  • --memory <mb>: Memory in MB (default 512).
  • --port <port>: A further port reachable as https://<port>-<id>… (repeatable, at most 8).
  • -e, --env <KEY=VALUE>: Environment of the sandbox (repeatable) - nothing is inherited from the template app.
  • --public: Make its URLs public (default: only with a token signed by your org).
  • --readiness <boot|port>: Up when the VM boots (default) or when its port answers.
  • --idle <duration>: Sleep after this much idle time (default 5m).
  • --egress <mode>: Outbound network: allow-all (default), deny-all (nothing, not even DNS) or allowlist.
  • --allow <domain|cidr>: With an allowlist: a domain (api.example.com, *.example.com) or IPv4 range reachable on 80/443 (repeatable, implies –egress allowlist).

Example:

ry sandbox create app:web --ttl 30m

The org’s sandboxes that run (with –all: also the ended ones of the last 14 days).

ry sandbox list [options]

Options:

  • --all: Include ended sandboxes.

Example:

ry sandbox list
ry sandbox list --all

One sandbox: state, deadline, URLs, machine.

ry sandbox show [options] <id>

Example:

ry sandbox show sbx-1a2b3c4d5e6f

Run one command in a sandbox and exit with its exit code (the command goes after –).

ry sandbox exec [options] <id> -- <command> [args...]

Options:

  • --timeout <seconds>: Stop the command after this many seconds (default 60, at most 290; exit code 124).
  • --dir <path>: Working directory in the sandbox (absolute).
  • -e, --env <KEY=VALUE>: Env for this command only (repeatable).

Example:

ry sandbox exec sbx-1a2b3c4d5e6f -- uname -a

Set a sandbox’s deadline to now + duration (e.g. 30m) - like E2B setTimeout.

ry sandbox timeout [options] <id> <duration>

Example:

ry sandbox timeout sbx-1a2b3c4d5e6f 1h

End a sandbox now - its machine and everything on its disk are gone.

ry sandbox kill [options] <id>

Options:

  • -y, --yes: Skip confirmation (required for automation).

Example:

ry sandbox kill sbx-1a2b3c4d5e6f