Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Cloudflare Wrangler

$ wrangler Official High Risk
Cloudflare · Cloud & Infra · MIT / Apache-2.0 · macos / linux / windows

Wrangler is Cloudflare's official developer CLI for building, locally simulating, and deploying Workers, Pages, D1 databases, KV namespaces, R2 buckets, and Durable Objects. Offers --dry-run deployment previews and --json outputs on inspection commands.

FCRS-1.0 Score
87 /100
Good
Medium Confidence
Zero-Friction Install
npm install -D wrangler
CLI vs MCP Decision Hybrid (CLI + MCP)

Use wrangler for local project dev, D1 migrations, and Worker bundling/deploy; pair with Cloudflare MCP or cf for account-wide API queries.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 21 / 25

Supports --json on D1/KV/secret/listing subcommands, --dry-run on deploy, and CI=true non-interactive behavior, though Node startup is slightly heavier than Go/Rust binaries.

  • wrangler deploy --dry-run and wrangler d1 execute --json
  • Respects CI=1 and NO_COLOR=1
Trust & Safety 20 / 25

Supports scoped CLOUDFLARE_API_TOKEN, --local sandboxed dev, --env isolation, and --dry-run, while remote operations carry real billing and production risks.

  • Scoped CLOUDFLARE_API_TOKEN + --local vs --remote explicit split
  • Production deploys and d1 execute --remote require strict guardrails
Setup & Portability 13 / 15

Easy install via npm / npx across macOS, Linux, and Windows, requiring Node.js runtime.

  • Standard Node.js package in cloudflare/workers-sdk
Utility & Efficiency 14 / 15

Indispensable for Workers local runtime, bundling, and bindings—capabilities that pure API/MCP servers cannot replicate locally.

  • Includes local Miniflare runtime (wrangler dev) and asset bundling
Maintenance & Lineage 10 / 10

Official Cloudflare flagship developer CLI with weekly releases.

  • Maintained in cloudflare/workers-sdk under MIT/Apache-2.0
Docs & Verifiability 9 / 10

Detailed Cloudflare Developer Docs covering every command and binding.

  • Official command docs at developers.cloudflare.com

Security, Auth & Guardrails

Auth Modes
OAuth Browser Env API Key
Credential Storage

OAuth tokens stored under ~/.wrangler/config/ or scoped CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID env vars.

Side Effects
Read-Only Local Write Remote Write Destructive Billing Impact
Cost & Quotas

CLI is free; remote deployments and Workers/D1/R2 usage follow Cloudflare account billing tiers.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Cloudflare Wrangler Agent Rules
- Always run `wrangler deploy --dry-run` before any live deploy.
- Default D1/KV operations to `--local` unless `--remote` is explicitly requested.
- Never execute `wrangler delete` or production `d1 execute --remote` without user approval.

Agent-Ready Command Recipes

Safe Read-Only Queries

Query local D1 database in JSON
wrangler d1 execute <db-name> --local --json --command "SELECT name FROM sqlite_master WHERE type='table';"

Runs SQL strictly against the local Miniflare D1 simulation with --json output.

Preview Worker bundle without deploying
wrangler deploy --dry-run --outdir dist-preview

Validates configuration and builds the Worker bundle locally without touching production.

Controlled Writes & Previews

Deploy to a named non-production environment
wrangler deploy --env staging

Targets an isolated staging environment defined in wrangler.jsonc.

Strengths for Agents

  • + --local mode lets agents test D1/KV/R2 code safely without touching cloud state.
  • + wrangler deploy --dry-run catches config and bundling errors pre-flight.
  • + Clean --env targeting and scoped CLOUDFLARE_API_TOKEN support.

Caveats & Pitfalls

  • ! Requires Node.js and has noticeable cold-start overhead via npx.
  • ! Not every subcommand outputs uniform JSON; some logs mix human status lines.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI