Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Ocre

Ocre is a Rails-like Rust web framework for Cloudflare Workers, designed to run on the Workers free plan and to be written by AI agents: generators write plain, readable Rust (models, controllers, templates, migrations) into your app, and the ocre CLI builds, runs and deploys it.

An Ocre app is one Worker compiled to WebAssembly. It stores data in D1 (SQLite), renders HTML with askama templates and htmx, or serves JSON (and optionally GraphQL). Everything it uses is on Cloudflare’s free plan: Workers, D1, Queues (background jobs), Cron Triggers, R2 (files), Durable Objects (WebSockets), KV (cache) and Email Routing.

cargo install --git https://github.com/tgeselle/ocre.rs ocre-cli
ocre new qa --starter qa --yes
cd qa
ocre dev        # http://localhost:8787: a live Q&A app
ocre deploy     # https://qa.<your-subdomain>.workers.dev

Status: early. The APIs described here are the ones in the repository’s main branch; there is no stable release yet.

How these docs are organized

PartRead it whenPages
Getting startedYou are new: install the tools, then build and deploy a live Q&A app step by stepInstallation, Tutorial
GuidesYou need to do one thing (add a model, send email, run a job…)One page per domain, from Models to Deployment
ReferenceYou need exact facts: every command and flag, field types, configuration keys, limitsCLI, Generators, Field types, Configuration, Limits, API index
ExplanationsYou want to know why Ocre works the way it doesArchitecture, Generated code, Security model, Cost model

The Rust API of the ocre crate is documented item by item in the rustdoc reference, and on one page in the API index.

For AI agents

  • Every page is also plain Markdown: add .md to its URL (/guides/models is /guides/models.md).
  • /llms.txt lists every page with a one-line description; /llms-full.txt is all pages in one file.
  • Pages are self-contained: prerequisites, complete code, the commands to run and their expected output. Rust examples marked as checked compile against a real generated app.
  • Each generated app has an AGENTS.md with the conventions, commands and free-plan limits of that app; read it first, then these docs for details.
  • With --json, every ocre command prints exactly one JSON object on stdout and never prompts (see CLI commands).