sandbox-migrate-to-next

Migrates Cloudflare Sandbox apps from stable @cloudflare/sandbox to the SDK 1.0 preview.

Updated Aug 10, 2026
One-click install
npx skills add https://github.com/narr07/permadi --skill sandbox-migrate-to-next-narr07
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sandbox-migrate-to-next
Source: https://github.com/narr07/permadi/tree/main/.agents/skills/sandbox-migrate-to-next
Command: npx skills add https://github.com/narr07/permadi --skill sandbox-migrate-to-next-narr07

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @cloudflare/sandbox.

What problem does it solve? Cloudflare Sandbox SDK 1.0 preview introduces breaking API changes—removed sessions, transport settings, string exec, and interpreter methods—so existing apps on the stable @cloudflare/sandbox package need a structured, safe migration path to @cloudflare/sandbox@next. ## Core Features & Use Cases - Guided Migration Workflow: Walks through audit, clarification, upgrade, and validation steps with hard rules preventing common cutover mistakes like mixed Worker/image versions. - Replacement Map: Provides a stable-to-@next API mapping covering exec handles, terminals, interpreters, git operations, and numeric kill signals. - Use Case: You have a production Worker using sandbox.exec("npm test") and session APIs. This Skill audits the codebase with ripgrep patterns, rewrites calls to argv-based exec with process handles, and deploys with --containers-rollout=immediate. ## Quick Start Migrate my Cloudflare Sandbox Worker from the stable SDK to @cloudflare/sandbox@next and update the container image and code accordingly.

Frequently Asked Questions about sandbox-migrate-to-next

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

FAQPage Schema
How do I migrate from @cloudflare/sandbox stable to the 1.0 preview?▼

Install @cloudflare/sandbox@next, switch the Dockerfile to cloudflare/sandbox:next, then replace stable APIs using the migration map: string exec becomes argv-based exec returning a process handle, sessions are removed, and terminals use createTerminal plus connect.

What replaced sandbox.exec string commands in Sandbox SDK 1.0?▼

String exec was replaced by argv-based exec that returns a process handle instead of a buffered result. Call process.output({ encoding: "utf8" }) to get results, and use an explicit shell binary like /bin/bash -lc for shell syntax.

Can I use gradual container rollout when migrating to @next?▼

No. Stable and @next control protocols are incompatible both ways, so gradual rollout leaves a broken mixed window. Production cutover requires a single deploy with wrangler deploy --containers-rollout=immediate.

Does Sandbox SDK 1.0 still support sessions and gitCheckout?▼

No. Default and named sessions are removed; pass cwd and env per launch instead. gitCheckout is also gone—run git commands through argv-based exec, such as git clone with a working directory option.

Why does await sandbox.exec not mean the command finished in @next?▼

In the 1.0 preview, await sandbox.exec only means the process started, not that the command completed. You must await process.output or use waitFor methods to observe completion, and timeouts only cancel the wait, not the process.