wrangler

Deploy and operate Cloudflare Workers using the Wrangler CLI and wrangler.jsonc configuration.

17|1|Updated Feb 2, 2024
One-click install
npx skills add https://github.com/FormalSnake/dotfiles --skill wrangler-formalsnake
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wrangler
Source: https://github.com/FormalSnake/dotfiles/tree/main/users/kyandesutter/claude/skills/wrangler
Command: npx skills add https://github.com/FormalSnake/dotfiles --skill wrangler-formalsnake

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Wrangler setup and usage can be confusing because flags, config fields, and resource bindings change over time, leading to misconfigurations and failed deployments.

Core Features & Use Cases

  • Fast, accurate command guidance: Prioritizes retrieval from official Cloudflare/ Wrangler sources to ensure correct syntax, flags, and binding shapes.
  • Production-ready configuration patterns: Guides setting compatibility dates, using JSON config via wrangler.jsonc, defining environments (staging/production), and generating/updating TypeScript types with wrangler types.
  • End-to-end Workers lifecycle: Covers initializing projects, running local dev with correct storage/bindings, deploying (including dry runs), managing secrets safely, and performing common operational tasks like logs and startup profiling.

Use Case: You need to add KV and R2 bindings to a new Worker, run it locally with the right environment settings, and then deploy to staging with generated types so your app compiles and works as expected.

Quick Start

Start by validating your configuration and generating types for the Worker defined in your wrangler.jsonc, then deploy it to the desired environment.

Frequently Asked Questions about wrangler

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

FAQPage Schema
How do I configure Cloudflare Workers bindings in wrangler.jsonc?

Configure Cloudflare Workers bindings in wrangler.jsonc by defining resource shapes for KV, R2, D1, and Queues. Validate the configuration using the JSON $schema to ensure correct syntax and prevent failed deployments caused by outdated config fields.

What is the best way to manage secrets for Cloudflare Workers locally and in production?

Manage secrets for Cloudflare Workers by following safe secret-handling practices via the Wrangler CLI instead of hardcoding. This ensures sensitive data is securely injected into local development and staging or production environments without exposure.

How do I generate TypeScript types for Cloudflare Workers resource bindings?

Generate TypeScript types for resource bindings by running the `wrangler types` command after making changes to your wrangler.jsonc configuration. This updates type definitions so your application compiles and works as expected.

Does Wrangler support separate staging and production environments for Workers deployment?

Wrangler supports separate staging and production environments for Workers deployment through configuration in wrangler.jsonc. You can define environment-specific settings and run dry runs to validate configurations before deploying.

Why does my Cloudflare Workers deployment fail after adding R2 and KV bindings?

Cloudflare Workers deployments often fail due to outdated configuration fields or incorrect binding shapes. Retrieve the latest Wrangler documentation, set the compatibility_date, and validate your wrangler.jsonc against the $schema to fix misconfigurations.

How do I run Cloudflare Workers locally with the correct environment and storage settings?

Run Cloudflare Workers locally with correct environment and storage settings by using the Wrangler CLI for local development. Ensure your wrangler.jsonc accurately defines resource bindings and environments to mirror staging or production behavior.