workers-development

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Workers development and debugging

Workers 开发与调试

Use the project's existing tooling, scripts, and configuration. Installed help, the Local Explorer API schema, and current docs describe the supported operations; read them rather than guessing endpoints or flags.
NeedTools and discovery
Run locallyUse the project's existing dev command:
cf dev
in a
cf
project, otherwise the Wrangler or Cloudflare Vite dev script. See local development.
Inspect or seed local binding dataLocal Explorer is a UI and API for local KV, R2, D1, SQLite-backed Durable Objects, and Workflows, and can trigger Cron handlers. Open
/cdn-cgi/local/explorer
on the dev server's origin.
Debug local requestsLocal Explorer captures traces and logs from every local invocation, including binding operations, without code changes. Check traces before adding logging.
Debug a deployed WorkerChoose logs, traces, or metrics with Workers observability, or the
cloudflare
skill's observability reference when installed. If the Cloudflare MCP server is connected (bundled with this plugin), use
search
to find the Workers Observability API operations, then
execute
to call them, scoped to the target account, Worker, and time window.
使用项目现有的工具、脚本和配置。已安装工具的帮助信息、Local Explorer API schema 和当前文档会说明受支持的操作;应阅读这些内容,而不是猜测 endpoint 或 flag。
需求工具与发现方式
在本地运行使用项目现有的 dev 命令:在
cf
项目中使用
cf dev
,否则使用 Wrangler 或 Cloudflare Vite dev script。参见本地开发。
检查或填充本地 binding 数据Local Explorer 是一个用于本地 KV、R2、D1、基于 SQLite 的 Durable Objects 和 Workflows 的 UI 与 API,并且可以触发 Cron handlers。在 dev server 的 origin 上打开
/cdn-cgi/local/explorer
。
调试本地请求Local Explorer 无需更改代码,即可捕获每次本地调用中的 traces 和 logs,包括 binding 操作。添加日志之前应先检查 traces。
调试已部署的 Worker使用 Workers observability 选择 logs、traces 或 metrics;如果已安装,也可以使用
cloudflare
skill 的 observability 参考文档。如果已连接 Cloudflare MCP server(随此 plugin 一同提供),请使用
search
查找 Workers Observability API 操作,然后使用
execute
调用这些操作,并将调用范围限定到目标账户、Worker 和时间窗口。

Use the Local Explorer API

使用 Local Explorer API

When the dev server detects an AI agent, including under
cf dev
, it prints a hint with the API URL and relevant endpoints. Fetch the OpenAPI specification from
/cdn-cgi/local/explorer/api
on the dev server's origin, then extract only the operations the task needs. If no hint appears, request that URL directly. If the API or an operation is missing, compare the installed Wrangler or Vite plugin version against the requirements in the Local Explorer docs.
Bindings are simulated locally by default, but a binding set to
remote: true
reaches the real deployed resource while the Worker runs locally. Traces also capture those remote calls. Identify which bindings are remote before seeding or writing data.
当 dev server 检测到 AI agent 时,包括在
cf dev
下运行时,它会打印包含 API URL 和相关 endpoints 的提示。从 dev server 的 origin 上的
/cdn-cgi/local/explorer/api
获取 OpenAPI specification,然后仅提取任务所需的操作。如果没有出现提示,请直接请求该 URL。如果 API 或某个操作不可用,请将已安装的 Wrangler 或 Vite plugin 版本与 Local Explorer 文档中的要求进行比较。
默认情况下,bindings 会在本地模拟;但设置为
remote: true
的 binding 会在 Worker 本地运行时访问真实的已部署资源。Traces 也会捕获这些远程调用。在填充或写入数据之前,请确定哪些 bindings 是远程的。

Skill feedback

Skill 反馈

If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read references/skill-feedback.md.
如果用户报告此 skill 提供了错误或过时的指导,或者缺少信息,请阅读 references/skill-feedback.md。