Flue logo Cloudflare logo

Flue 2.0 snippets for Cloudflare

31 agents you can deploy today. Each one builds with Vite, deploys a real Worker, asserts, then deletes it.

Repo →

31 snippets

New here? Start with these

Four snippets, smallest to largest.

  1. 1 workers-ai The simplest Cloudflare Flue agent: call a model and return its answer.
  2. 2 do-session One durable conversation per user id, persisted across requests.
  3. 3 virtual-sandbox Seed an in-memory just-bash sandbox from R2 and inspect it with agent tools.
  4. 4 mcp-client A Flue agent calls a tool from a co-hosted MCP server.

FAQ

Do these agents run on Cloudflare?
Yes. Each test builds a Worker with Vite, deploys it with Wrangler, asserts against the live endpoint, then deletes the Worker. CI does the same. No mocks.
How does the build and the deploy work?
Vite builds each snippet. The flue() plugin finds each 'use agent' module and writes dist/<name>/wrangler.json with the bindings and Durable Object migrations. Then wrangler deploy --config ships it.
Do I need any third-party API keys?
No. The examples use Workers AI. You need no OpenAI or Anthropic key. Check your Cloudflare plan before you run the full matrix.
Can I run one snippet only?
Yes. Use bun ex:<name> for examples, bun rx:<name> for recipes, and bun tpl:<name> for templates.
Where can Flue run?
Flue runs where TypeScript runs. This repository targets Cloudflare Workers. Flue also builds for Node.js, GitHub Actions, GitLab CI, and Daytona. The agent code stays the same.