Purpose: To provide AI agents with a "computer," i.e., a virtual file system running inside a Durable Object, with execution environments that can be attached as needed.
Main capabilities: The Durable Object uses SQLite to store authoritative state and exposes a single execution entry point through workspace.runtime. workspace.runtime.exec(source, { backend }) determines, based on the selected backend, whether source is a shell command or an ECMAScript module. Three backends are currently built in: Container projects the SQLite state as a real FUSE mount into a sandbox container, mounted and synchronized by the computerd daemon, providing a full Linux userland; Isolate shell runs just-bash in a Dynamic Worker and accesses the Workspace via Workers RPC; Isolate JavaScript runs an ECMAScript module in a newly created Dynamic Worker, supporting structured input/output, persistent relative imports, configuration libraries, Workspace-based node:fs/promises, and host modules such as ws:git, ws:artifacts, and ws:container. A Workspace can register multiple backends; backends connect lazily on first use, and it is also possible to use only the file system without attaching any backend. The repository also provides examples such as containers, Worker shell, MCP, RLM, various agent frameworks, and tutorials.
Usage: Install @cloudflare/computer and follow that package's README, which includes installation steps, entry point mappings, and examples of using fs and runtime. Running npm install in the repository root runs build:types for each example, and npm run build:types can regenerate Env types after changes to wrangler.jsonc or the env template.
Limitations: @cloudflare/computer can be considered suitable for production use, but components such as ContainerBackend are in-progress or experimental and are not suitable for production. The specifications under docs/ are forward-looking designs and should be understood for their intent rather than as descriptions of the current code. The repository does not accept unsolicited pull requests; see CONTRIBUTING.md for ways to contribute. FUSE mounts outperform real disks on metadata-intensive tasks but underperform on large sequential I/O; see docs/19_performance.md for performance details.