Wrangler CLI для Cloudflare

Ведёт команды и конфигурацию Wrangler в проектах с wrangler.jsonc или wrangler.toml: сверяется со справкой и документацией, бережёт секреты, окружения и Previews. Для случаев, когда Worker деплоят, настраивают или чинят через Wrangler.

DevOpsПак: Скиллы Cloudflare75 строкwrangler
Автор
Источник
cloudflare/skills/skills/wrangler @ 5108325
Лицензия
Apache-2.0

Об этом скилле

Что делает

Скилл объясняет агенту, как работать с Wrangler в проекте, где уже есть wrangler.jsonc, wrangler.json или wrangler.toml. Синтаксиса команд в нём почти нет, и это нарочно: флаги и поля меняются. Поэтому агент читает wrangler --help из самого проекта, установленный config-schema.json и актуальную страницу документации, которую находит по таблице задач из пятнадцати строк или через инструмент docs MCP-сервера Cloudflare.

Большая часть SKILL.md — о том, как ничего не сломать. Перед командой агент выясняет аккаунт, Worker, окружение и ресурс, а для операций с данными — локальное это хранилище или удалённое. Он запускает Wrangler из зависимостей проекта и не обновляет его втихую, сверяет правки из дашборда, которые деплой затрёт, и считает wrangler secret put и secret delete деплоями — каждая сразу выкатывает новую версию. Секреты не попадают в аргументы и логи. Откат не трогает привязанные ресурсы и их данные.

Для Workers Previews нужен Wrangler 4.135.0 или новее в самом проекте, а при работе с окружением Wrangler во всех командах Preview передаётся один и тот же --env. В продовые ресурсы агент пишет только с вашего явного согласия и предупреждает, что адреса Preview публичны до настройки доступа. Проверка — wrangler types и wrangler deploy --dry-run; пробный прогон подтверждает сборку, а не поведение в рантайме. Кроме SKILL.md и лицензии в папке лежит references/skill-feedback.md: по нему агент сообщает Cloudflare об ошибке в скилле через GitHub issue, который вы сначала одобряете.

Когда включать и когда не надо

Чтобы запустить, задеплоить, настроить или починить Worker в проекте на Wrangler.

Для нового проекта, проекта с cloudflare.config.ts или без конфигурации Cloudflare скилл уступает место cf и Wrangler туда не добавляет.

Как поставить и вызвать

Команда установки ниже скачивает папку целиком. Wrangler берётся из зависимостей проекта, удалённым командам нужен wrangler login или API-токен. Вызвать вручную:

  • Claude Code: /wrangler или попросить скилл по имени.
  • Codex: $wrangler.
  • Cursor: наберите / в чате Agent и выберите wrangler.

Пример: /wrangler Добавь окружение staging со своим пространством KV и выкати Preview этой ветки.

Чем отличается от похожих

CLI cf для API Cloudflare — его пара: какой из двух нужен, решает файл конфигурации, и каждый отправляет агента к другому CLI. Vercel CLI с токенами расписывает конкретные команды и просит у вас токен, если не нашёл его в окружении или .env; этот скилл держит команды в документации и токен в чате не просит. Деплой на Vercel выкладывает проект в один шаг; здесь деплой — лишь одна задача из многих.

Установка

Выполните одну команду — она сохранит SKILL.md и файлы, которые он использует, в папку скиллов агента. Claude Code и Codex подхватывают новый скилл без перезапуска; если скилл не появился, перезапустите агента.

Скилл написан на английском — агент поймёт его и ответит вам по-русски.

