Cloudflare Computer
Cloudflare Computer is a virtual filesystem that lives inside a
Durable Object. The Durable Object holds the authoritative state in
SQLite and exposes one pluggable execution surface through
workspace.runtime. Three backends ship today:
- Container projects the SQLite state into a sandbox container as
computerd) mounts the state
as a filesystem and syncs changes back over a capnweb RPC channel.
Full Linux userland, real binaries, real network.
- Isolate shell runs just-bash
- Isolate JavaScript runs an ECMAScript module in a fresh Dynamic
node:fs/promises, and trusted ws:git and
ws:artifacts modules.
A Workspace may register multiple backends under stable IDs.
workspace.runtime.exec(source, { backend }) is the single execution
entry point; the selected backend defines whether source is a shell
command or an ECMAScript module. Backends connect lazily on first use.
Workspace can also be constructed without a backend at all, giving callers the filesystem on its own.
[!IMPORTANT]
PREVIEW ONLY This package is provided as a preview for feedback only.
APIs are unstable and the design is subject to change.
> Suitable for experiments, exploration and prototypes. It is NOT suitable
for production use at this time.
> The specification under docs/ is forward-looking β read it for
intent, not as description of the code today.
Using it
If you want to build on Cloudflare Computer, install
@cloudflare/computer and follow that
package's README β it has the installation steps, the entrypoint map,
and worked examples of the fs and runtime surfaces.
To contribute feedback, see CONTRIBUTING.md.
Approved collaborators should follow COLLABORATORS.md
for setup, build, and test instructions.
Examples
The examples/ directory holds runnable consumers of the
public surface. Each is a Worker workspace with its own README.
examples/containerβ runscomputerdinside a
write / read / exec HTTP surface.
examples/worker-shellβ same HTTP surface as the
env.LOADER. No container.
examples/worker-javascriptβ mirrors
worker-shell, but exec evaluates an ECMAScript module in a Dynamic
Worker instead of running a shell command.
examples/egressβ sends one URL through the container,
none, all, or
custom egress policies.
examples/mcpβ a Computer MCP example:
code tool backed by a durable workspace, a Worker shell,
and a full Linux container.
examples/rlmβ shows how generated JavaScript can read long
examples/tutorialβ a step-by-step build: one
pandoc on it in the container to produce a PDF.
examples/artifactsβ generates a Worker project
examples/assetsβ turns a prompt into an image with
@cloudflare/computer/assets.
Every example's Env type is generated by wrangler types rather than
committed. npm install at the repo root runs each example's
build:types script, and npm run build:types regenerates them all
after a wrangler.jsonc or env template changes.
Repository layout
The repo is a small monorepo. Each package has its own README with package-specific status and usage notes.
packages/dofs(@cloudflare/dofs) β
@platformatic/vfs provider for Node.
(@cloudflare/computer-rpc) β capnweb wire types and
server/client helpers shared between the Durable Object and computerd.
(@cloudflare/computerd) β the computerd daemon: a FUSE mount plus
HTTP/WebSocket RPC server that runs inside the sandbox container.
(@cloudflare/computer) β the top-level Computer package
consumed by Durable Objects. Work in progress.
β private Docker image context for the prebuilt computerd linux-x64
binary. The image, not an npm package, is the release artifact.
Performance
computerd's FUSE mount beats real disk on metadata-heavy work and
trails it on large sequential I/O. See
docs/19_performance.md for the full fs-bench
numbers, a cloudflare/sandbox-sdk npm install comparison, and how
to reproduce them.
Documentation
docs/β design specification. Forward-looking;
docs/19_performance.mdβ filesystem benchmarks.
Contributing
We accept bug reports, fix proposals, feature requests, and design
proposals through issues and discussions. We do not accept unsolicited
pull requests. See CONTRIBUTING.md for the public
contribution paths.
Approved collaborators should follow
COLLABORATORS.md for setup, formatting, testing,
commit message, and pull request conventions.
If you're working in this repo as an agent, start with
AGENTS.md and the skills under
.agents/skills/.
License
MIT. See LICENSE.