wrangler

Interface en ligne de commande Cloudflare Workers pour déployer, développer et gérer Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines et Secrets Store. Chargez avant d'exécuter les commandes wrangler pour garantir une syntaxe correcte et les bonnes pratiques.

npx skills add https://github.com/cloudflare/skills --skill wrangler

Wrangler CLI

Use 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.

Inspect the Project

  • 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 Wrangler is not a dependency, follow the installation guide to add it locally.
  • Identify the config used by the build or deploy command, including framework-generated config. Edit its source rather than generated output.
  • 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.

Retrieve What the Task Needs

Use 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 or Cloudflare docs search.

TaskSource
Discover commands and flags, including resource management, deployments, rollback, and diagnosticsProject-local wrangler --help and wrangler <command> --help; command reference
Edit config or add a bindingInstalled wrangler/config-schema.json (usually under node_modules); configuration reference
Deploy a framework applicationFramework guides; follow the guide for the project's existing framework and adapter
Migrate an application to Workers when requestedPages to Workers; Vercel to Workers
Configure staging or productionEnvironments
Set secrets locally, in CI, or on a deployed WorkerSecrets
Generate binding and runtime typesTypeScript
Run locally or choose a testing approachLocal development; testing
Diagnose authentication or select an accountGeneral commands, including whoami; authentication profiles
Deploy an unauthenticated prototypeClaim deployments for eligibility, expiry, and claim URL handling; use a permanent account for production or CI

Use 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.

Apply the Change

  • Prefer wrangler.jsonc for new config. Set a new project's compatibility date to today; review runtime changes and test when advancing an existing project's date. Preserve existing project conventions and avoid incidental format migrations.
  • 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.
  • 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.
  • 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.
  • Distinguish local simulation from remote bindings during development. A locally running Worker can still access real resources; check the selected bindings before testing writes.
  • 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.
  • 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.
  • Before a rollback, check rollback limitations: connected resources and their data are not rolled back with Worker code.

Validate

After 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.

For 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.

Report 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.

Plus de skills de Cloudflare

agents-sdk
Cloudflare
Construisez des agents IA sur Cloudflare Workers en utilisant le SDK Agents. Chargez lors de la création d'agents avec état, de workflows durables, d'applications WebSocket en temps réel, de tâches planifiées, de serveurs MCP ou d'applications de chat. Couvre la classe Agent, la gestion d'état, le RPC appelable, l'intégration Workflows et les hooks React.
building-ai-agent-on-cloudflare
Cloudflare
| Construit des agents IA sur Cloudflare en utilisant le SDK Agents avec gestion d'état, WebSockets en temps réel, tâches planifiées, intégration d'outils et capacités de chat. Génère du code d'agent prêt pour la production déployé sur Workers. À utiliser quand : l'utilisateur veut "construire un agent", "agent IA", "agent de chat", "agent avec état", mentionne "Agents SDK", a besoin d'"IA en temps réel", "WebSocket IA", ou demande la "gestion d'état" d'un agent, des "tâches planifiées" ou "l'appel d'outils".
development
building-mcp-server-on-cloudflare
Cloudflare
Construit des serveurs MCP (Model Context Protocol) distants sur Cloudflare Workers avec outils, authentification OAuth et déploiement en production. Génère le code du serveur, configure les fournisseurs d'authentification et déploie sur Workers. À utiliser lorsque : l'utilisateur souhaite « construire un serveur MCP », « créer des outils MCP », « MCP distant », « déployer MCP », ajouter « OAuth à MCP », ou mentionne Model Context Protocol sur Cloudflare. Se déclenche également sur « authentification MCP » ou « déploiement MCP ».
development
cloudflare
Cloudflare
Compétence complète pour la plateforme Cloudflare couvrant Workers, Pages, stockage (KV, D1, R2), IA (Workers AI, Vectorize, Agents SDK), réseau (Tunnel, Spectrum), sécurité (WAF, DDoS) et infrastructure en tant que code (Terraform, Pulumi). À utiliser pour toute tâche de développement Cloudflare.
durable-objects
Cloudflare
Créer et examiner les Durable Objects Cloudflare. Utiliser lors de la construction de coordination avec état (salons de discussion, jeux multijoueurs, systèmes de réservation), de l'implémentation de méthodes RPC, du stockage SQLite, des alarmes, des WebSockets, ou de l'examen de code DO pour les bonnes pratiques. Couvre l'intégration Workers, la configuration wrangler, et les tests avec Vitest.
sandbox-sdk
Cloudflare
Construisez des applications sandboxées pour une exécution sécurisée de code. Chargez lors de la création d'exécution de code IA, d'interpréteurs de code, de systèmes CI/CD, d'environnements de développement interactifs ou d'exécution de code non fiable. Couvre le cycle de vie du Sandbox SDK, les commandes, les fichiers, l'interpréteur de code et les URL de prévisualisation.
web-perf
Cloudflare
Analyse les performances web à l'aide de Chrome DevTools MCP. Mesure les Core Web Vitals (FCP, LCP, TBT, CLS, Speed Index), identifie les ressources bloquant le rendu, les chaînes de dépendances réseau, les décalages de mise en page, les problèmes de cache et les lacunes d'accessibilité. À utiliser lorsqu'on vous demande d'auditer, profiler, déboguer ou optimiser les performances de chargement de page, les scores Lighthouse ou la vitesse du site.
workers-best-practices
Cloudflare
Analyse et rédige du code Cloudflare Workers en respectant les bonnes pratiques de production. Chargez-le lors de l'écriture de nouveaux Workers, de la révision de code Worker, de la configuration de wrangler.jsonc, ou de la vérification des anti-patrons courants des Workers (streaming, promesses flottantes, état global, secrets, liaisons, observabilité). Privilégie la récupération depuis la documentation Cloudflare plutôt que les connaissances pré-entraînées.