sandbox-migrate-to-next

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @cloudflare/sandbox.

What problem does it solve? Cloudflare Sandbox apps built on the stable @cloudflare/sandbox SDK use APIs (sessions, transport settings, buffered exec, gitCheckout) that are removed or reshaped in the SDK 1.0 preview, and a careless upgrade breaks production because stable and @next control protocols are incompatible. ## Core Features & Use Cases - Guided migration workflow: Audit the codebase with ready-made grep patterns, clarify cutover decisions with the user, upgrade the package and container image, then validate the result. - Replacement map: A stable-to-@next API mapping covering exec handles, terminals, interpreters, sessions, git operations, and kill signals, with code shapes for each area. - Safe production cutover: Enforces matching Worker/image versions and immediate container rollout to avoid a broken mixed-protocol window. - Use Case: You have a Worker using await sandbox.exec("npm test") and named sessions; the skill audits every call site, rewrites them to argv-based exec with process handles, and deploys with --containers-rollout=immediate. ## Quick Start Migrate my Cloudflare Sandbox Worker from the stable @cloudflare/sandbox package to the @next SDK 1.0 preview, auditing my code and updating the package, Dockerfile, and API calls.

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 container image to cloudflare/sandbox:next, then replace removed APIs: exec returns a process handle instead of a buffered result, sessions are gone in favor of per-launch cwd/env, and terminals use createTerminal plus connect. Deploy production with --containers-rollout=immediate.

What replaced sandbox.exec and sessions in Cloudflare Sandbox SDK 1.0?

exec now takes an argv array and returns a process handle with output, logs, waitFor, and kill methods; awaiting it means the process started, not finished. Default and named sessions are removed, so pass cwd and env per launch or run one shell script.

Can I gradually roll out the Cloudflare Sandbox 1.0 preview to production?

No. Stable and @next control protocols are incompatible in both directions, so a gradual rollout leaves a broken mixed window. Production cutover must be a single deploy of matching Worker and image using --containers-rollout=immediate, and in-flight container work may stop.

Does the Sandbox 1.0 preview support gitCheckout and process stdin?

No. gitCheckout is removed, so run git through argv-based exec instead. Process handles have no stdin; use terminals created with createTerminal for interactive input. Do not invent undocumented APIs for these gaps.

When should I not migrate to the Cloudflare Sandbox 1.0 preview?

New projects should start directly on @next rather than migrating, and day-to-day stable work should stay on the stable line. Self-deployed bridges must remain on stable because they are not part of the preview line, and production cutover should not proceed without user agreement.