Loading...
Loading...
Use when building or changing Cloudflare Sandbox apps on @cloudflare/sandbox@next (Sandbox SDK 1.0 preview)—code execution, AI runners, interpreters, CI-like jobs, terminals, files, mounts, tunnels, preview URLs, lifecycle, or errors. Not for the default stable package (use sandbox-stable) or for porting stable to @next (use sandbox-migrate-to-next).
npx skill4agent add cloudflare/skills sandbox-next@next@nextsandbox-stablesandbox-migrate-to-next| Check | Must match |
|---|---|
| npm dependency | |
| Container image | Same line (e.g. |
| If you find… | Action |
|---|---|
Default | Stop. Load |
User wants to port stable → | Stop. Load |
| Self-deployed bridge only | Bridge is not on the 1.0 preview line yet. Keep bridge on stable package + image. Bridge (stable) |
@nextsandbox.exec(argv)output()logs()waitForExit()waitForPort()waitForLog()kill(signal?)["/bin/bash", "-lc", script]cdexportexeccwdenvcreateTerminalconnecttimeoutAbortSignalkillexectimeoutgetProcesslistProcessesgetTerminallistTerminalsnull[]setEnvVarsenvgitCheckoutexecsandbox.terminal(request)import { getSandbox, proxyToSandbox, Sandbox } from "@cloudflare/sandbox";
export { Sandbox };
const sandbox = getSandbox(env.Sandbox, "user-123");
const process = await sandbox.exec(["python3", "-c", "print(2 + 2)"]);
const result = await process.output({ encoding: "utf8" });
// result.stdout, result.exitCodenext@next| You need to… | Open |
|---|---|
| Orient / choose preview | 1.0 preview overview |
| First Worker, wrangler, Dockerfile | Get started |
| Process execution |
| Process API signatures | Processes API |
| Sandbox ID vs container vs sleep/destroy | Lifecycle |
| Environment |
| Interactive PTY / browser terminal | Terminals · Terminals API |
| Python/JS code interpreter | Interpreter · Interpreter API |
| Extensions model | Extensions |
| Error classes and recovery | Errors · Errors API |
| Common failures | Troubleshooting |
| API hub | API reference |
Files, mounts, backups, ports, tunnels, | Main docs for shared surfaces (ignore stable-only session/transport/ |
| Example apps | examples on |
| Still on stable package | |
| Porting an existing stable app | |
@next@next