What is Tamer?
Tamer is a Cloudflare Workers infrastructure CLI that treats your stack the way Terraform treats cloud infrastructure. Declare D1 databases, R2 buckets, KV namespaces, Queues, Hyperdrive configs, Vectorize indexes, AI Gateways, Pipelines, Workflows, Secrets Stores, DNS records, and Worker routes in a TypeScript config file. Tamer provisions them, tracks their state, detects drift, and deploys your workers.
What problems does it solve?
Without Tamer: You manually create D1 databases in the dashboard, copy UUIDs into your wrangler.toml, manually create R2 buckets, manually wire up KV namespaces, manually deploy each worker in dependency order, manually manage routes, and manually track what exists where. Cloudflare IDs are scattered across config files. There's no drift detection, no plan preview, no rollback.
With Tamer: You declare what resources each worker needs. Tamer creates them, records their IDs in a state database, generates per-env wrangler.json files, deploys workers in topological order (service bindings first), manages routes via the API, and gives you Terraform-style plan, drift, apply, and destroy commands.
Key features
- Declarative resources — Declare D1, R2, KV, Queues, Hyperdrive, Vectorize, AI Gateway, Pipelines, Workflows, Secrets Stores, DNS records. Tamer handles provisioning and state tracking.
- CloudFormation-style stack management — Stack outputs, cross-stack imports, drift detection, plan files with attestation hashes, transactional apply with rollback.
- Per-env config —
local,dev,prod— each with its own resource names, routes, and variables. No Cloudflare IDs in config (they live in state afterapply). - SPA build step — Workers can declare a
buildcommand. Tamer spawns it with resolved vars as env vars, so compile-time values are baked into the bundle without.envfiles or codegen. - Encrypted secrets vault — Secrets stored encrypted in D1 (
tamer-secrets, account-scoped), pushed to workers on deploy. Never in config, never inwrangler.json. - Wrangler types — TypeScript types generated from the official Wrangler config schema, exported from the package.
Where to go next
- Installation — Get Tamer running in your project
- Quickstart — Install from npm and deploy your first stack
- Greenfield Setup — Starting fresh (new project)
- Brownfield Adoption — Adopting existing CF resources
- Single-Product Multi-Tenant — The architecture you're building
- Local Development — The daily
tamer devloop - Troubleshooting — Common errors and fixes
- Values Lifecycle — Where values come from