Wrangler CLI
Wrangler commands and configuration evolve quickly. Use the installed version,
its help output, the local configuration schema, and current first-party docs as
the contract; do not rely on a copied command catalog.
Resolve the local contract
- Inspect the project package manager, installed Wrangler version, config file,
selected environment, and relevant package scripts.
- Prefer the project-local Wrangler invocation (
npx, pnpm, yarn, or an
existing script) over an unrelated global installation.
- Read
wrangler <command> --help and the installed
node_modules/wrangler/config-schema.json for exact syntax.
- Retrieve current docs for commands, flags, lifecycle rules, limits, or product
behavior that can change.
Start at:
Install or upgrade Wrangler only when the requested command requires it and the
user's project dependency policy permits the change.
Resolve the target before mutation
For a write, identify the account, Worker or resource, environment, config file,
and whether the command addresses local or remote state. Environment bindings,
variables, and secrets are not automatically inherited, so inspect the selected
environment explicitly.
Distinguish read-only inspection, local development, upload, traffic deployment,
resource mutation, data mutation, and deletion. The user's request must authorize
the mutation actually performed. Use dry-run or readback when supported, but do
not represent dry-run as live success.
After an ambiguous response to a write, inspect provider state before retrying;
the operation may have completed.
Handle credentials and secrets
- Prefer scoped API tokens or the project's established authentication profile.
- Never print credentials or place secret values in command arguments, source,
checked-in config, or shell history.
- Use interactive secret input, supported bulk-secret input, or the existing CI
secret mechanism.
- Keep local
.dev.vars* and .env* files out of version control.
Configuration changes
Use the format already established by the repository unless a current feature
requires migration. After changing bindings or configuration, regenerate types
when the project relies on generated environment types and run the narrow build
or typecheck that consumes them.
Do not invent resource IDs, binding names, compatibility dates, routes, or
environment inheritance. Resolve them from current project and provider state.
Verify precisely
Report the facts separately: command validated, local behavior passed, resource
created or changed, version uploaded, traffic deployed, migration applied, and
live application verified. Include exact non-secret resource or version identity
when it matters to the user's operation.
1---2name: wrangler3description: Resolve, construct, review, or run an exact Cloudflare Wrangler command or `wrangler.jsonc` change. Use when the user names Wrangler, asks for a Cloudflare CLI operation, or needs environment, binding, authentication, secret, migration, deployment, or resource-management syntax. Do not trigger for general Cloudflare architecture or application code that does not require Wrangler.4metadata:5 source: https://skillmd.com/skills/swyxio/wrangler6---78# Wrangler CLI910Wrangler commands and configuration evolve quickly. Use the installed version,11its help output, the local configuration schema, and current first-party docs as12the contract; do not rely on a copied command catalog.1314## Resolve the local contract15161. Inspect the project package manager, installed Wrangler version, config file,17 selected environment, and relevant package scripts.182. Prefer the project-local Wrangler invocation (`npx`, `pnpm`, `yarn`, or an19 existing script) over an unrelated global installation.203. Read `wrangler <command> --help` and the installed21 `node_modules/wrangler/config-schema.json` for exact syntax.224. Retrieve current docs for commands, flags, lifecycle rules, limits, or product23 behavior that can change.2425Start at:2627- [Wrangler documentation](https://developers.cloudflare.com/workers/wrangler/)28- [Commands](https://developers.cloudflare.com/workers/wrangler/commands/)29- [Configuration](https://developers.cloudflare.com/workers/wrangler/configuration/)30- [Environments](https://developers.cloudflare.com/workers/wrangler/environments/)3132Install or upgrade Wrangler only when the requested command requires it and the33user's project dependency policy permits the change.3435## Resolve the target before mutation3637For a write, identify the account, Worker or resource, environment, config file,38and whether the command addresses local or remote state. Environment bindings,39variables, and secrets are not automatically inherited, so inspect the selected40environment explicitly.4142Distinguish read-only inspection, local development, upload, traffic deployment,43resource mutation, data mutation, and deletion. The user's request must authorize44the mutation actually performed. Use dry-run or readback when supported, but do45not represent dry-run as live success.4647After an ambiguous response to a write, inspect provider state before retrying;48the operation may have completed.4950## Handle credentials and secrets5152- Prefer scoped API tokens or the project's established authentication profile.53- Never print credentials or place secret values in command arguments, source,54 checked-in config, or shell history.55- Use interactive secret input, supported bulk-secret input, or the existing CI56 secret mechanism.57- Keep local `.dev.vars*` and `.env*` files out of version control.5859## Configuration changes6061Use the format already established by the repository unless a current feature62requires migration. After changing bindings or configuration, regenerate types63when the project relies on generated environment types and run the narrow build64or typecheck that consumes them.6566Do not invent resource IDs, binding names, compatibility dates, routes, or67environment inheritance. Resolve them from current project and provider state.6869## Verify precisely7071Report the facts separately: command validated, local behavior passed, resource72created or changed, version uploaded, traffic deployed, migration applied, and73live application verified. Include exact non-secret resource or version identity74when it matters to the user's operation.