跳到主内容
智客 ZICQ

技能库 智客分类:运维与云 wrangler

Wrangler

为本地开发、预览、部署和Cloudflare资源管理运行或故障排除 Wrangler CLI 命令和配置工人项目.

95490 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

为本地开发、预览、部署和Cloudflare资源管理运行或故障排除 Wrangler CLI 命令和配置工人项目.

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Wrangler CLI、Inspect the Project、Retrieve What the Task Needs、Apply the Change、Work with Workers Previews、Validate。

文件分析

文件分析:除 SKILL.md 外,正文引用了 assets/migration-guides/migrate-from-pages/、assets/migration-guides/vercel-to-workers/,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Run or troubleshoot Wrangler CLI commands and configure Worker projects for local development, Previews, deployment, and Cloudflare resource management.

Wrangler CLIInspect the ProjectRetrieve What the Task NeedsApply the ChangeWork with Workers PreviewsValidate

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
wrangler
description
Run or troubleshoot Wrangler CLI commands and configure Worker projects for local development, Previews, deployment, and Cloudflare resource management.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 2
  • assets/migration-guides/migrate-from-pages/
  • assets/migration-guides/vercel-to-workers/

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「wrangler」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-cec9f5e994d4c859-Wrangler.html
请存为 .cursor/skills/wrangler/SKILL.md 或 .claude/skills/wrangler/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/cloudflare/skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/cloudflare/skills' --list

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

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: wrangler description: Run or troubleshoot Wrangler CLI commands and configure Worker projects for local development, Previews, deployment, and Cloudflare resource management. --- # 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](https://developers.cloudflare.com/workers/wrangler/install-and-update/) 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](https://developers.cloudflare.com/workers/wrangler/commands/) or Cloudflare docs search. | Task | Source | | --- | --- | | Discover commands and flags, including resource management, deployments, rollback, and diagnostics | Project-local `wrangler --help` and `wrangler --help`; [command reference](https://developers.cloudflare.com/workers/wrangler/commands/) | | Edit config or add a binding | Installed `wrangler/config-schema.json` (usually under `node_modules`); [configuration reference](https://developers.cloudflare.com/workers/wrangler/configuration/) | | Deploy a framework application | [Framework guides](https://developers.cloudflare.com/workers/framework-guides/); follow the guide for the project's existing framework and adapter | | Migrate an application to Workers when requested | [Pages to Workers](https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/); [Vercel to Workers](https://developers.cloudflare.com/workers/static-assets/migration-guides/vercel-to-workers/) | | Configure staging or production | [Environments](https://developers.cloudflare.com/workers/wrangler/environments/) | | Set secrets locally, in CI, or on a deployed Worker | [Secrets](https://developers.cloudflare.com/workers/configuration/secrets/) | | Generate binding and runtime types | [TypeScript](https://developers.cloudflare.com/workers/languages/typescript/) | | Run locally or choose a testing approach | [Local development](https://developers.cloudflare.com/workers/local-development/); [testing](https://developers.cloudflare.com/workers/testing/) | | Choose roles, scopes, or API token permissions for Wrangler | [Roles and permissions](https://developers.cloudflare.com/workers/authorization/); [Workers roles and permissions](https://developers.cloudflare.com/workers/authorization/workers/#wrangler) | | Create or manage a branch or pull request environment | [Previews overview](https://developers.cloudflare.com/workers/previews/); [get started](https://developers.cloudflare.com/workers/previews/get-started/); [configuration](https://developers.cloudflare.com/workers/previews/configuration/) | | Decide whether Preview resources are isolated or shared | [Resources and isolation](https://developers.cloudflare.com/workers/previews/resources/), including its current limitations | | Configure Preview URLs, access, debugging, or CI | [Custom domains](https://developers.cloudflare.com/workers/previews/custom-domains/); [test and debug](https://developers.cloudflare.com/workers/previews/test-and-debug/); [examples](https://developers.cloudflare.com/workers/previews/examples/) | | Choose between Previews, Version URLs, and Wrangler environments | [Compare workflows](https://developers.cloudflare.com/workers/previews/compare-workflows/) | | Diagnose authentication or select an account | [General commands](https://developers.cloudflare.com/workers/wrangler/commands/general/), including `whoami`; [authentication profiles](https://developers.cloudflare.com/workers/wrangler/profiles/) | | Deploy an unauthenticated prototype | [Claim deployments](https://developers.cloudflare.com/workers/platform/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](https://developers.cloudflare.com/workers/configuration/compatibility-dates/) 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](https://developers.cloudflare.com/workers/vite-plugin/reference/cloudflare-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](https://developers.cloudflare.com/workers/wrangler/configuration/#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](https://developers.cloudflare.com/workers/versions-and-deployments/rollbacks/): 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](https://developers.cloudflare.com/workers/previews/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](https://developers.cloudflare.com/workers/previews/configuration/#what-goes-in-the-previews-block) and [resource matrix and limitations](https://developers.cloudflare.com/workers/previews/resources/). 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](https://developers.cloudflare.com/workers/previews/custom-domains/) 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.

相关技能

运维与云

Docker Essentials

用于容器管理,图像操作,调试的基本道克命令和工作流程.

运维与云

Find Skills

从开放的代理技能生态系统中发现并安装技能. 使用时:(1)用户问"我如何做X",X可能拥有现有技能,(2)用户说"为X找到技能"或"是否为X有技能",(3)用户问"你能否做X",X是专门能力,(4)用户想扩展代理能力,(5)用户想搜索工具,模板,或工作流程,(6)用户提到他们希望…

运维与云

Azure Diagnostics

Azure上使用AppLens,AzureMonitor,资源健康,安全分型的调试Azure生产问题. 当:调试生产问题,故障解答应用服务,应用服务高CPU,应用服务部署失败,故障解答容器应用,故障解答功能,故障解答AKS,VM RDP,Linux SSH,VM黑屏幕,无法连接到…

运维与云

Azure Prepare

准备 azd 用于部署的Azure项目:为Azure开发者CLI(azd)工作流程生成azure.yaml,基础设施(Bicep/Terraform)和多克文件. 仅当用户明确想要使用 azd 作为部署工具时使用, 或项目已经有一个 azure 。 雅姆尔文件。 不使用: 非az…