Claude Code — macOS, Linux
curl -fsSL --create-dirs -o ~/.claude/skills/wrangler/SKILL.md https://anymodel.org/en/skills/cloudflare/wrangler/SKILL.md -o ~/.claude/skills/wrangler/LICENSE https://anymodel.org/en/skills/cloudflare/wrangler/LICENSE -o ~/.claude/skills/wrangler/references/skill-feedback.md https://anymodel.org/en/skills/cloudflare/wrangler/references/skill-feedback.md
Codex, Cursor — macOS, Linux
curl -fsSL --create-dirs -o ~/.agents/skills/wrangler/SKILL.md https://anymodel.org/en/skills/cloudflare/wrangler/SKILL.md -o ~/.agents/skills/wrangler/LICENSE https://anymodel.org/en/skills/cloudflare/wrangler/LICENSE -o ~/.agents/skills/wrangler/references/skill-feedback.md https://anymodel.org/en/skills/cloudflare/wrangler/references/skill-feedback.md
Claude Code — Windows PowerShell
foreach ($f in 'SKILL.md','LICENSE','references/skill-feedback.md') { $p = Join-Path "$HOME\.claude\skills\wrangler" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/cloudflare/wrangler/$f" -UseBasicParsing -OutFile $p }
Codex, Cursor — Windows PowerShell
foreach ($f in 'SKILL.md','LICENSE','references/skill-feedback.md') { $p = Join-Path "$HOME\.agents\skills\wrangler" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/cloudflare/wrangler/$f" -UseBasicParsing -OutFile $p }

Другой агент: сохраните файл в его папку скиллов или дайте ему ссылку на файл: https://anymodel.org/en/skills/cloudflare/wrangler/SKILL.md

SKILL.md

Исходник

Wrangler CLI

Use 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. Do not add Wrangler to those projects.

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 the project has a Wrangler configuration file but 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.

Task Source
Discover commands and flags, including resource management, deployments, rollback, and diagnostics Project-local wrangler --help and wrangler <command> --help; command reference
Edit config or add a binding Installed wrangler/config-schema.json (usually under node_modules); configuration reference
Deploy a framework application Framework guides; follow the guide for the project's existing framework and adapter
Migrate an application to Workers when requested Pages to Workers; Vercel to Workers
Configure staging or production Environments
Set secrets locally, in CI, or on a deployed Worker Secrets
Generate binding and runtime types TypeScript
Run locally or choose a testing approach Local development; testing
Choose roles, scopes, or API token permissions for Wrangler Roles and permissions; Workers roles and permissions
Create or manage a branch or pull request environment Previews overview; get started; configuration
Decide whether Preview resources are isolated or shared Resources and isolation, including its current limitations
Configure Preview URLs, access, debugging, or CI Custom domains; test and debug; examples
Choose between Previews, Version URLs, and Wrangler environments Compare workflows
Diagnose authentication or select an account General commands, including whoami; authentication profiles
Deploy an unauthenticated prototype Claim 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.
  • 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.
  • 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.

Work with Workers Previews

  • 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.
  • 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 rather than adapting an older aliased Version URL workflow.
  • 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.
  • Before deploying, follow the current configuration placement table and resource matrix and limitations. Do not infer isolation from the Preview name or allow writes to production resources unless the user explicitly intends to share them.
  • 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 for the chosen setup.
  • 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.

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.

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

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.

Skill feedback

If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read references/skill-feedback.md.

Подключить через AnyModel API

Скилл работает на той модели, которую использует агент. Подключите Claude Code, Codex или Cursor к AnyModel и запускайте его на Claude, GPT, Gemini и других моделях по одному ключу — оплата за токены, без подписки.

Ещё из пака Скиллы Cloudflare

Лучшие практики Cloudflare Workers

Проверяет код и конфигурацию Cloudflare Workers по правилам для прода: даты совместимости, логи и трейсы, стриминг, waitUntil, биндинги вместо REST, Web Crypto, типы Env. Для случаев, когда Worker пишут, ревьюят или готовят к выкладке.

Durable Objects в Cloudflare

Помогает писать и ревьюить Durable Objects в Cloudflare: объект на сущность, хранилище SQLite и миграции, RPC-методы, alarms, WebSocket и тесты на Vitest. Для случаев, когда приложению на Workers нужны общее состояние и координация.

Agents SDK от Cloudflare

Помогает строить приложения на Agents SDK от Cloudflare: агенты с состоянием на Durable Objects, RPC, расписания, очереди, Workflows, чат на AIChatAgent, MCP и почта. Для случаев, когда нужен ИИ-агент или чат на Workers.

Веб-фреймворки на Cloudflare Workers

Настраивает приложения на Astro, SvelteKit, React Router, TanStack Start, Nuxt, Hono и SPA под Cloudflare Workers, выбирая C3, Wrangler или cf по состоянию проекта. Для случаев, когда приложение создают, переносят или деплоят на Workers.

Локальная разработка Workers

Запускает и отлаживает Workers локально через cf dev, wrangler dev или плагин Vite, а в Local Explorer читает и наполняет данные биндингов и смотрит трейсы. Для случаев, когда локальный запрос падает или непонятно, что вернул биндинг.

CLI cf для API Cloudflare

Находит и выполняет команды CLI cf от Cloudflare (бета) через cf cli search, cf schema и пробные прогоны, выбирает между cf и Wrangler. Для случаев, когда нужно работать с DNS, зонами, D1, KV или R2 из терминала или начать проект на Workers.

Аудит скорости сайта

Проводит аудит скорости страницы через Chrome DevTools MCP: трейс, Core Web Vitals по порогам, сеть, снимок доступности и настройки сборки, с исправлениями по приоритету. Для случаев, когда страница тормозит или оценка Lighthouse низкая.