Cloudflare Computer
Durable SQLite-backed workspace and Worker Loader shell for Cloudflare Workers.
Cloudflare Computer is an early-preview sandbox for experiments and prototypes. It stores one workspace in each Fabric session Durable Object and runs commands through a just-bash Dynamic Worker. It is not a Linux container and should not be treated as production-ready until Cloudflare stabilizes Computer and Worker Loader.
Install the managed adapter:
fh add cloudflare-computerOr configure the generated Cloudflare target directly:
export default {
sandbox: {
backend: "cloudflare",
mode: "computer",
loaderBinding: "LOADER",
cwd: "/workspace",
},
};The Cloudflare build emits all required topology: a worker_loaders binding, the experimental compatibility flag, an entry-module WorkspaceServiceProxy export, and __getWorkspaceStub() on FabricHarnessSessionObject. At runtime Harness constructs the Computer Workspace with the Durable Object's SQLite storage, waitUntil, createGitClient(), and WorkerShellBackend loopback { binding: "FABRIC_HARNESS_SESSIONS", id }.
Because exec() works, the normal Harness tools apply unchanged: bash, grep, glob, read, write, and edit. The default working directory is /workspace. The native workspace is available through cloudflareComputerWorkspace(sessionSandbox) for typed git or direct filesystem operations.
Requirements and limits
- Install
@cloudflare/computer,@platformatic/vfs, and@fabric-harness/cloudflare. - Worker Loader is beta and requires the
experimentalcompatibility flag. - just-bash implements shell commands in JavaScript; native binaries and language toolchains require Cloudflare Sandbox.
- Computer state lives in the Fabric session Durable Object and follows its identity and isolation boundary.
- Cancellation rejects promptly, sends
SIGKILLto the workspace run, consumes late settlement, and disposes the run handle. - Existing
@cloudflare/shellWorkspace data is not migrated. Hydrate and verify a fresh Computer workspace before switching traffic.
The old shell-workspace mode and fh add cloudflare-shell command remain deprecated aliases for one release window. New code should use computer and cloudflare-computer.
See examples/with-cloudflare-shell-workspace for a runnable migration example. Its historical directory and package names are retained so existing workspace filters do not break.