mizchi/skills/cloudflare-deploy

Claude Code and agent skill by mizchi/skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Deploy applications and infrastructure to Cloudflare with the cf CLI and typed cloudflare.config.ts. Use when deploying Workers, migrating a Wrangler project to cf, or setting up Cloudflare resources and CI.

Install

npx vskill@latest install mizchi/skills/cloudflare-deploy

SKILL.md

The same SKILL.md was published earlier as mizchi/skills/cloudflare-deploy.

Cloudflare Deploy

Use cf for Cloudflare operations. Use the decision trees below to pick a product, then read its runtime/API references and the current cf CLI guide.

Prerequisites

  • Node.js 24+ and pnpm; satisfy the installed packages' exact engines patch floors. Install the npm package `cf`, not @cloudflare/cf.
  • Keep cf in project devDependencies and commit the lockfile. The smoke project checks cf@1.0.0-rc.1 with @cloudflare/vite-plugin@2.0.0-rc.1, Vite 8.3.8 and Node 24.22.2 (2026-11-18). The cf 1.0 release candidate requires plugin 2.0.0-rc.0 or later for Vite builds, or Wrangler 4.163.0 or later for legacy Wrangler builds. Check the published plugin tags and pin a compatible 2.x release in Vite projects.
  • The 1.0 release candidate stabilizes typed configuration, Build Output and project commands. Some generated API command paths can still change. When upgrading from beta, rebuild into .cloudflare/output/v1/ before using --prebuilt; see the upgrade guide.
  • Workers use cloudflare.config.ts. For an existing Wrangler project, run cf migrate --dry-run, then cf migrate and resolve its follow-up items before project commands. Automatic configuration does not import the old bindings.

Authentication (Required Before Deploy)

Verify auth before publishing or mutating account resources:

bash
pnpm exec cf auth whoami

See authentication. Use pnpm exec cf auth login locally; cf has its own login credentials. In CI set CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID. A deploy dry run needs no credentials.

Discover Commands Before Running Them

bash
pnpm exec cf cli search "create a D1 database"
pnpm exec cf schema d1 create
pnpm exec cf d1 create --help

Describe only the operation and resource type in search queries. Pass names and IDs to the discovered command, not to search. API commands return JSON on stdout and progress on stderr. Resource commands usually use IDs and remote data; inspect --local support instead of copying Wrangler's --remote, --env, --json, or --yes flags.

When to Read references/

Current CLI, migration, configuration and build guidance lives in references/cf/. Product references retain SDK and runtime knowledge; files marked as legacy preserve old CLI/config examples only as migration input. Do not execute those Wrangler examples or generate new Wrangler configuration from them. Translate the intended operation using cf search/schema and typed bindings.

Rules of thumb:

  • Picking a product? Use decision trees below, then load references/<picked-product>/
  • Writing cloudflare.config.ts? Read configuration first.
  • CI/CD setup? Read GitHub Actions.
  • Deploy fails? Read cf gotchas, then the product's runtime gotchas.
  • The minimal example below covers Workers + KV + secret — for anything beyond that, descend into references

Minimal Worker Example (copy-paste starter)

Start with this Worker, one KV binding and one secret. Apply the TypeScript setup from the configuration reference before typechecking:

ts
// cloudflare.config.ts
import { bindings, defineConfig } from "cf/config";
import * as entrypoint from "./src/index.ts" with { type: "cf-worker" };
export default defineConfig({
worker: {
name: "my-worker",
entrypoint,
compatibilityDate: "2026-11-16", // Example: select a date deliberately for this Worker
observability: { enabled: true },
env: {
CACHE: bindings.kv({ id: "REPLACE_WITH_KV_ID" }),
API_SECRET: bindings.secret(),
},
},
});
ts
// vite.config.ts
import { cloudflare } from "@cloudflare/vite-plugin";
import { defineConfig } from "vite";
export default defineConfig({ plugins: [cloudflare()] });
ts
// src/index.ts
export default {
async fetch(req: Request, env: Env): Promise<Response> {
const hit = await env.CACHE.get("greeting");
return new Response(hit ?? "hello");
}
} satisfies ExportedHandler<Env>;

Bootstrap commands:

bash
pnpm add -D cf@1.0.0-rc.1 @cloudflare/vite-plugin@2.0.0-rc.1 vite typescript
pnpm exec cf kv namespaces create --title CACHE # Copy the returned ID into config
pnpm exec cf workers types # Generates .cloudflare/types/index.d.ts
pnpm exec cf dev # Vite reports the local URL
pnpm exec cf deploy --dry-run --secrets-file .env.production
pnpm exec cf deploy --secrets-file .env.production

Put API_SECRET in an ignored .env.production for deployment and .dev.vars for local development. bindings.secret() declares the Worker binding; CLI process variables do not automatically supply its value. Before publication, check that the selected secret source contains every required key with a non-empty value, without printing values. In RC.1, deploy dry-run can succeed with the secret file omitted, so it does not prove secret completeness. Include .cloudflare/types in tsconfig.json; see the configuration reference for the full TypeScript setup. Change an existing Worker's compatibility date deliberately.

Stream live events with pnpm exec cf observability tail --worker my-worker; enable Workers Logs for that Worker first. Output is newline-delimited JSON. See observability and command discovery for selectors and filters.

Deploy an already-built static site with pnpm exec cf deploy ./dist; this skips the build and creates an assets-only Worker. Projects with server-side code use the normal build/deploy pipeline. For an existing Pages project, preserve its publisher until its functions/assets have migrated; the static-directory command targets Workers. See deployment patterns.

For Pages / D1 / Durable Objects / multi-env / CI — descend into references/.

