{"id":80597,"plugin_id":"plugin_asdk_app_6abc2a9552748191b465859a06e90da3","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-04T12:08:22.613Z","digest":"ac5f95a3eaf8ad80a628126819dd2734bb6f6b4266bd274037882244354b83b1","against":25504,"payload":{"description":"Run or troubleshoot Wrangler CLI commands in projects that have a wrangler.jsonc, wrangler.json, or wrangler.toml file, including local development, Previews, deployment, and resource management. For new projects and projects without a Wrangler configuration file, use the cf CLI instead.","included_files":[{"relative_path":"references/skill-feedback.md","size_in_bytes":2781}],"name":"wrangler","skill_md_contents":"---\nname: wrangler\ndescription: Run or troubleshoot Wrangler CLI commands in projects that have a wrangler.jsonc, wrangler.json, or wrangler.toml file, including local development, Previews, deployment, and resource management. For new projects and projects without a Wrangler configuration file, use the cf CLI instead.\n---\n\n# Wrangler CLI\n\nUse this skill only when the project has `wrangler.jsonc`, `wrangler.json`, or `wrangler.toml` and no `cloudflare.config.ts`, or when the user asks for Wrangler. For a new project, a project with `cloudflare.config.ts`, or a project with no Cloudflare configuration, use the Cloudflare CLI (`cf`) instead: load the `cf-cli` skill if it is installed, or follow [Use cf with coding agents](https://developers.cloudflare.com/cf/agents/index.md). Do not add Wrangler to those projects.\n\nUse the project's Wrangler version and retrieve the relevant documentation before writing commands or configuration. CLI flags and configuration fields change; do not rely on memorized examples.\n\n## Inspect the Project\n\n- Find the package manager, installed Wrangler version, package scripts, framework, and Wrangler config. Run commands through the project's scripts or package manager so they use its local version. Install dependencies using the existing lockfile when needed; do not silently upgrade Wrangler to match current docs. If the project has a Wrangler configuration file but Wrangler is not a dependency, follow the [installation guide](https://developers.cloudflare.com/workers/wrangler/install-and-update/index.md) to add it locally.\n- Identify the config used by the build or deploy command, including framework-generated config. Edit its source rather than generated output.\n- Establish the target account, Worker, environment, and resource before running commands that change them. For data operations, determine whether the target is local or remote.\n\n## Retrieve What the Task Needs\n\nUse the Cloudflare MCP `docs` tool if available, or fetch the relevant linked page directly. Follow links to the specific command or product involved; avoid loading the entire reference. If a page moves, rediscover it through the [Wrangler command index](https://developers.cloudflare.com/workers/wrangler/commands/index.md) or Cloudflare docs search.\n\n| Task | Source |\n| --- | --- |\n| Discover commands and flags, including resource management, deployments, rollback, and diagnostics | Project-local `wrangler --help` and `wrangler <command> --help`; [command reference](https://developers.cloudflare.com/workers/wrangler/commands/index.md) |\n| Edit config or add a binding | Installed `wrangler/config-schema.json` (usually under `node_modules`); [configuration reference](https://developers.cloudflare.com/workers/wrangler/configuration/index.md) |\n| Deploy a framework application | [Framework guides](https://developers.cloudflare.com/workers/framework-guides/index.md); follow the guide for the project's existing framework and adapter |\n| Migrate an application to Workers when requested | [Pages to Workers](https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/index.md); [Vercel to Workers](https://developers.cloudflare.com/workers/static-assets/migration-guides/vercel-to-workers/index.md) |\n| Configure staging or production | [Environments](https://developers.cloudflare.com/workers/wrangler/environments/index.md) |\n| Set secrets locally, in CI, or on a deployed Worker | [Secrets](https://developers.cloudflare.com/workers/configuration/secrets/index.md) |\n| Generate binding and runtime types | [TypeScript](https://developers.cloudflare.com/workers/languages/typescript/index.md) |\n| Run locally or choose a testing approach | [Local development](https://developers.cloudflare.com/workers/local-development/index.md); [testing](https://developers.cloudflare.com/workers/testing/index.md) |\n| Choose roles, scopes, or API token permissions for Wrangler | [Roles and permissions](https://developers.cloudflare.com/workers/authorization/index.md); [Workers roles and permissions](https://developers.cloudflare.com/workers/authorization/workers/index.md#wrangler) |\n| Create or manage a branch or pull request environment | [Previews overview](https://developers.cloudflare.com/workers/previews/index.md); [get started](https://developers.cloudflare.com/workers/previews/get-started/index.md); [configuration](https://developers.cloudflare.com/workers/previews/configuration/index.md) |\n| Decide whether Preview resources are isolated or shared | [Resources and isolation](https://developers.cloudflare.com/workers/previews/resources/index.md), including its current limitations |\n| Configure Preview URLs, access, debugging, or CI | [Custom domains](https://developers.cloudflare.com/workers/previews/custom-domains/index.md); [test and debug](https://developers.cloudflare.com/workers/previews/test-and-debug/index.md); [examples](https://developers.cloudflare.com/workers/previews/examples/index.md) |\n| Choose between Previews, Version URLs, and Wrangler environments | [Compare workflows](https://developers.cloudflare.com/workers/previews/compare-workflows/index.md) |\n| Diagnose authentication or select an account | [General commands](https://developers.cloudflare.com/workers/wrangler/commands/general/index.md), including `whoami`; [authentication profiles](https://developers.cloudflare.com/workers/wrangler/profiles/index.md) |\n| Deploy an unauthenticated prototype | [Claim deployments](https://developers.cloudflare.com/workers/platform/claim-deployments/index.md) for eligibility, expiry, and claim URL handling; use a permanent account for production or CI |\n\nUse installed help and schema to check whether documented features exist in the project's version. If a required feature needs an upgrade, make that dependency explicit. If retrieval is unavailable, state the gap and use available local evidence rather than inventing syntax.\n\n## Apply the Change\n\n- Prefer `wrangler.jsonc` for new config. Set a new project's [compatibility date](https://developers.cloudflare.com/workers/configuration/compatibility-dates/index.md) to today; review runtime changes and test when advancing an existing project's date. Preserve existing project conventions and avoid incidental format migrations.\n- Check environment inheritance before adding bindings or variables. Some fields must be specified separately for each environment; a working default config does not establish that staging is configured.\n- With the Cloudflare Vite plugin, select the environment via `CLOUDFLARE_ENV` at dev or build time. Deploy the resulting build; setting an environment at deploy time does not retarget its flattened config. See [Vite environments](https://developers.cloudflare.com/workers/vite-plugin/reference/cloudflare-environments/index.md).\n- Reconcile dashboard changes with the config before deploying: Wrangler can overwrite dashboard variables and routes. When binding existing resources, verify their identifiers; omitted identifiers can trigger [automatic provisioning](https://developers.cloudflare.com/workers/wrangler/configuration/index.md#automatic-provisioning).\n- Distinguish local simulation from remote bindings during development. A locally running Worker can still access real resources; check the selected bindings before testing writes.\n- Before a remote command, identify the authenticated member or API token and retrieve the current role and scope required for the exact operation. Prefer the narrowest scope that satisfies the user's intent. The `wrangler login` OAuth flow does not support granular authorization; use an account-owned API token when granular access is required, and never ask the user to paste its value into chat.\n- Keep secret values out of command arguments, source code, and logs. Use the documented interactive input or protected file/stdin mechanism for the command. Local secret files must be ignored by version control and are not automatically uploaded as deployed secrets. For missing local secrets, check file precedence and any `secrets.required` declaration in the secrets docs.\n- Treat `wrangler secret put` and `secret delete` as deployments: they create a version and deploy it immediately. Use the documented `wrangler versions secret` workflow when the change must be staged.\n- Before a rollback, check [rollback limitations](https://developers.cloudflare.com/workers/versions-and-deployments/rollbacks/index.md): connected resources and their data are not rolled back with Worker code.\n\n## Work with Workers Previews\n\n- Workers Previews requires project-local Wrangler 4.135.0 or later; project commands do not use a newer global installation. Check the project's pinned version and make any required dependency upgrade explicit.\n- Use Previews for branch and pull request environments under the same Worker. Use Version URLs to inspect a specific uploaded version with production resources, and Wrangler environments for persistent, separately deployed Workers. Follow [Compare workflows](https://developers.cloudflare.com/workers/previews/compare-workflows/index.md) rather than adapting an older aliased Version URL workflow.\n- First inspect how the user manages production configuration and deployments. Configure Preview domains through the same configuration system as production, such as Wrangler, the dashboard, or Terraform. Run Preview deployments through the user's existing path, such as the local CLI, Workers Builds, or external CI, unless the user requests a different workflow. Mirror the management approach, not production resource bindings or data.\n- Before deploying, follow the current [configuration placement table](https://developers.cloudflare.com/workers/previews/configuration/index.md#what-goes-in-the-previews-block) and [resource matrix and limitations](https://developers.cloudflare.com/workers/previews/resources/index.md). Do not infer isolation from the Preview name or allow writes to production resources unless the user explicitly intends to share them.\n- Tell the user that Preview URLs are public unless access controls are configured, then let them decide whether to protect the URLs. Follow the [custom domain and access guidance](https://developers.cloudflare.com/workers/previews/custom-domains/index.md) for the chosen setup.\n- Confirm which Worker or Wrangler environment the user intends to target. When targeting a Wrangler environment, pass the same `--env` value to every Preview command; omitting it targets the top-level Worker.\n\n## Validate\n\nAfter changing config or bindings in a TypeScript project, regenerate types with the project's `wrangler types` command rather than hand-editing generated declarations. Run the relevant existing typecheck or tests.\n\nFor deployment changes, use the project's build workflow and `wrangler deploy --dry-run` where supported, with the intended config and environment. A successful dry run checks the build and packaging; it does not prove remote resources or runtime behavior work. Use task-specific local or remote checks as appropriate to the requested work.\n\nFor Previews, a returned URL does not validate behavior that depends on bindings Wrangler reports as missing. Validate the behavior the user requested, using Preview-specific logs and configuration when needed. Writes to production resources, destructive testing, and deletion of named Previews must match the user's explicit intent.\n\nReport what changed, the target environment, checks performed, and any unresolved validation gaps. Link the documentation used when the result depends on current command or configuration behavior.\n\n## Skill feedback\n\nIf the user reports that this skill gave incorrect or outdated guidance, or is missing information, read [references/skill-feedback.md](references/skill-feedback.md).\n"},"changes":[{"path":"/description","type":"changed","before":"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.","after":"Run or troubleshoot Wrangler CLI commands in projects that have a wrangler.jsonc, wrangler.json, or wrangler.toml file, including local development, Previews, deployment, and resource management. For new projects and projects without a Wrangler configuration file, use the cf CLI instead."},{"path":"/included_files","type":"changed","before":[],"after":[{"relative_path":"references/skill-feedback.md","size_in_bytes":2781}]},{"path":"/skill_md_contents","type":"changed","before":"---\nname: wrangler\ndescription: 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.\n---\n\n# Wrangler CLI\n\nYour knowledge of Wrangler CLI flags, config fields, and subcommands may be outdated. **Prefer retrieval over pre-training** for any Wrangler task.\n\n## Retrieval Sources\n\nFetch 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.\n\n| Source | How to retrieve | Use for |\n|--------|----------------|---------|\n| Wrangler docs | `https://developers.cloudflare.com/workers/wrangler/` | CLI commands, flags, config reference |\n| Wrangler config schema | `node_modules/wrangler/config-schema.json` | Config fields, binding shapes, allowed values |\n| Cloudflare docs | Search tool or `https://developers.cloudflare.com/workers/` | API reference, compatibility dates/flags |\n\n## FIRST: Check if Wrangler is installed, and if not, install it\n\nCheck if Wrangler is installed by running:\n\n```bash\nwrangler --version  # Requires v4.x+\n```\n\nIf Wrangler is not installed, you should install it by running:\n\n```bash\nnpm install -D wrangler@latest\n```\n\nWherever possible, you should use Wrangler instead of manually constructing API requests.\n\n## Key Guidelines\n\n- **Use `wrangler.jsonc`**: Prefer JSON config over TOML. Newer features are JSON-only.\n- **Set `compatibility_date`**: Use a recent date (within 30 days). Check https://developers.cloudflare.com/workers/configuration/compatibility-dates/\n- **Generate types after config changes**: Run `wrangler types` to update TypeScript bindings.\n- **Local dev defaults to local storage**: Bindings use local simulation unless `remote: true`.\n- **Profile Worker startup**: Run `wrangler check startup` to measure startup time and detect scripts that exceed the startup time limit.\n- **Use environments for staging/prod**: Define `env.staging` and `env.production` in config.\n\n## Quick Start: New Worker\n\n```bash\n# Initialize new project\nnpx wrangler init my-worker\n\n# Or with a framework\nnpx create-cloudflare@latest my-app\n```\n\n## Quick Reference: Core Commands\n\n| Task | Command |\n|------|---------|\n| Start local dev server | `wrangler dev` |\n| Deploy to Cloudflare | `wrangler deploy` |\n| Deploy dry run | `wrangler deploy --dry-run` |\n| Generate TypeScript types | `wrangler types` |\n| Profile Worker startup time | `wrangler check startup` |\n| View live logs | `wrangler tail` |\n| Delete Worker | `wrangler delete` |\n| Auth status | `wrangler whoami` |\n\n---\n\n## Configuration (wrangler.jsonc)\n\n### Minimal Config\n\n```jsonc\n{\n  \"$schema\": \"./node_modules/wrangler/config-schema.json\",\n  \"name\": \"my-worker\",\n  \"main\": \"src/index.ts\",\n  \"compatibility_date\": \"2026-01-01\"\n}\n```\n\n### Full Config with Bindings\n\n```jsonc\n{\n  \"$schema\": \"./node_modules/wrangler/config-schema.json\",\n  \"name\": \"my-worker\",\n  \"main\": \"src/index.ts\",\n  \"compatibility_date\": \"2026-01-01\",\n  \"compatibility_flags\": [\"nodejs_compat\"],\n\n  // Environment variables\n  \"vars\": {\n    \"ENVIRONMENT\": \"production\"\n  },\n\n  // KV Namespace\n  \"kv_namespaces\": [\n    { \"binding\": \"KV\", \"id\": \"<KV_NAMESPACE_ID>\" }\n  ],\n\n  // R2 Bucket\n  \"r2_buckets\": [\n    { \"binding\": \"BUCKET\", \"bucket_name\": \"my-bucket\" }\n  ],\n\n  // D1 Database\n  \"d1_databases\": [\n    { \"binding\": \"DB\", \"database_name\": \"my-db\", \"database_id\": \"<DB_ID>\" }\n  ],\n\n  // Workers AI (always remote)\n  \"ai\": { \"binding\": \"AI\" },\n\n  // Vectorize\n  \"vectorize\": [\n    { \"binding\": \"VECTOR_INDEX\", \"index_name\": \"my-index\" }\n  ],\n\n  // Hyperdrive\n  \"hyperdrive\": [\n    { \"binding\": \"HYPERDRIVE\", \"id\": \"<HYPERDRIVE_ID>\" }\n  ],\n\n  // Durable Objects\n  \"durable_objects\": {\n    \"bindings\": [\n      { \"name\": \"COUNTER\", \"class_name\": \"Counter\" }\n    ]\n  },\n\n  // Cron triggers\n  \"triggers\": {\n    \"crons\": [\"0 * * * *\"]\n  },\n\n  // Environments\n  \"env\": {\n    \"staging\": {\n      \"name\": \"my-worker-staging\",\n      \"vars\": { \"ENVIRONMENT\": \"staging\" }\n    }\n  }\n}\n```\n\n### Generate Types from Config\n\n```bash\n# Generate worker-configuration.d.ts\nwrangler types\n\n# Custom output path\nwrangler types ./src/env.d.ts\n\n# Check types are up to date (CI)\nwrangler types --check\n```\n\n---\n\n## Local Development\n\n### Start Dev Server\n\n```bash\n# Local mode (default) - uses local storage simulation\nwrangler dev\n\n# With specific environment\nwrangler dev --env staging\n\n# Force local-only (disable remote bindings)\nwrangler dev --local\n\n# Remote mode - runs on Cloudflare edge (legacy)\nwrangler dev --remote\n\n# Custom port\nwrangler dev --port 8787\n\n# Live reload for HTML changes\nwrangler dev --live-reload\n\n# Test scheduled/cron handlers\nwrangler dev --test-scheduled\n# Then visit: http://localhost:8787/__scheduled\n```\n\n### Remote Bindings for Local Dev\n\nUse `remote: true` in binding config to connect to real resources while running locally:\n\n```jsonc\n{\n  \"r2_buckets\": [\n    { \"binding\": \"BUCKET\", \"bucket_name\": \"my-bucket\", \"remote\": true }\n  ],\n  \"ai\": { \"binding\": \"AI\", \"remote\": true },\n  \"vectorize\": [\n    { \"binding\": \"INDEX\", \"index_name\": \"my-index\", \"remote\": true }\n  ]\n}\n```\n\n**Recommended remote bindings**: AI (required), Vectorize, Browser Rendering, mTLS, Images.\n\n### Local Secrets\n\nCreate `.dev.vars` for local development secrets:\n\n```\nAPI_KEY=local-dev-key\nDATABASE_URL=postgres://localhost:5432/dev\n```\n\n---\n\n## Deployment\n\n### Deploy Worker\n\n```bash\n# Deploy to production\nwrangler deploy\n\n# Deploy specific environment\nwrangler deploy --env staging\n\n# Dry run (validate without deploying)\nwrangler deploy --dry-run\n\n# Keep dashboard-set variables\nwrangler deploy --keep-vars\n\n# Minify code\nwrangler deploy --minify\n```\n\n### Manage Secrets\n\n> **Security**: Never pass secret values as command arguments or pipe them via `echo`.\n> Use the interactive prompt (preferred), pipe from a file, or use `secret bulk`.\n> Never output, log, or hardcode secret values in commands.\n\n```bash\n# Set secret — interactive prompt (preferred, wrangler will ask for the value securely)\nwrangler secret put API_KEY\n\n# Set secret from a file (useful for PEM keys, CI environments)\nwrangler secret put PRIVATE_KEY < path/to/private-key.pem\n\n# List secrets\nwrangler secret list\n\n# Delete secret\nwrangler secret delete API_KEY\n\n# Bulk secrets from JSON file (do not commit this file to version control)\nwrangler secret bulk secrets.json\n```\n\n### Versions and Rollback\n\n```bash\n# List recent versions\nwrangler versions list\n\n# View specific version\nwrangler versions view <VERSION_ID>\n\n# Rollback to previous version\nwrangler rollback\n\n# Rollback to specific version\nwrangler rollback <VERSION_ID>\n```\n\n---\n\n## KV (Key-Value Store)\n\n### Manage Namespaces\n\n```bash\n# Create namespace\nwrangler kv namespace create MY_KV\n\n# List namespaces\nwrangler kv namespace list\n\n# Delete namespace\nwrangler kv namespace delete --namespace-id <ID>\n```\n\n### Manage Keys\n\n```bash\n# Put value\nwrangler kv key put --namespace-id <ID> \"key\" \"value\"\n\n# Put with expiration (seconds)\nwrangler kv key put --namespace-id <ID> \"key\" \"value\" --expiration-ttl 3600\n\n# Get value\nwrangler kv key get --namespace-id <ID> \"key\"\n\n# List keys\nwrangler kv key list --namespace-id <ID>\n\n# Delete key\nwrangler kv key delete --namespace-id <ID> \"key\"\n\n# Bulk put from JSON\nwrangler kv bulk put --namespace-id <ID> data.json\n```\n\n### Config Binding\n\n```jsonc\n{\n  \"kv_namespaces\": [\n    { \"binding\": \"CACHE\", \"id\": \"<NAMESPACE_ID>\" }\n  ]\n}\n```\n\n---\n\n## R2 (Object Storage)\n\n### Manage Buckets\n\n```bash\n# Create bucket\nwrangler r2 bucket create my-bucket\n\n# Create with location hint\nwrangler r2 bucket create my-bucket --location wnam\n\n# List buckets\nwrangler r2 bucket list\n\n# Get bucket info\nwrangler r2 bucket info my-bucket\n\n# Delete bucket\nwrangler r2 bucket delete my-bucket\n```\n\n### Manage Objects\n\n```bash\n# Upload object\nwrangler r2 object put my-bucket/path/file.txt --file ./local-file.txt\n\n# Download object\nwrangler r2 object get my-bucket/path/file.txt\n\n# Delete object\nwrangler r2 object delete my-bucket/path/file.txt\n```\n\n### Config Binding\n\n```jsonc\n{\n  \"r2_buckets\": [\n    { \"binding\": \"ASSETS\", \"bucket_name\": \"my-bucket\" }\n  ]\n}\n```\n\n---\n\n## D1 (SQL Database)\n\n### Manage Databases\n\n```bash\n# Create database\nwrangler d1 create my-database\n\n# Create with location\nwrangler d1 create my-database --location wnam\n\n# List databases\nwrangler d1 list\n\n# Get database info\nwrangler d1 info my-database\n\n# Delete database\nwrangler d1 delete my-database\n```\n\n### Execute SQL\n\n```bash\n# Execute SQL command (remote)\nwrangler d1 execute my-database --remote --command \"SELECT * FROM users\"\n\n# Execute SQL file (remote)\nwrangler d1 execute my-database --remote --file ./schema.sql\n\n# Execute locally\nwrangler d1 execute my-database --local --command \"SELECT * FROM users\"\n```\n\n### Migrations\n\n```bash\n# Create migration\nwrangler d1 migrations create my-database create_users_table\n\n# List pending migrations\nwrangler d1 migrations list my-database --local\n\n# Apply migrations locally\nwrangler d1 migrations apply my-database --local\n\n# Apply migrations to remote\nwrangler d1 migrations apply my-database --remote\n```\n\n### Export/Backup\n\n```bash\n# Export schema and data\nwrangler d1 export my-database --remote --output backup.sql\n\n# Export schema only\nwrangler d1 export my-database --remote --output schema.sql --no-data\n```\n\n### Config Binding\n\n```jsonc\n{\n  \"d1_databases\": [\n    {\n      \"binding\": \"DB\",\n      \"database_name\": \"my-database\",\n      \"database_id\": \"<DATABASE_ID>\",\n      \"migrations_dir\": \"./migrations\"\n    }\n  ]\n}\n```\n\n---\n\n## Vectorize (Vector Database)\n\n### Manage Indexes\n\n```bash\n# Create index with dimensions\nwrangler vectorize create my-index --dimensions 768 --metric cosine\n\n# Create with preset (auto-configures dimensions/metric)\nwrangler vectorize create my-index --preset @cf/baai/bge-base-en-v1.5\n\n# List indexes\nwrangler vectorize list\n\n# Get index info\nwrangler vectorize get my-index\n\n# Delete index\nwrangler vectorize delete my-index\n```\n\n### Manage Vectors\n\n```bash\n# Insert vectors from NDJSON file\nwrangler vectorize insert my-index --file vectors.ndjson\n\n# Query vectors\nwrangler vectorize query my-index --vector \"[0.1, 0.2, ...]\" --top-k 10\n```\n\n### Config Binding\n\n```jsonc\n{\n  \"vectorize\": [\n    { \"binding\": \"SEARCH_INDEX\", \"index_name\": \"my-index\" }\n  ]\n}\n```\n\n---\n\n## Hyperdrive (Database Accelerator)\n\n### Manage Configs\n\n```bash\n# Create config\nwrangler hyperdrive create my-hyperdrive \\\n  --origin-host db.example.com \\\n  --origin-port 5432 \\\n  --database my-database \\\n  --origin-user db-user \\\n  --origin-password \"$DB_PASSWORD\"\n\n# Or using a connection string from an environment variable\nwrangler hyperdrive create my-hyperdrive \\\n  --connection-string \"$HYPERDRIVE_CONNECTION_STRING\"\n\n# List configs\nwrangler hyperdrive list\n\n# Get config details\nwrangler hyperdrive get <HYPERDRIVE_ID>\n\n# Update config\nwrangler hyperdrive update <HYPERDRIVE_ID> \\\n  --origin-password \"$DB_PASSWORD\"\n\n# Delete config\nwrangler hyperdrive delete <HYPERDRIVE_ID>\n```\n\n### Config Binding\n\n```jsonc\n{\n  \"compatibility_flags\": [\"nodejs_compat\"],\n  \"hyperdrive\": [\n    { \"binding\": \"HYPERDRIVE\", \"id\": \"<HYPERDRIVE_ID>\" }\n  ]\n}\n```\n\n---\n\n## Workers AI\n\n### List Models\n\n```bash\n# List available models\nwrangler ai models\n\n# List finetunes\nwrangler ai finetune list\n```\n\n### Config Binding\n\n```jsonc\n{\n  \"ai\": { \"binding\": \"AI\" }\n}\n```\n\n**Note**: Workers AI always runs remotely and incurs usage charges even in local dev.\n\n---\n\n## Queues\n\n### Manage Queues\n\n```bash\n# Create queue\nwrangler queues create my-queue\n\n# List queues\nwrangler queues list\n\n# Delete queue\nwrangler queues delete my-queue\n\n# Add consumer to queue\nwrangler queues consumer add my-queue my-worker\n\n# Remove consumer\nwrangler queues consumer remove my-queue my-worker\n```\n\n### Config Binding\n\n```jsonc\n{\n  \"queues\": {\n    \"producers\": [\n      { \"binding\": \"MY_QUEUE\", \"queue\": \"my-queue\" }\n    ],\n    \"consumers\": [\n      {\n        \"queue\": \"my-queue\",\n        \"max_batch_size\": 10,\n        \"max_batch_timeout\": 30\n      }\n    ]\n  }\n}\n```\n\n---\n\n## Containers\n\n### Build and Push Images\n\n```bash\n# Build container image\nwrangler containers build -t my-app:latest .\n\n# Build and push in one command\nwrangler containers build -t my-app:latest . --push\n\n# Push existing image to Cloudflare registry\nwrangler containers push my-app:latest\n```\n\n### Manage Containers\n\n```bash\n# List containers\nwrangler containers list\n\n# Get container info\nwrangler containers info <CONTAINER_ID>\n\n# Delete container\nwrangler containers delete <CONTAINER_ID>\n```\n\n### Manage Images\n\n```bash\n# List images in registry\nwrangler containers images list\n\n# Delete image\nwrangler containers images delete my-app:latest\n```\n\n### Manage External Registries\n\n> **Security**: Never hardcode registry credentials in commands. Use environment variables.\n\n```bash\n# List configured registries\nwrangler containers registries list\n\n# Configure external registry (e.g., ECR)\nwrangler containers registries configure <DOMAIN> \\\n  --aws-access-key-id \"$AWS_ACCESS_KEY_ID\"\n\n# Configure DockerHub\nwrangler containers registries configure <DOMAIN> \\\n  --dockerhub-username \"$DOCKERHUB_USERNAME\"\n\n# Delete registry configuration\nwrangler containers registries delete <DOMAIN>\n```\n\n---\n\n## Workflows\n\n### Manage Workflows\n\n```bash\n# List workflows\nwrangler workflows list\n\n# Describe workflow\nwrangler workflows describe my-workflow\n\n# Trigger workflow instance\nwrangler workflows trigger my-workflow\n\n# Trigger with parameters\nwrangler workflows trigger my-workflow --params '{\"key\": \"value\"}'\n\n# Delete workflow\nwrangler workflows delete my-workflow\n```\n\n### Manage Workflow Instances\n\n```bash\n# List instances\nwrangler workflows instances list my-workflow\n\n# Describe instance\nwrangler workflows instances describe my-workflow <INSTANCE_ID>\n\n# Terminate instance\nwrangler workflows instances terminate my-workflow <INSTANCE_ID>\n```\n\n### Config Binding\n\n```jsonc\n{\n  \"workflows\": [\n    {\n      \"binding\": \"MY_WORKFLOW\",\n      \"name\": \"my-workflow\",\n      \"class_name\": \"MyWorkflow\"\n    }\n  ]\n}\n```\n\n---\n\n## Pipelines\n\n### Manage Pipelines\n\n```bash\n# Create pipeline\nwrangler pipelines create my-pipeline --r2 my-bucket\n\n# List pipelines\nwrangler pipelines list\n\n# Show pipeline details\nwrangler pipelines show my-pipeline\n\n# Update pipeline\nwrangler pipelines update my-pipeline --batch-max-mb 100\n\n# Delete pipeline\nwrangler pipelines delete my-pipeline\n```\n\n### Config Binding\n\n```jsonc\n{\n  \"pipelines\": [\n    { \"binding\": \"MY_PIPELINE\", \"pipeline\": \"my-pipeline\" }\n  ]\n}\n```\n\n---\n\n## Secrets Store\n\n### Manage Stores\n\n```bash\n# Create store\nwrangler secrets-store store create my-store\n\n# List stores\nwrangler secrets-store store list\n\n# Delete store\nwrangler secrets-store store delete <STORE_ID>\n```\n\n### Manage Secrets in Store\n\n```bash\n# Add secret to store\nwrangler secrets-store secret put <STORE_ID> my-secret\n\n# List secrets in store\nwrangler secrets-store secret list <STORE_ID>\n\n# Get secret\nwrangler secrets-store secret get <STORE_ID> my-secret\n\n# Delete secret from store\nwrangler secrets-store secret delete <STORE_ID> my-secret\n```\n\n### Config Binding\n\n```jsonc\n{\n  \"secrets_store_secrets\": [\n    {\n      \"binding\": \"MY_SECRET\",\n      \"store_id\": \"<STORE_ID>\",\n      \"secret_name\": \"my-secret\"\n    }\n  ]\n}\n```\n\n---\n\n## Pages (Frontend Deployment)\n\n```bash\n# Create Pages project\nwrangler pages project create my-site\n\n# Deploy directory to Pages\nwrangler pages deploy ./dist\n\n# Deploy with specific branch\nwrangler pages deploy ./dist --branch main\n\n# List deployments\nwrangler pages deployment list --project-name my-site\n```\n\n---\n\n## Observability\n\n### Tail Logs\n\n```bash\n# Stream live logs\nwrangler tail\n\n# Tail specific Worker\nwrangler tail my-worker\n\n# Filter by status\nwrangler tail --status error\n\n# Filter by search term\nwrangler tail --search \"error\"\n\n# JSON output\nwrangler tail --format json\n```\n\n### Config Logging\n\n```jsonc\n{\n  \"observability\": {\n    \"enabled\": true,\n    \"head_sampling_rate\": 1\n  }\n}\n```\n\n---\n\n## Testing\n\n### Local Testing with Vitest\n\n```bash\nnpm install -D @cloudflare/vitest-pool-workers vitest\n```\n\n`vitest.config.ts`:\n```typescript\nimport { defineWorkersConfig } from \"@cloudflare/vitest-pool-workers/config\";\n\nexport default defineWorkersConfig({\n  test: {\n    poolOptions: {\n      workers: {\n        wrangler: { configPath: \"./wrangler.jsonc\" },\n      },\n    },\n  },\n});\n```\n\n### Test Scheduled Events\n\n```bash\n# Enable in dev\nwrangler dev --test-scheduled\n\n# Trigger via HTTP\ncurl http://localhost:8787/__scheduled\n```\n\n---\n\n## Troubleshooting\n\n### Common Issues\n\n| Issue | Solution |\n|-------|----------|\n| `command not found: wrangler` | Install: `npm install -D wrangler` |\n| Auth errors | Run `wrangler login` |\n| Startup time limit exceeded | Run `wrangler check startup` to profile startup and generate CPU profiles |\n| Type errors after config change | Run `wrangler types` |\n| Local storage not persisting | Check `.wrangler/state` directory |\n| Binding undefined in Worker | Verify binding name matches config exactly |\n\n### Debug Commands\n\n```bash\n# Check auth status\nwrangler whoami\n\n# Profile Worker startup time\nwrangler check startup\n\n# View config schema\nwrangler docs configuration\n```\n\n---\n\n## Best Practices\n\n1. **Version control `wrangler.jsonc`**: Treat as source of truth for Worker config.\n2. **Use automatic provisioning**: Omit resource IDs for auto-creation on deploy.\n3. **Run `wrangler types` in CI**: Add to build step to catch binding mismatches.\n4. **Use environments**: Separate staging/production with `env.staging`, `env.production`.\n5. **Set `compatibility_date`**: Update quarterly to get new runtime features.\n6. **Use `.dev.vars` for local secrets**: Never commit secrets to config.\n7. **Test locally first**: `wrangler dev` with local bindings before deploying.\n8. **Use `--dry-run` before major deploys**: Validate changes without deployment.\n9. **Never embed secrets in commands**: Use interactive prompts (`wrangler secret put`), file-based input (`wrangler secret bulk`), or secure CI environment variables. Never echo, log, or pass secret values as CLI arguments.\n","after":"---\nname: wrangler\ndescription: Run or troubleshoot Wrangler CLI commands in projects that have a wrangler.jsonc, wrangler.json, or wrangler.toml file, including local development, Previews, deployment, and resource management. For new projects and projects without a Wrangler configuration file, use the cf CLI instead.\n---\n\n# Wrangler CLI\n\nUse this skill only when the project has `wrangler.jsonc`, `wrangler.json`, or `wrangler.toml` and no `cloudflare.config.ts`, or when the user asks for Wrangler. For a new project, a project with `cloudflare.config.ts`, or a project with no Cloudflare configuration, use the Cloudflare CLI (`cf`) instead: load the `cf-cli` skill if it is installed, or follow [Use cf with coding agents](https://developers.cloudflare.com/cf/agents/index.md). Do not add Wrangler to those projects.\n\nUse the project's Wrangler version and retrieve the relevant documentation before writing commands or configuration. CLI flags and configuration fields change; do not rely on memorized examples.\n\n## Inspect the Project\n\n- Find the package manager, installed Wrangler version, package scripts, framework, and Wrangler config. Run commands through the project's scripts or package manager so they use its local version. Install dependencies using the existing lockfile when needed; do not silently upgrade Wrangler to match current docs. If the project has a Wrangler configuration file but Wrangler is not a dependency, follow the [installation guide](https://developers.cloudflare.com/workers/wrangler/install-and-update/index.md) to add it locally.\n- Identify the config used by the build or deploy command, including framework-generated config. Edit its source rather than generated output.\n- Establish the target account, Worker, environment, and resource before running commands that change them. For data operations, determine whether the target is local or remote.\n\n## Retrieve What the Task Needs\n\nUse the Cloudflare MCP `docs` tool if available, or fetch the relevant linked page directly. Follow links to the specific command or product involved; avoid loading the entire reference. If a page moves, rediscover it through the [Wrangler command index](https://developers.cloudflare.com/workers/wrangler/commands/index.md) or Cloudflare docs search.\n\n| Task | Source |\n| --- | --- |\n| Discover commands and flags, including resource management, deployments, rollback, and diagnostics | Project-local `wrangler --help` and `wrangler <command> --help`; [command reference](https://developers.cloudflare.com/workers/wrangler/commands/index.md) |\n| Edit config or add a binding | Installed `wrangler/config-schema.json` (usually under `node_modules`); [configuration reference](https://developers.cloudflare.com/workers/wrangler/configuration/index.md) |\n| Deploy a framework application | [Framework guides](https://developers.cloudflare.com/workers/framework-guides/index.md); follow the guide for the project's existing framework and adapter |\n| Migrate an application to Workers when requested | [Pages to Workers](https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/index.md); [Vercel to Workers](https://developers.cloudflare.com/workers/static-assets/migration-guides/vercel-to-workers/index.md) |\n| Configure staging or production | [Environments](https://developers.cloudflare.com/workers/wrangler/environments/index.md) |\n| Set secrets locally, in CI, or on a deployed Worker | [Secrets](https://developers.cloudflare.com/workers/configuration/secrets/index.md) |\n| Generate binding and runtime types | [TypeScript](https://developers.cloudflare.com/workers/languages/typescript/index.md) |\n| Run locally or choose a testing approach | [Local development](https://developers.cloudflare.com/workers/local-development/index.md); [testing](https://developers.cloudflare.com/workers/testing/index.md) |\n| Choose roles, scopes, or API token permissions for Wrangler | [Roles and permissions](https://developers.cloudflare.com/workers/authorization/index.md); [Workers roles and permissions](https://developers.cloudflare.com/workers/authorization/workers/index.md#wrangler) |\n| Create or manage a branch or pull request environment | [Previews overview](https://developers.cloudflare.com/workers/previews/index.md); [get started](https://developers.cloudflare.com/workers/previews/get-started/index.md); [configuration](https://developers.cloudflare.com/workers/previews/configuration/index.md) |\n| Decide whether Preview resources are isolated or shared | [Resources and isolation](https://developers.cloudflare.com/workers/previews/resources/index.md), including its current limitations |\n| Configure Preview URLs, access, debugging, or CI | [Custom domains](https://developers.cloudflare.com/workers/previews/custom-domains/index.md); [test and debug](https://developers.cloudflare.com/workers/previews/test-and-debug/index.md); [examples](https://developers.cloudflare.com/workers/previews/examples/index.md) |\n| Choose between Previews, Version URLs, and Wrangler environments | [Compare workflows](https://developers.cloudflare.com/workers/previews/compare-workflows/index.md) |\n| Diagnose authentication or select an account | [General commands](https://developers.cloudflare.com/workers/wrangler/commands/general/index.md), including `whoami`; [authentication profiles](https://developers.cloudflare.com/workers/wrangler/profiles/index.md) |\n| Deploy an unauthenticated prototype | [Claim deployments](https://developers.cloudflare.com/workers/platform/claim-deployments/index.md) for eligibility, expiry, and claim URL handling; use a permanent account for production or CI |\n\nUse installed help and schema to check whether documented features exist in the project's version. If a required feature needs an upgrade, make that dependency explicit. If retrieval is unavailable, state the gap and use available local evidence rather than inventing syntax.\n\n## Apply the Change\n\n- Prefer `wrangler.jsonc` for new config. Set a new project's [compatibility date](https://developers.cloudflare.com/workers/configuration/compatibility-dates/index.md) to today; review runtime changes and test when advancing an existing project's date. Preserve existing project conventions and avoid incidental format migrations.\n- Check environment inheritance before adding bindings or variables. Some fields must be specified separately for each environment; a working default config does not establish that staging is configured.\n- With the Cloudflare Vite plugin, select the environment via `CLOUDFLARE_ENV` at dev or build time. Deploy the resulting build; setting an environment at deploy time does not retarget its flattened config. See [Vite environments](https://developers.cloudflare.com/workers/vite-plugin/reference/cloudflare-environments/index.md).\n- Reconcile dashboard changes with the config before deploying: Wrangler can overwrite dashboard variables and routes. When binding existing resources, verify their identifiers; omitted identifiers can trigger [automatic provisioning](https://developers.cloudflare.com/workers/wrangler/configuration/index.md#automatic-provisioning).\n- Distinguish local simulation from remote bindings during development. A locally running Worker can still access real resources; check the selected bindings before testing writes.\n- Before a remote command, identify the authenticated member or API token and retrieve the current role and scope required for the exact operation. Prefer the narrowest scope that satisfies the user's intent. The `wrangler login` OAuth flow does not support granular authorization; use an account-owned API token when granular access is required, and never ask the user to paste its value into chat.\n- Keep secret values out of command arguments, source code, and logs. Use the documented interactive input or protected file/stdin mechanism for the command. Local secret files must be ignored by version control and are not automatically uploaded as deployed secrets. For missing local secrets, check file precedence and any `secrets.required` declaration in the secrets docs.\n- Treat `wrangler secret put` and `secret delete` as deployments: they create a version and deploy it immediately. Use the documented `wrangler versions secret` workflow when the change must be staged.\n- Before a rollback, check [rollback limitations](https://developers.cloudflare.com/workers/versions-and-deployments/rollbacks/index.md): connected resources and their data are not rolled back with Worker code.\n\n## Work with Workers Previews\n\n- Workers Previews requires project-local Wrangler 4.135.0 or later; project commands do not use a newer global installation. Check the project's pinned version and make any required dependency upgrade explicit.\n- Use Previews for branch and pull request environments under the same Worker. Use Version URLs to inspect a specific uploaded version with production resources, and Wrangler environments for persistent, separately deployed Workers. Follow [Compare workflows](https://developers.cloudflare.com/workers/previews/compare-workflows/index.md) rather than adapting an older aliased Version URL workflow.\n- First inspect how the user manages production configuration and deployments. Configure Preview domains through the same configuration system as production, such as Wrangler, the dashboard, or Terraform. Run Preview deployments through the user's existing path, such as the local CLI, Workers Builds, or external CI, unless the user requests a different workflow. Mirror the management approach, not production resource bindings or data.\n- Before deploying, follow the current [configuration placement table](https://developers.cloudflare.com/workers/previews/configuration/index.md#what-goes-in-the-previews-block) and [resource matrix and limitations](https://developers.cloudflare.com/workers/previews/resources/index.md). Do not infer isolation from the Preview name or allow writes to production resources unless the user explicitly intends to share them.\n- Tell the user that Preview URLs are public unless access controls are configured, then let them decide whether to protect the URLs. Follow the [custom domain and access guidance](https://developers.cloudflare.com/workers/previews/custom-domains/index.md) for the chosen setup.\n- Confirm which Worker or Wrangler environment the user intends to target. When targeting a Wrangler environment, pass the same `--env` value to every Preview command; omitting it targets the top-level Worker.\n\n## Validate\n\nAfter changing config or bindings in a TypeScript project, regenerate types with the project's `wrangler types` command rather than hand-editing generated declarations. Run the relevant existing typecheck or tests.\n\nFor deployment changes, use the project's build workflow and `wrangler deploy --dry-run` where supported, with the intended config and environment. A successful dry run checks the build and packaging; it does not prove remote resources or runtime behavior work. Use task-specific local or remote checks as appropriate to the requested work.\n\nFor Previews, a returned URL does not validate behavior that depends on bindings Wrangler reports as missing. Validate the behavior the user requested, using Preview-specific logs and configuration when needed. Writes to production resources, destructive testing, and deletion of named Previews must match the user's explicit intent.\n\nReport what changed, the target environment, checks performed, and any unresolved validation gaps. Link the documentation used when the result depends on current command or configuration behavior.\n\n## Skill feedback\n\nIf the user reports that this skill gave incorrect or outdated guidance, or is missing information, read [references/skill-feedback.md](references/skill-feedback.md).\n"}],"summary":"Fields changed: 3. /description, /included_files, /skill_md_contents.","summary_kind":"deterministic","summary_metadata":{}}