computer README

The project's README from github.com/cloudflare/computer. As one markdown file: README.md.

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:

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.

Repository layout

The repo is a small monorepo. Each package has its own README with package-specific status and usage notes.

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

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.

computer (cloudflare/computer)

Searching Database…

这是什么?Cloudflare Computer 为 AI 智能体提供一台持久化的计算机:它是一个由 Durable Object 的 SQLite 存储支撑的虚拟文件系统,并可插拔不同的后端,这些后端会在该文件系统上真正执行 shell 命令或 JavaScript。
这是独立应用,还是需要我在其基础上进行开发的东西?它是一个 TypeScript 多包代码仓库,包含若干 npm 包('@cloudflare/computer'、'dofs'、'computerd'、'rpc'),你需要把它们安装到自己的 Cloudflare Worker/Durable Object 中,它本身并不是一个可以单独运行的服务。
我该如何开始使用它进行开发?安装 '@cloudflare/computer' 包,并按照其 README 完成安装步骤,了解文件系统和运行时 API;也可以直接克隆一个可运行的示例,例如 'examples/tutorial' 或 'examples/mcp'。
运行它需要准备什么?你需要一个 Cloudflare Workers/Durable Objects 项目;如果使用 Container 后端,还需要一个运行 computerd 守护进程的沙箱容器,并通过 capnweb RPC 通道进行同步。
这个东西可以用于生产环境吗?不可以。README 明确标注它仅为预览版,API 尚不稳定,适合实验和原型开发,不适用于生产环境。
三种执行后端分别是什么?Container(带真实 FUSE 挂载和完整 Linux 用户空间的沙箱)、Isolate shell(在 Dynamic Worker 中运行的 just-bash)、以及 Isolate JavaScript(在 Dynamic Worker 中运行的 ECMAScript 模块)——三者都通过同一个 workspace.runtime.exec() 调用触发。
一个工作区可以同时使用多个后端吗?可以。一个 Workspace 可以在稳定的 ID 下注册多个后端,并在每次调用 workspace.runtime.exec() 时选择使用哪一个。
FUSE 挂载的性能与真实磁盘相比如何?根据 docs/19performance.md 中的 fs-bench 数据,computerd 的 FUSE 挂载在元数据密集型操作上快于真实磁盘,但在大规模顺序 I/O 上则落后于真实磁盘。
examples 文件夹里有什么?可运行的演示,涵盖容器与 worker-shell 执行、出站流量策略、MCP 工具服务器、长上下文代码模式归约器(rlm)、终端聊天智能体,以及将生成的项目发布为 Cloudflare Artifacts。
Creator
cloudflare
Size
8.9 MB
Stars
9.6K
Age
4mo
Commits · 90 Days