cloudflare-temporary-deploy
它能做什么
这项技能帮助你的 AI 无需先创建 Cloudflare 账户,就把一个小型网页应用或 Worker 发布到可访问的地址。适合想快速获得可分享链接或进行快速测试部署的人。
适用场景
- ✓你想让 AI 无需注册 Cloudflare 账户,就把页面或应用部署到可访问链接的时候。
- ✓你想快速把原型上线,并在之后认领到自己的账户中的时候。
- ✓你想在后台会话中实现自动部署和检查循环的时候。
技能链接
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/web-development/cloudflare-temporary-deploy/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把这个小页面部署到 Cloudflare,并给我一个可以立即打开的在线链接。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能使用带临时标志的 wrangler 工具。Cloudflare 会创建一个临时账户,部署代码,并打印一个有效期为 60 分钟的认领链接。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Cloudflare Temporary Deploy Skill
Deploy a Cloudflare Worker to a live workers.dev URL with zero account setup, using wrangler deploy --temporary. Cloudflare provisions a throwaway account, deploys, and prints a claim URL valid for 60 minutes; unclaimed accounts auto-delete. This gives an agent a tight write → deploy → verify loop without any OAuth, signup, or token copy-paste.
This skill does NOT cover production deploys (use wrangler login + a permanent account for those), nor non-Worker Cloudflare products beyond the temporary-account limits below.
When to Use
Load this skill when the user wants to:
- Ship agent-written code to a live URL without first creating a Cloudflare account — "deploy this and give me a link"
- Iterate in a background/autonomous session where a browser OAuth step would be a hard stop
- Prototype or evaluate Workers quickly with a throwaway, claimable target
- Build a self-verifying deploy loop — deploy,
curlthe live URL, confirm output matches the code, redeploy
When NOT to Use
- Production or CI/CD → use a permanent account (
wrangler loginorCLOUDFLARE_API_TOKEN).--temporaryerrors out if any credential is present. - Wrangler is already authenticated →
--temporaryreturns an error by design. Runwrangler logoutfirst only if the user explicitly wants a throwaway deploy. - Long-lived hosting → temporary deployments are deleted after 60 minutes unless claimed.
Prerequisites
- Wrangler 4.102.0 or later. This is the version that introduced
--temporary. Earlier versions do not have it. Verify withnpx wrangler@latest --version. - Node 18+ / npm (or
npx,yarn,pnpm). No global install needed —npx wrangler@latestworks. - No Cloudflare credentials present.
--temporaryonly works when Wrangler is unauthenticated: no OAuth login, noCLOUDFLARE_API_TOKEN/CLOUDFLARE_API_KEYenv var, no~/.wrangler/~/.config/.wranglercached OAuth. Use theterminaltool's environment as-is; do not set those vars. - Network egress to
cloudflare.comandworkers.dev. - Using
--temporaryaccepts Cloudflare's Terms of Service and Privacy Policy.
How to Run
Use the terminal tool for every step. Always pin the version (wrangler@latest or wrangler@4.102.0 or newer) so you don't accidentally run an old global wrangler that lacks the flag.
Scaffold a minimal Worker (skip if the project already exists). A Worker needs a
wrangler.toml(orwrangler.jsonc) and an entry script. Minimal TypeScript example — write these withwrite_file:wrangler.jsonc:{ "name": "hello-agent", "main": "src/index.ts", "compatibility_date": "2025-01-01" }src/index.ts:export default { async fetch(): Promise<Response> { return new Response("hello cloudflare"); }, };Deploy with
--temporaryfrom the project directory:npx wrangler@latest deploy --temporaryThe proof-of-work check adds a short automatic delay. On success Wrangler prints an
Account: <name> (created)(or(reused)) line, aClaim URL, and the livehttps://<worker>.<account>.workers.devURL.Parse the URLs from that output. Run the helper to extract them reliably instead of eyeballing:
npx wrangler@latest deploy --temporary 2>&1 | python scripts/parse_deploy_output.py(Resolve
scripts/parse_deploy_output.pyto this skill's absolute path.) It prints JSON:{"live_url", "claim_url", "account", "account_state", "expires_minutes", "deployed"}.Verify the deploy is actually live — do not trust the deploy log alone.
curlthe live URL and confirm the body matches what the code returns:curl -sS <live_url>Iterate. Edit the code, redeploy with the same
npx wrangler@latest deploy --temporary. Within the 60-minute window Wrangler reuses the cached temporary account (Account: <name> (reused)), so the URL stays stable.curlagain to confirm the change.Hand the claim URL to the user. Tell them: open it within 60 minutes to keep the deployment and any resources; if they don't claim it, everything auto-deletes. Treat the claim URL as a secret — it grants ownership of the account.
Quick Reference
| Step | Command |
|---|---|
| Check version (need 4.102.0+) | npx wrangler@latest --version |
| Deploy (no account) | `npx wrangler@latest deploy --tempora |
常见问题
链接有效期多久?
技能说明认领链接有效期为 60 分钟,未认领的账户会被自动删除。
可以用于正式网站吗?
不可以。技能说明正式部署应使用永久账户,而且如果存在凭据,临时部署选项会失败。
如果我已经登录了 Wrangler 怎么办?
技能说明在这种情况下临时部署会返回错误,如果你想进行一次性部署,需要先退出登录。
详情
热度
- GitHub 星标
- 260k
- 排名
- #577
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-merge-conflict-arbiter
260k以中立第三方的身份,解决两个智能体分支之间的 git 合并冲突,为代码仓库生成一个合并结果。
antigravity-cli
260k指导你安装、更新和排查 Antigravity 命令行工具,包括其插件、登录和沙盒。
blackbox
260k让你的智能体把编程任务交给 Blackbox AI 命令行工具,它会运行多个 AI 模型并挑选最佳结果。
dynamic-workflow
260k教你的智能体把大量相似的工作保存为脚本批量运行,使只有经过验证的结果才返回主对话。