sandbox-next

Build and maintain Cloudflare Sandbox apps on the @cloudflare/sandbox@next SDK preview line.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/julianckt/adoptarun --skill sandbox-next-julianckt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sandbox-next
Source: https://github.com/julianckt/adoptarun/tree/main/.agents/skills/sandbox-next
Command: npx skills add https://github.com/julianckt/adoptarun --skill sandbox-next-julianckt

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Cloudflare's Sandbox SDK 1.0 preview (@next) introduces breaking API changes versus the stable package, and mixing package lines or relying on outdated knowledge causes runtime failures. This Skill gates your work on the correct package line, enforces the non-negotiable API contract, and routes you to the right documentation before you write code. ## Core Features & Use Cases - Package-line gate: Verifies the npm dependency and container image both match the @next preview line, and redirects stable apps to sandbox-stable or migrations to sandbox-migrate-to-next. - API contract enforcement: Codifies the new exec/handle model—argv-based exec returning process handles, explicit shells, per-launch cwd/env, no stdin on handles, and correct timeout/kill semantics. - Documentation retrieval map: Maps each task (processes, terminals, interpreter, lifecycle, environment, errors) to the exact preview docs page, with a quick-reference file and examples index. - Use Case: You are building a Worker that runs Python code in an isolated Cloudflare container. The Skill confirms you are on @cloudflare/sandbox@next, shows the minimal getSandbox/exec/output pattern, and points you to the interpreter and errors docs before shipping. ## Quick Start Ask the assistant to build a Cloudflare Worker that executes a Python script inside a sandbox using the @cloudflare/sandbox@next package and return the script's stdout.

Frequently Asked Questions about sandbox-next

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

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

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

What is the difference between Cloudflare Sandbox stable and @next?

The @next line is the 1.0 preview with a new exec/handle API, while the default package is the stable line. Never mix an @next Worker package with a stable container image; stable apps should use the sandbox-stable skill instead.

How do I migrate a Cloudflare Sandbox app from stable to @next?

Use the sandbox-migrate-to-next skill for porting stable apps to the preview line. The sandbox-next skill explicitly stops and redirects to that migration skill rather than applying preview APIs to a stable codebase.

Why does my sandbox exec not see environment variables or cd from a previous command?

Each exec launch is independent, so cd and export from one call are not visible to the next. Pass cwd and env per launch, set sandbox-level variables with setEnvVars, or run one shell script via ["/bin/bash", "-lc", script].

Can I send stdin to a running sandbox process?

Process handles have no stdin, so interactive input is not possible through exec. For interactive use, create a terminal with createTerminal and connect to it for a full PTY session.

Does timeout or AbortSignal kill a sandbox process?

No. Local wait timeout and AbortSignal only cancel the wait, leaving the remote process running. Use the handle's kill method or exec's remote timeout option to actually terminate the process.