⚡ THE FLARE SUITE / OPERATIONS & WORKFLOW

flareops

Developer operations & workflow CLI for Cloudflare Workers, Pages, and Astro — consolidating strict type generation, .dev.vars secret management, Pages _routes.json optimization, _headers immutable caching rules, Astro session verification, and unified pre-deploy audits.

Subcommand: sync

⚡ TypeScript Binding Sync

Parses wrangler.jsonc or wrangler.toml and generates strictly typed cloudflare-env.d.ts covering KV, D1, R2, Queues, Vectorize, Hyperdrive, AI, Services, and more.

flareops sync [PATH]
Subcommand: env

🔒 Local Secrets & Environment

Manages .dev.vars local development environment files safely, scaffolds secret templates, merges variables, and validates .gitignore security against leaks.

flareops env pull / env validate
Subcommand: routes

🌐 Pages _routes.json Optimizer

Scans Astro, Remix, and SvelteKit static asset output and auto-generates optimized, minified _routes.json guaranteed to stay under Cloudflare's strict 100-rule limit.

flareops routes generate dist
Subcommand: headers

📑 Pages _headers & Edge Cache

Scans static asset bundles and generates or remediates optimized _headers with immutable cache rules (/_astro/*, fonts, images) and security headers.

flareops headers generate / fix
Subcommand: session

🗄 Astro KV Session Audit

Validates astro.config.* session driver configuration against wrangler.jsonc KV namespace bindings and auto-scaffolds missing session bindings.

flareops session check / init
Subcommand: check

✔ Unified Verification

Comprehensive pre-deploy validation verifying that TypeScript interfaces, .dev.vars secrets, Pages route rules, headers, and sessions are synchronized.

flareops check
Subcommand: migrate

🚀 Astro v5 Codemod

Scans project files and codemods legacy Astro.locals.runtime.env calls to modern Astro v5 and @astrojs/cloudflare v12 Astro.locals.* format.

flareops migrate src/
Subcommand: completions

🐚 Shell Autocompletions

Generates native, fast autocompletions for zsh, bash, fish, powershell, and elvish.

flareops completions zsh

Pre-Deploy CI/CD Integration

# In your .github/workflows/ci.yml - name: Cloudflare Ops & Verification uses: bhubbard/flareops@main with: command: check path: . strict: true

Cloudflare Bindings Type Safety Matrix

Category Cloudflare Binding Generated TypeScript Type
Storage KV Namespaces KVNamespace
Storage D1 Relational SQLite D1Database
Storage R2 Object Storage R2Bucket
Storage Vectorize Vector Search VectorizeIndex
Database Hyperdrive TCP Accelerator Hyperdrive
AI & Compute Workers AI Serverless LLMs Ai
Microservices Service Bindings / Assets Fetcher
Messaging Cloudflare Queues Queue
Stateful Durable Objects DurableObjectNamespace
Orchestration Cloudflare Workflows Workflow
Environment Vars & Secrets string | number | boolean