how to give your ai agent a computer for $0
cloudflare just released computer, an open source package that gives your agent a persistent filesystem, shell access, and code execution inside cloudflare workers. no vps, no docker, no api bill
what you get for free:
- a linux environment with real binaries, npm and node
- sqlite-backed filesystem that survives restarts, 10gb per workspace
- shell execution via just-bash, no container required
- built-in git client and r2 file sharing
- ai sdk tools (read, write, edit, ls, exec) ready to hand to any agent
setup (3 min):
step 1: npm install
@cloudflare/computer
step 2: add withWorkspace to a durable object and set compatibility_flags to nodejs_compat in wrangler.jsonc
step 3: call exec from your agent
```ts
const ws = await getWorkspace(env.Agent.get(id))
await ws.fs.writeFile("/hello.txt", "world")
const run = await ws.runtime.exec("cat /hello.txt")
```
use it for agents that need to read files, run commands, clone repos, build and test code, or store state between sessions
no more ssh keys, no more dockerfiles, no more paying for sandbox apis