wrangler
Wrangler is Cloudflare's command-line tool for building and deploying Workers across the edge platform. It handles local development, deployment, and management of Workers alongside bindings for KV storage, R2 buckets, D1 databases, Vectorize indexes, and Workers AI. The skill prioritizes current documentation over cached knowledge to ensure commands and config syntax stay accurate.
Wrangler is Cloudflare's CLI for deploying, developing, and managing Workers and related services like KV, R2, D1, and AI.
AI-generated summary based on this skill's SKILL.md
Install
cloudflare/skills/wrangler · repository language: Shell
git clone https://github.com/cloudflare/skills
cp -r skills/skills/wrangler ~/.claude/skills/wranglerFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I deploy Cloudflare Workers using wrangler?
Wrangler is Cloudflare's CLI tool for deploying Workers to the edge. After setting up your project with `wrangler init`, define your Worker code and configure bindings in `wrangler.toml`. Run `wrangler deploy` to push your Worker to Cloudflare's edge network. Wrangler handles authentication, versioning, and rollout automatically.
What are the main wrangler CLI commands for local development?
Wrangler provides `wrangler dev` to run your Worker locally with live reload, `wrangler deploy` to publish to production, and `wrangler tail` for streaming live logs. Use `wrangler secret put` and `wrangler secret delete` for managing secrets, and `wrangler kv:namespace create` for KV storage setup. Each command supports flags for environment-specific configuration.
How do I set up wrangler local development environment?
Wrangler simplifies local setup: install it via npm, run `wrangler init` to scaffold a project, then use `wrangler dev` to start a local server. Your local environment mirrors production bindings—KV namespaces, R2 buckets, D1 databases, and AI models all work locally. Configure them in `wrangler.toml` and Wrangler handles the rest.
How do I configure KV, R2, D1, and AI bindings in wrangler?
Wrangler manages bindings through `wrangler.toml`. Define KV namespaces with `[[kv_namespaces]]`, R2 buckets with `[[r2_buckets]]`, D1 databases with `[[d1_databases]]`, and AI with `[env.production.ai]`. Each binding gets a name you reference in your Worker code. Wrangler automatically injects these at runtime, both locally and on the edge.
What's the best way to manage secrets and environment variables?
Wrangler stores secrets securely using `wrangler secret put KEY` for production and `wrangler secret put KEY --env staging` for other environments. Secrets never appear in `wrangler.toml`. For non-sensitive config, use `[env.production]` variables in `wrangler.toml`. Access both via `env.VARIABLE_NAME` in your Worker code.
How do I troubleshoot wrangler startup time and binding issues?
Wrangler's `wrangler tail` streams live logs to diagnose runtime errors. For slow startup, check binding configuration in `wrangler.toml`—misconfigured namespaces or database IDs cause delays. Run `wrangler dev --debug` for verbose output. Verify credentials and environment names match your Cloudflare account settings.
SKILL.md
rendered from the published skill — quoted content, verbatim
Wrangler CLI
Your knowledge of Wrangler CLI flags, config fields, and subcommands may be outdated. Prefer retrieval over pre-training for any Wrangler task.
Retrieval Sources
Fetch the latest information before writing or reviewing Wrangler commands and config. Do not rely on baked-in knowledge for CLI flags, config fields, or binding shapes.
| Source | How to retrieve | Use for |
|---|---|---|
| Wrangler docs | https://developers.cloudflare.com/workers/wrangler/ |
CLI commands, flags, config reference |
| Wrangler config schema | node_modules/wrangler/config-schema.json |
Config fields, binding shapes, allowed values |
| Cloudflare docs | Search tool or https://developers.cloudflare.com/workers/ |
API reference, compatibility dates/flags |
FIRST: Check if
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
skills/wrangler/SKILL.md