Close the laptop. The agent keeps working.
cf-opencode runs OpenCode in a workspace on Cloudflare Containers, in your own account. The workspace sleeps when it is idle and wakes when you connect.
npx cf-opencode init
Open source, Apache-2.0. Not affiliated with Cloudflare or OpenCode.
$ cf-opencode connect0.4s container ready2.4s egress CA: trusted3.4s repo: cloned4.9s workspace ready; opencode on port 40964.9s spawn done
One workspace, one day
You pay for compute while the workspace is awake. It is awake while you or the agent work.
An example day. The times are an illustration; the 20-minute idle pause is the default.
What you get
- Your account, your data
- The Worker, the containers and the snapshots are in your Cloudflare account. There is no hosted service between you and them.
- No model key
- Models run through your account's Workers AI and AI Gateway. You make no API key and store none.
- Private repositories work
- Setup connects GitHub one time. Workspaces clone, push and run
gh. The token stays in the Worker and never enters a workspace. - Idle time costs nothing
- An idle workspace saves its disk and stops. The next connect restores the files, the installed tools and the session.
- A full Linux machine
- A terminal in tmux, SSH,
sudo apt-get, web search and a browser.cf-opencode preview 3000opens the agent's dev server atlocalhoston your machine. - Hand off a task
cf-opencode run "<task>"starts an agent in the workspace and returns.cf-opencode tasksshows the result: the summary, the branch and the pull request.
How it works
-
Install
npx cf-opencode initThis checks your machine, then deploys one Worker and the workspace image into your Cloudflare account.
-
Connect
npx cf-opencode connectRun it in a git checkout. It starts a workspace, clones the repository there, and opens your local OpenCode against it.
-
Leave and come back
npx cf-opencode connect --continueThe agent works with no client attached. When you return, this opens the last session in the workspace.
What you need
- Node 22 or newer
- Docker, with the buildx plugin
- A Cloudflare account on the Workers Paid plan
- OpenCode 2 on your machine
What it costs
cf-opencode is free. Cloudflare bills your account for what a workspace uses: container time while it is awake, model usage, and browser hours. The docs list the limits.