sandbox-stable

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

2.8k|267|Updated Dec 10, 2025
One-click install
npx skills add https://github.com/cloudflare/skills --skill sandbox-stable
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sandbox-stable
Source: https://github.com/cloudflare/skills/tree/main/skills/sandbox-stable
Command: npx skills add https://github.com/cloudflare/skills --skill sandbox-stable

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @cloudflare/sandbox.

What problem does it solve?

Teams maintaining Cloudflare Sandbox applications on the stable @cloudflare/sandbox package risk mixing incompatible APIs from the 1.0 preview (@next) line, using deprecated transports, or mismatching Worker packages with container images. This Skill acts as a gate, contract, and retrieval map to keep stable-line apps correct.

Core Features & Use Cases

  • Package Line Gating: Verifies the npm dependency and container image both match the stable line, and redirects to sandbox-next or sandbox-migrate-to-next when appropriate.
  • Stable API Contract: Enforces correct usage of exec, startProcess, execStream, sessions, terminal, tunnels, and RPC transport while blocking @next-only APIs like process.output().
  • Documentation Retrieval Map: Routes every task—commands, files, ports, backups, terminals, production deployment, deprecated-API cleanup—to the exact official docs page.
  • Use Case: A developer maintaining an existing Sandbox app needs to add background processes and clean up deprecated HTTP transports without migrating to 1.0; this Skill confirms the stable line, points to the Commands API docs, and walks through the 2026 deprecation guide.

Quick Start

Ask the agent to help you add a streaming command or clean up deprecated APIs in your existing Cloudflare Sandbox app that uses 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; it resolves when the command finishes with buffered stdout, stderr, and exitCode. For long-running or streaming work, use the stable startProcess and execStream APIs, not the @next single-handle model.

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

The stable default npm package uses exec, startProcess, execStream, and sandbox.terminal APIs, while @next (1.0 preview) introduces argv-style commands and process.output() handles. Never mix a stable Worker package with a next container image or apply @next APIs on stable.

Can I use sandbox.terminal for browser terminals on the stable 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 Sandbox APIs without migrating to 1.0?

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

When should I migrate from stable Sandbox to @cloudflare/sandbox@next?

Migrate when your team is ready for the 1.0 preview or starting a new project, using the sandbox-migrate-to-next skill for ports or sandbox-next for new builds. Do not force the cutover unprompted or half-apply preview APIs on a stable package.