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
| Part | Read it when | Pages |
|---|---|---|
| Getting started | You are new: install the tools, then build and deploy a live Q&A app step by step | Installation, Tutorial |
| Guides | You need to do one thing (add a model, send email, run a job…) | One page per domain, from Models to Deployment |
| Reference | You need exact facts: every command and flag, field types, configuration keys, limits | CLI, Generators, Field types, Configuration, Limits, API index |
| Explanations | You want to know why Ocre works the way it does | Architecture, 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
.mdto its URL (/guides/modelsis/guides/models.md). /llms.txtlists every page with a one-line description;/llms-full.txtis 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.mdwith the conventions, commands and free-plan limits of that app; read it first, then these docs for details. - With
--json, everyocrecommand prints exactly one JSON object on stdout and never prompts (see CLI commands).