sandbox-next

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

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

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 line) changed core APIs—exec now takes argv arrays and returns process handles instead of finished results—so code written from memory or stable-line docs breaks. This Skill gates the package line, enforces the new API contract, and routes you to the correct preview documentation before you write code. ## Core Features & Use Cases - Package-line gate: Verifies the npm dependency and container image are both on @next, and redirects stable apps to sandbox-stable or migrations to sandbox-migrate-to-next. - API contract enforcement: Codifies non-negotiables such as argv-based exec, handle methods (output(), waitForExit(), kill()), per-launch cwd/env, and no implicit shell. - Documentation retrieval map: Maps each task (processes, terminals, interpreter, lifecycle, errors) to the exact preview docs page, plus a quick API reference and examples index in references/. - Use Case: You are building a Worker that runs Python code in an isolated container. The Skill confirms you are on @next, gives you the correct getSandbox/exec/output pattern, and points you to the interpreter docs before you implement. ## Quick Start Ask the assistant to scaffold a Cloudflare Worker that executes a Python snippet in a sandbox using the @cloudflare/sandbox@next SDK.

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(), or waitForExit() rather than expecting a finished result.

What changed in Cloudflare Sandbox SDK 1.0 preview versus stable?

The preview replaces string-based exec completion with argv-based exec returning process handles, removes session execution and sandbox.terminal(request), and drops gitCheckout on core. Stable apps should keep using the stable package or migrate via the documented migration path.

Can I mix the @next npm package with a stable container image?

No. The npm dependency and container image must be on the same line, for example @cloudflare/sandbox@next with cloudflare/sandbox:next. Mixing lines causes API mismatches, and the skill instructs you to stop and align both before writing code.

Why doesn't my shell syntax work in sandbox exec?

There is no implicit shell in the preview SDK, so pipes and redirects in a plain argv list fail. Invoke a shell explicitly, for example ["/bin/bash", "-lc", script], and remember each exec is independent so cd and export do not persist between launches.

How do I handle interactive terminal sessions in the sandbox?

Process handles have no stdin, so interactive use requires terminals created with createTerminal and connected via connect. Terminal and process IDs belong to the current container only, so store the full job definition rather than relying on IDs across container replacement.