Skip to main content
This page is a side-by-side comparison, not a full reference — for every parameter, flag, and field, see the CLI Reference, the TypeScript, Python, and Go SDK usage pages, and MCP tools. Every example uses the bonya-dev template and $SANDBOX_ID/$RUN_ID/$SCHEDULE_ID/$PREVIEW_ID/$SNAPSHOT_ID set from a prior call’s response, the same conventions as the Quickstart.

Create a sandbox

Starts a new sandbox from a template. REST returns 202 immediately by default; ?wait=ready blocks until it’s up and returns 201 instead.
MCP: the sandbox_create tool exposes this to any connected agent.

Get and list sandboxes

Reconnect to a sandbox by id, or page through every sandbox in the organization, optionally filtered by state.
MCP: sandbox_get fetches one sandbox; sandbox_list pages through all of them.

Run a command (buffered exec)

One JSON request, one JSON response, no WebSocket. A non-zero exit code is still a 200 — check exit_code in the body.
MCP: the sandbox_exec tool runs a buffered command the same way.

Stream a command (streaming exec)

Get Stdout/Stderr/Exit events as they arrive, instead of waiting for the whole thing to buffer. There’s no REST or CLI equivalent — buffered exec and the WebSocket TTY upgrade are the only wire-level modes; streaming is an SDK-level convenience over the latter.
There’s no MCP tool for this — the MCP server’s sandbox_exec is buffered-only, since streaming output doesn’t fit a request/response tool call.

Managed sessions (create, attach, list, kill)

A named, persistent command that outlives your connection and survives the sandbox suspending and resuming — the counterpart to exec for dev servers and other long-running processes.
MCP: session_create, session_list, and session_kill cover create/list/kill. Attach is a WebSocket upgrade with no request/response shape, so there’s no session_attach tool — an agent can start and stop background work but can’t stream its live output.

Files (read/write/upload/download/list)

Read and write bodies over REST are raw bytes — not tar archives or multipart form data — so each call moves exactly one file.
MCP: fs_read, fs_write, and fs_list cover this (plus fs_stat, fs_mkdir, fs_rename, and fs_delete for the rest of the filesystem surface) — there’s no upload/download tool since MCP tool calls carry inline UTF-8 text, not binary file transfers.

Preview URLs (create/list/delete)

Publishes one guest port at an HTTPS URL a browser can open. Ports must be 1024–65535.
MCP: preview_create, preview_list, preview_get, preview_delete and the preview_grant_* tools cover these. A grant token is shown once, in the response that creates it.

Snapshots

Captures a running sandbox’s disk state. Restore by passing the snapshot id to sandbox create.
cURL
MCP: snapshot_create, snapshot_list, snapshot_get, and snapshot_delete; pass snapshot to sandbox_create to restore.

Jobs (run_job/start_job and language equivalents)

A managed run of a command or script on a new or existing sandbox. run_job/RunJob blocks until it finishes; start_job/StartJob returns a run id immediately for you to poll later. There’s no bonya job CLI command — jobs are reached through REST or an SDK.
MCP: job_create covers both modes — pass wait: true to block for the result or leave it false to get a run_id back immediately, and use job_get/job_list/job_cancel from there.

Job schedules (create/list/trigger)

Wraps a job spec with timing — cron, an interval, or a one-shot future time — so it runs without you calling the job endpoint yourself. There’s no bonya job-schedule CLI command.
MCP: job_schedule_create, job_schedule_list, and job_schedule_trigger cover this (plus job_schedule_get, _update, _pause, and _delete for the rest of the surface).

Templates (list templates)

Lists every template_id/version a create or job call will accept, with metadata like OS and preinstalled language stacks. Not paginated — the catalog is the same for every caller. There’s no bonya template CLI command; bonya create offers the catalog interactively instead.
MCP: the template_list tool exposes the same catalog.

Delete/cleanup a sandbox

Deletion is a synchronous teardown — the call doesn’t return until the sandbox is gone. It’s idempotent: deleting an already-deleted sandbox succeeds rather than erroring.
MCP: the sandbox_delete tool tears down a sandbox the same way, and is likewise idempotent.

CLI Reference

TypeScript SDK

Python SDK

Go SDK

MCP Server