Quick Decision Trees

"I need to run code"
Need to run code?
├─ Serverless functions at the edge → workers/
├─ Full-stack web app with Git deploys → workers/ (framework) + static-assets/
├─ Maintain or migrate an existing Pages app → pages/ (legacy reference)
├─ Stateful coordination/real-time → durable-objects/
├─ Long-running multi-step jobs → workflows/
├─ Run containers → containers/
├─ Multi-tenant (customers deploy code) → workers-for-platforms/
├─ Scheduled tasks (cron) → cron-triggers/
├─ Lightweight edge logic (modify HTTP) → snippets/
├─ Process Worker execution events (logs/observability) → tail-workers/
└─ Optimize latency to backend infrastructure → smart-placement/
"I need to store data"
Need storage?
├─ Key-value (config, sessions, cache) → kv/
├─ Relational SQL → d1/ (SQLite) or hyperdrive/ (existing Postgres/MySQL)
├─ Object/file storage (S3-compatible) → r2/
├─ Message queue (async processing) → queues/
├─ Vector embeddings (AI/semantic search) → vectorize/
├─ Strongly-consistent per-entity state → durable-objects/ (DO storage)
├─ Secrets management → secrets-store/
├─ Streaming ETL to R2 → pipelines/
└─ Persistent cache (long-term retention) → cache-reserve/
"I need AI/ML"
Need AI?
├─ Run inference (LLMs, embeddings, images) → workers-ai/
├─ Vector database for RAG/search → vectorize/
├─ Build stateful AI agents → agents-sdk/
├─ Gateway for any AI provider (caching, routing) → ai-gateway/
└─ AI-powered search widget → ai-search/
"I need networking/connectivity"
Need networking?
├─ Expose local service to internet → tunnel/
├─ TCP/UDP proxy (non-HTTP) → spectrum/
├─ WebRTC TURN server → turn/
├─ Private network connectivity → network-interconnect/
├─ Optimize routing → argo-smart-routing/
├─ Optimize latency to backend (not user) → smart-placement/
└─ Real-time video/audio → realtimekit/ or realtime-sfu/
"I need security"
Need security?
├─ Web Application Firewall → waf/
├─ DDoS protection → ddos/
├─ Bot detection/management → bot-management/
├─ API protection → api-shield/
├─ CAPTCHA alternative → turnstile/
└─ Credential leak detection → waf/ (managed ruleset)
"I need media/content"
Need media?
├─ Image optimization/transformation → images/
├─ Video streaming/encoding → stream/
├─ Browser automation/screenshots → browser-rendering/
└─ Third-party script management → zaraz/
"I need infrastructure-as-code"
Need IaC? → pulumi/ (Pulumi), terraform/ (Terraform), or api/ (REST API)

Product Index

Compute & Runtime
ProductReference
Workersreferences/workers/
Pagesreferences/pages/
Pages Functionsreferences/pages-functions/
Durable Objectsreferences/durable-objects/
Workflowsreferences/workflows/
Containersreferences/containers/
Workers for Platformsreferences/workers-for-platforms/
Cron Triggersreferences/cron-triggers/
Tail Workersreferences/tail-workers/
Snippetsreferences/snippets/
Smart Placementreferences/smart-placement/
Storage & Data
ProductReference
KVreferences/kv/
D1references/d1/
R2references/r2/
Queuesreferences/queues/
Hyperdrivereferences/hyperdrive/
DO Storagereferences/do-storage/
Secrets Storereferences/secrets-store/
Pipelinesreferences/pipelines/
R2 Data Catalogreferences/r2-data-catalog/
R2 SQLreferences/r2-sql/
AI & Machine Learning
ProductReference
Workers AIreferences/workers-ai/
Vectorizereferences/vectorize/
Agents SDKreferences/agents-sdk/
AI Gatewayreferences/ai-gateway/
AI Searchreferences/ai-search/
Networking & Connectivity
ProductReference
Tunnelreferences/tunnel/
Spectrumreferences/spectrum/
TURNreferences/turn/
Network Interconnectreferences/network-interconnect/
Argo Smart Routingreferences/argo-smart-routing/
Workers VPCreferences/workers-vpc/
Security
ProductReference
WAFreferences/waf/
DDoS Protectionreferences/ddos/
Bot Managementreferences/bot-management/
API Shieldreferences/api-shield/
Turnstilereferences/turnstile/
Media & Content
ProductReference
Imagesreferences/images/
Streamreferences/stream/
Browser Renderingreferences/browser-rendering/
Zarazreferences/zaraz/
Real-Time Communication
ProductReference
RealtimeKitreferences/realtimekit/
Realtime SFUreferences/realtime-sfu/
Developer Tools
ProductReference
cf CLIreferences/cf/
Miniflarereferences/miniflare/
C3references/c3/
Observabilityreferences/observability/
Analytics Enginereferences/analytics-engine/
Web Analyticsreferences/web-analytics/
Sandboxreferences/sandbox/
Workerdreferences/workerd/
Workers Playgroundreferences/workers-playground/
Infrastructure as Code
ProductReference
Pulumireferences/pulumi/
Terraformreferences/terraform/
APIreferences/api/
Other Services
ProductReference
Email Routingreferences/email-routing/
Email Workersreferences/email-workers/
Static Assetsreferences/static-assets/
Bindingsreferences/bindings/
Cache Reservereferences/cache-reserve/

Troubleshooting

Escalated Network Access

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mizchi/skills/cloudflare-deploy/badge)](https://verified-skill.com/skills/mizchi/skills/cloudflare-deploy)

Something wrong with this skill or its page? Tell us.