workers-development
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWorkers 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.
| Need | Tools and discovery |
|---|---|
| Run locally | Use the project's existing dev command: |
| Inspect or seed local binding data | Local Explorer is a UI and API for local KV, R2, D1, SQLite-backed Durable Objects, and Workflows, and can trigger Cron handlers. Open |
| Debug local requests | Local Explorer captures traces and logs from every local invocation, including binding operations, without code changes. Check traces before adding logging. |
| Debug a deployed Worker | Choose logs, traces, or metrics with Workers observability, or the |
使用项目现有的工具、脚本和配置。已安装工具的帮助信息、Local Explorer API schema 和当前文档会说明受支持的操作;应阅读这些内容,而不是猜测 endpoint 或 flag。
| 需求 | 工具与发现方式 |
|---|---|
| 在本地运行 | 使用项目现有的 dev 命令:在 |
| 检查或填充本地 binding 数据 | Local Explorer 是一个用于本地 KV、R2、D1、基于 SQLite 的 Durable Objects 和 Workflows 的 UI 与 API,并且可以触发 Cron handlers。在 dev server 的 origin 上打开 |
| 调试本地请求 | Local Explorer 无需更改代码,即可捕获每次本地调用中的 traces 和 logs,包括 binding 操作。添加日志之前应先检查 traces。 |
| 调试已部署的 Worker | 使用 Workers observability 选择 logs、traces 或 metrics;如果已安装,也可以使用 |
Use the Local Explorer API
使用 Local Explorer API
When the dev server detects an AI agent, including under , it prints a hint with the API URL and relevant endpoints. Fetch the OpenAPI specification from 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.
cf dev/cdn-cgi/local/explorer/apiBindings are simulated locally by default, but a binding set to 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.
remote: true当 dev server 检测到 AI agent 时,包括在 下运行时,它会打印包含 API URL 和相关 endpoints 的提示。从 dev server 的 origin 上的 获取 OpenAPI specification,然后仅提取任务所需的操作。如果没有出现提示,请直接请求该 URL。如果 API 或某个操作不可用,请将已安装的 Wrangler 或 Vite plugin 版本与 Local Explorer 文档中的要求进行比较。
cf dev/cdn-cgi/local/explorer/api默认情况下,bindings 会在本地模拟;但设置为 的 binding 会在 Worker 本地运行时访问真实的已部署资源。Traces 也会捕获这些远程调用。在填充或写入数据之前,请确定哪些 bindings 是远程的。
remote: trueSkill 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。