sandbox-stable

Guides building Cloudflare Sandbox apps on the stable @cloudflare/sandbox package.

Updated Oct 15, 2019
One-click install
npx skills add https://github.com/kkkaoru/dotfiles --skill sandbox-stable-kkkaoru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sandbox-stable
Source: https://github.com/kkkaoru/dotfiles/tree/main/.agents/skills-stroage/sandbox-stable
Command: npx skills add https://github.com/kkkaoru/dotfiles --skill sandbox-stable-kkkaoru

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @cloudflare/sandbox.

What problem does it solve? It prevents API mismatches when building or maintaining Cloudflare Sandbox apps on the stable @cloudflare/sandbox package, ensuring commands, sessions, files, ports, tunnels, and terminals use stable APIs rather than @next preview APIs. ## Core Features & Use Cases - Package Line Gate: Verifies the npm dependency and container image both match the stable line before writing code, and redirects to sandbox-next or sandbox-migrate-to-next when appropriate. - Stable API Contract: Enforces correct usage of exec, startProcess, execStream, sessions, sandbox.terminal, and RPC transport while avoiding @next-only APIs like process.output(). - Documentation Retrieval Map: Maps each task (files, ports, tunnels, backups, terminals, production deployment, bridge) to the exact Cloudflare docs page to consult before implementing. - Use Case: When asked to add a browser terminal to an existing Workers app using the default @cloudflare/sandbox package, this Skill confirms the stable line, points to the Terminal API docs, and blocks accidental use of preview createTerminal APIs. ## Quick Start Ask the assistant to add a streaming command feature to your existing Cloudflare Sandbox Worker while staying on the stable @cloudflare/sandbox package.

Frequently Asked Questions about sandbox-stable

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

FAQPage Schema
How do I run commands in a Cloudflare Sandbox on the stable package?

Use await sandbox.exec(command) with a command string, which resolves when the command finishes and returns buffered stdout, stderr, and exitCode. For long-running or streaming work, use the stable startProcess and execStream APIs rather than @next single-handle models.

What is the difference between @cloudflare/sandbox stable and @next?

The stable default npm package uses APIs like exec, startProcess, and sandbox.terminal, while @next is the 1.0 preview with different argv and process.output() handles. Never mix a stable Worker package with a next container image or apply preview APIs on stable.

Can I use browser terminals with the stable Cloudflare Sandbox package?

Yes, interactive browser terminals on stable typically use sandbox.terminal(request) with session and xterm helpers. The preview createTerminal API belongs to @next and should not be used while the dependency is stable.

How do I clean up deprecated Cloudflare Sandbox APIs without migrating?

Update the package and matching image first, then follow the 2026 deprecation guide on the Cloudflare docs. Search for patterns like SANDBOX_TRANSPORT, exposePort(, and execStream( to find deprecated usages; this cleanup does not switch you to @next.

When should I migrate from sandbox stable to the 1.0 preview?

Migrate only when the user explicitly asks to port to 1.0 or @next, using the sandbox-migrate-to-next skill and the official migration guide. Do not force the cutover or half-apply preview APIs on a stable package.