Cloudbed

An agent-native platform for building and deploying small full-stack TypeScript apps — capsules — in one command. Write a server contract and a Preact client, run cloudbed deploy, and get a live URL in seconds. Built to be driven by coding agents as much as by people: every CLI command speaks --json, and every deploy is inspectable.

Quick start

npx cloudbed new my-app --template todo   # or --template guestbook
cd my-app
npx cloudbed dev                          # local runtime at http://localhost:3000
npx cloudbed deploy                       # live anonymous URL, no account needed

cloudbed dev runs the same runtime code that serves in production, under local workerd — so dev behaves like prod, and local state survives restarts (--fresh resets it).

What a capsule is

server/index.ts        schema, queries, mutations, HTTP endpoints
client/index.tsx       the Preact UI (exports an App, renders into #app)
shared/                pure TypeScript shared by both sides
.env.cloudbed.server   optional server-only env (claimed deploys only)

The server is authoritative: queries decide what a client may read, mutations validate and re-check ownership before they write. The client subscribes to queries over a WebSocket and gets live updates pushed after every write.

// server/index.ts
import { capsule, mutation, query, string, table } from "cloudbed/server";

export default capsule({
  schema: { todos: table({ text: string(), ownerId: string() }) },
  queries: {
    todos: query((ctx) => ctx.db.todos.where("ownerId", ctx.auth.userId).all()),
  },
  mutations: {
    addTodo: mutation((ctx, text: string) =>
      ctx.db.todos.insert({ text, ownerId: ctx.auth.userId })),
  },
});
// client/index.tsx
import { render } from "preact";
import { useMutation, useQuery } from "cloudbed/client";

function App() {
  const todos = useQuery("todos") ?? [];
  const addTodo = useMutation("addTodo");
  // render the list, call addTodo(text)
}
render(<App />, document.getElementById("app")!);

Every capsule gets:

How deploys work

Your first cloudbed deploy needs no account and returns a URL on *.cloudbed.app. Anonymous deploys are sandboxed — no outbound fetch, no server env — and expire after 7 days. Claiming a deploy to your account lifts both and makes it permanent. See Deploys & limits.

Where to go next

For agents: every page here is also raw markdown (append .md), indexed at /llms.txt.