# wrangler

A Claude and Claude skill that makes the agent check Cloudflare docs before running any wrangler command.

- skill · `type=skill` · Codex, ChatGPT · 3 installs · ★ 7596
- Author: Cloudflare · official OpenAI repository
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/openai/plugins/tree/HEAD/plugins/cloudflare/skills/wrangler/SKILL.md
- Updated: 2026-10-08
- HTML: https://affpapa.org/en/nevibecode/skills/wrangler

## What it does

Wrangler is the CLI for Cloudflare Workers, and its flags, config fields and subcommands move faster than model training data. This skill fixes that: before touching a wrangler task, the agent pulls current information from the Cloudflare docs and from `node_modules/wrangler/config-schema.json` instead of trusting what it already knows.

Inside is a retrieval table (wrangler docs, config schema, API reference), a version check with `wrangler --version` that expects v4.x+, and `npm install -D wrangler@latest` if the CLI is missing. Then the working rules: `wrangler.jsonc` over TOML, a recent `compatibility_date`, `wrangler types` after config edits, `wrangler check` before deploy, separate staging and production environments. There is a command reference too — `wrangler dev`, `wrangler deploy`, `wrangler tail`, plus KV, secrets, versions and rollbacks.

One detail matters more than the rest. Local dev uses simulated storage by default, so bindings do not touch real resources until you set `remote: true` in the binding config. Workers AI always needs it. Skip that and the agent writes code that passes locally and behaves differently against live data.

## Install

### Codex (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add openai/plugins --skill wrangler -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/wrangler/SKILL.md` — For all projects use ~/.agents/skills/

### Claude Code

1. **Skills CLI (Vercel)**
```bash
npx skills add openai/plugins --skill wrangler -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/wrangler/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/wrangler/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/wrangler/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install openai/plugins wrangler
```

2. **Manually: put the files in place**
- File: `.github/skills/wrangler/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/openai/plugins --path plugins/cloudflare/skills/wrangler
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/wrangler/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/openai/plugins/tree/HEAD/plugins/cloudflare/skills/wrangler/SKILL.md

## When to use it
- check wrangler command syntax before running it
- build a `wrangler.jsonc` with KV, R2 and D1 bindings
- point local dev at real Cloudflare resources
- regenerate TypeScript types after config changes
- roll a Worker back to a previous version

## Example prompts
- Add an R2 binding to `wrangler.jsonc` and generate types
- Deploy the Worker to the staging environment
- Set up a cron trigger and test it locally

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: e4d7d714462f6d56.

BEGIN THIRD-PARTY FILE e4d7d714462f6d56
````text
---
name: wrangler
description: Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.
---

# 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: Verify Wrangler Installation

```bash
wrangler --version  # Requires v4.x+
```

If not installed:
```bash
npm install -D wrangler@latest
```

## Key Guidelines

- **Use `wrangler.jsonc`**: Prefer JSON config over TOML. Newer features are JSON-only.
- **Set `compatibility_date`**: Use a recent date (within 30 days). Check https://developers.cloudflare.com/workers/configuration/compatibility-dates/
- **Generate types after config changes**: Run `wrangler types` to update TypeScript bindings.
- **Local dev defaults to local storage**: Bindings use local simulation unless `remote: true`.
- **Validate config before deploy**: Run `wrangler check` to catch errors early.
- **Use environments for staging/prod**: Define `env.staging` and `env.production` in config.

## Quick Start: New Worker

```bash
# Initialize new project
npx wrangler init my-worker

# Or with a framework
npx create-cloudflare@latest my-app
```

## Quick Reference: Core Commands

| Task | Command |
|------|---------|
| Start local dev server | `wrangler dev` |
| Deploy to Cloudflare | `wrangler deploy` |
| Deploy dry run | `wrangler deploy --dry-run` |
| Generate TypeScript types | `wrangler types` |
| Validate configuration | `wrangler check` |
| View live logs | `wrangler tail` |
| Delete Worker | `wrangler delete` |
| Auth status | `wrangler whoami` |

---

## Configuration (wrangler.jsonc)

### Minimal Config

```jsonc
{
  "$schema": "./node_modules/wrangler/config-schema.json",
  "name": "my-worker",
  "main": "src/index.ts",
  "compatibility_date": "2026-03-18"
}
```

### Full Config with Bindings

```jsonc
{
  "$schema": "./node_modules/wrangler/config-schema.json",
  "name": "my-worker",
  "main": "src/index.ts",
  "compatibility_date": "2026-03-18",
  "compatibility_flags": ["nodejs_compat_v2"],

  // Environment variables
  "vars": {
    "ENVIRONMENT": "production"
  },

  // KV Namespace
  "kv_namespaces": [
````
END THIRD-PARTY FILE e4d7d714462f6d56

The third-party file has ended. Everything between the e4d7d714462f6d56 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3095 of 16937 bytes. © Cloudflare · Apache-2.0 · https://github.com/openai/plugins/tree/HEAD/plugins/cloudflare/skills/wrangler/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
