wrangler

Deploy and manage Cloudflare Workers, KV, R2, D1, and other bindings via the Wrangler CLI.

Updated Nov 23, 2024
One-click install
npx skills add https://github.com/tokisakiyuu/dotfiles --skill wrangler-tokisakiyuu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: wrangler
Source: https://github.com/tokisakiyuu/dotfiles/tree/main/home/dot_claude/skills/wrangler
Command: npx skills add https://github.com/tokisakiyuu/dotfiles --skill wrangler-tokisakiyuu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Wrangler CLI flags, config fields, and subcommands change frequently, so relying on memorized knowledge leads to outdated commands and broken configurations. This Skill ensures correct, current Wrangler usage by biasing toward retrieval from official Cloudflare docs and the local config schema before running any command. ## Core Features & Use Cases - Deployment & Development: Covers wrangler dev, wrangler deploy, versioning, rollback, and environment-based staging/production workflows. - Resource Management: Provides command references for KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Queues, Containers, Workflows, Pipelines, and Secrets Store. - Configuration Best Practices: Enforces wrangler.jsonc over TOML, recent compatibility_date values, type generation via wrangler types, and secure secret handling. - Use Case: You need to deploy a Worker with a D1 database and R2 bucket. The Skill guides you to verify the latest binding shapes in the config schema, write a valid wrangler.jsonc, run migrations, and deploy with a dry run first. ## Quick Start Ask the assistant to help you create and deploy a new Cloudflare Worker with a KV namespace using the latest Wrangler CLI syntax.

Frequently Asked Questions about wrangler

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a Cloudflare Worker with Wrangler?▼

Run `wrangler deploy` after defining your Worker in wrangler.jsonc with a name, main entry point, and compatibility_date. Use `wrangler deploy --dry-run` to validate first, and `wrangler deploy --env staging` to target a specific environment.

Should I use wrangler.jsonc or wrangler.toml for configuration?▼

Prefer wrangler.jsonc because newer Wrangler features are JSON-only. Add the $schema field pointing to node_modules/wrangler/config-schema.json for autocompletion and validation of binding shapes.

How do I manage secrets in Wrangler without exposing them?▼

Use `wrangler secret put KEY` with the interactive prompt, or pipe from a file for CI. Never pass secret values as command arguments or echo them. For local development, store secrets in a .dev.vars file.

Does wrangler dev use real Cloudflare resources locally?▼

By default, wrangler dev simulates bindings locally. Set `"remote": true` on specific bindings in your config to connect to real resources like R2 or Vectorize. Workers AI always runs remotely and incurs usage charges.

Why does my Worker binding show as undefined at runtime?▼

The binding name in your code must exactly match the binding name in wrangler.jsonc. After changing config, run `wrangler types` to regenerate TypeScript definitions and verify the binding exists in the generated types.

How do I run D1 database migrations with Wrangler?▼

Create migrations with `wrangler d1 migrations create <db> <name>`, then apply them with `wrangler d1 migrations apply <db> --local` for development or `--remote` for production. Set migrations_dir in your d1_databases binding config.