# Sandbox

URL: https://docs.hanzo.ai/docs/cli/sandbox

> The `hanzo sandbox` commands.

Also for this capability: [API](https://docs.hanzo.ai/docs/openapi/sandbox) · **CLI** · [MCP](https://docs.hanzo.ai/docs/mcp-tools/sandbox) · [SDKs](https://docs.hanzo.ai/docs/sdks)

The ONE compute primitive: a sandbox is a gVisor pod that runs somebody else's code, and every lifetime is the same object.

[API reference →](https://docs.hanzo.ai/docs/openapi/sandbox)

```bash
hanzo sandbox list
```

Every command takes `--json` for the raw response and `--help` for its own flags. Sign in once with `hanzo auth login`; the commands below use that session, and the org they act in is the one it carries.

| Command                     | What it does                                                                                                  |
| --------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `hanzo sandbox create`      | Leases a sandbox — a real computer — for the caller's org.                                                    |
| `hanzo sandbox end`         | End a sandbox and release it                                                                                  |
| `hanzo sandbox exec <id>`   | Runs one command in a sandbox the caller holds and answers with its exit code, stdout and stderr.             |
| `hanzo sandbox get <id>`    | Returns one sandbox: its class, project, image, the runtime it was given, its status and when its lease ends. |
| `hanzo sandbox lease`       | Lease a sandbox — a real computer — or resume one you hold                                                    |
| `hanzo sandbox list`        | Lists the sandboxes the caller holds, newest first.                                                           |
| `hanzo sandbox pause <id>`  | Stops the pod, keeps the row and the volume, and settles the tail: POST /v1/sandbox/:id/pause.                |
| `hanzo sandbox read`        | Read a file from a sandbox you hold                                                                           |
| `hanzo sandbox resume <id>` | Gives a parked sandbox a pod again: POST /v1/sandbox/:id/resume.                                              |
| `hanzo sandbox rm <id>`     | Ends a sandbox and releases the compute behind it.                                                            |
| `hanzo sandbox run`         | Run a command in a sandbox you hold and read its output                                                       |
| `hanzo sandbox stop`        | Stop what a sandbox is running, and keep the sandbox                                                          |
| `hanzo sandbox write`       | Write a file into a sandbox you hold                                                                          |

### FS

| Command                        | What it does                     |
| ------------------------------ | -------------------------------- |
| `hanzo sandbox fs create <id>` | Write a file                     |
| `hanzo sandbox fs get <id>`    | Read a file, or list a directory |

### Screen

| Command                            | What it does                                                       |
| ---------------------------------- | ------------------------------------------------------------------ |
| `hanzo sandbox screen get <id>`    | The screen, as a page                                              |
| `hanzo sandbox screen ticket <id>` | Mints a short-lived grant to open the screen of a desktop sandbox. |
| `hanzo sandbox screen ws <id>`     | The screen, as a socket                                            |

### Terminal

| Command                              | What it does                                               |
| ------------------------------------ | ---------------------------------------------------------- |
| `hanzo sandbox terminal get <id>`    | The terminal, as a page                                    |
| `hanzo sandbox terminal ticket <id>` | Mints a short-lived grant to open a terminal on a sandbox. |
| `hanzo sandbox terminal ws <id>`     | The terminal, as a socket                                  |
