sandbox-next

Build Cloudflare Sandbox apps on the @cloudflare/sandbox@next 1.0 preview SDK.

Updated Mar 25, 2026
One-click install
npx skills add https://github.com/lettucebo/Skills --skill sandbox-next-lettucebo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sandbox-next
Source: https://github.com/lettucebo/Skills/tree/main/skills/cloudflare/sandbox-next
Command: npx skills add https://github.com/lettucebo/Skills --skill sandbox-next-lettucebo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @cloudflare/sandbox, and includes references (resource) components.

What problem does it solve? It prevents API misuse when building Cloudflare Sandbox applications on the @cloudflare/sandbox@next (1.0 preview) line, where process execution, terminals, and interpreter APIs differ significantly from the stable package. ## Core Features & Use Cases - Package Line Gate: Verifies the npm dependency and container image both match the @next preview line before writing code, and redirects to sandbox-stable or sandbox-migrate-to-next when appropriate. - API Contract Enforcement: Documents non-negotiable behaviors such as argv-based exec returning process handles, no implicit shell, per-launch cwd/env, and no process stdin. - Documentation Retrieval Map: Routes each task (processes, terminals, interpreter, lifecycle, errors, files, mounts, tunnels) to the correct official preview documentation page. - Use Case: When building a Worker that runs Python code in an isolated container, use this Skill to correctly call sandbox.exec with an argv list, collect results via process.output(), and avoid inventing removed stable APIs. ## Quick Start Ask the AI to create a Cloudflare Worker using @cloudflare/sandbox@next that executes a Python command in a sandbox and returns its stdout and exit code.

Frequently Asked Questions about sandbox-next

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I execute a command in a Cloudflare Sandbox with the @next SDK?▼

Call sandbox.exec with an argv array like ["python3", "-c", "print(2+2)"], which resolves when the process starts and returns a handle. Collect results with handle methods such as output(), waitForExit(), or kill().

What is the difference between sandbox-next and sandbox-stable?▼

sandbox-next targets the @cloudflare/sandbox@next 1.0 preview line with new process, terminal, and interpreter APIs, while sandbox-stable covers the default stable package. Never mix an @next Worker package with a stable container image.

Does sandbox.exec run shell commands like pipes and redirects?▼

No, there is no implicit shell in the @next SDK. Shell syntax requires an explicit shell invocation such as ["/bin/bash", "-lc", script] passed as the argv list.

Why does my sandbox process not receive stdin input?▼

Process handles in the @next SDK have no stdin support. For interactive input, create a terminal with createTerminal and connect to it, which provides a full PTY with write and resize methods.

Can I migrate an existing stable Sandbox app to the @next preview?▼

Yes, but only when explicitly requested, using the sandbox-migrate-to-next skill and the official migration guide. The @next line removes stable APIs like gitCheckout on core, string-exec completion, and session execution.