wrangler

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

Updated Oct 15, 2019
One-click install
npx skills add https://github.com/kkkaoru/dotfiles --skill wrangler-kkkaoru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wrangler
Source: https://github.com/kkkaoru/dotfiles/tree/main/.agents/skills-stroage/wrangler
Command: npx skills add https://github.com/kkkaoru/dotfiles --skill wrangler-kkkaoru

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires wrangler.

What problem does it solve? Wrangler CLI flags, config fields, and binding shapes change frequently, so relying on memorized knowledge leads to outdated commands and broken Cloudflare Workers configurations. This Skill forces retrieval from current Cloudflare docs and the local config schema before writing or reviewing any Wrangler command. ## Core Features & Use Cases - Full CLI command reference: Covers dev, deploy, types, tail, rollback, secrets, and startup profiling for Workers. - Binding configuration guidance: Provides wrangler.jsonc examples for KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Queues, Containers, Workflows, Pipelines, and Secrets Store. - Safe secrets handling: Enforces interactive prompts and file-based input for secrets instead of passing values as CLI arguments. - Use Case: You need to add a D1 database to an existing Worker. The Skill retrieves the current binding shape, writes the wrangler.jsonc entry, runs migrations, and regenerates TypeScript types with wrangler types. ## Quick Start Ask the assistant to create a new Cloudflare Worker with a KV namespace and deploy it to a staging environment using Wrangler.

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.

How do I configure D1, KV, or R2 bindings in wrangler.jsonc?

Add the binding arrays to wrangler.jsonc: `d1_databases` with database_name and database_id, `kv_namespaces` with the namespace id, or `r2_buckets` with the bucket_name. After changing config, run `wrangler types` to regenerate TypeScript bindings.

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

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

How do I set secrets in Cloudflare Workers securely?

Run `wrangler secret put API_KEY` and enter the value at the interactive prompt, or pipe from a file for CI. Never pass secret values as command arguments or echo them; use `wrangler secret bulk secrets.json` for multiple secrets.

Why is my binding undefined inside the Worker at runtime?

The binding name in your code must exactly match the binding name in wrangler.jsonc. Verify the config, then run `wrangler types` to regenerate worker-configuration.d.ts and catch mismatches at compile time.

Can I test cron triggers and bindings locally with Wrangler?

Yes. Run `wrangler dev --test-scheduled` and visit http://localhost:8787/__scheduled to trigger cron handlers. Bindings use local simulation by default; set `remote: true` on a binding to connect to real resources during local development.