技能 wrangler
📦

wrangler

安全 ⚙️ 外部命令🌐 網路存取🔑 環境變數

使用 Wrangler CLI 部署 Cloudflare Workers

也可從以下取得: Dicklesworthstone

Cloudflare Workers 部署需要了解 CLI 命令、配置和資源綁定。此技能提供部署和管理 Workers、KV、R2、D1 等的完整文件。

支援: Claude Codex Code(CC)
🥉 72 青銅
1

下載技能 ZIP

2

在 Claude 中上傳

前往 設定 → 功能 → 技能 → 上傳技能

3

開啟並開始使用

測試它

正在使用「wrangler」。 如何部署我的 Worker?

預期結果:

  • 執行這些命令:
  • 1. wrangler deploy - 部署到正式環境
  • 2. wrangler deploy --env staging - 部署到預備環境
  • 3. wrangler deploy --dry-run - 驗證但不部署
  •  
  • 請務必先執行 wrangler check 來驗證您的設定。

正在使用「wrangler」。 如何新增 KV 命名空間?

預期結果:

  • 1. 建立命名空間:wrangler kv namespace create MY_KV
  • 2. 新增到 wrangler.jsonc:
  • { "kv_namespaces": [{ "binding": "KV", "id": "<ID>" }] }
  • 3. 執行 wrangler types 來更新 TypeScript 綁定

安全審計

安全
v1 • 2/17/2026

All 161 static findings are false positives. The skill is official Cloudflare documentation for the Wrangler CLI tool. External command detections are legitimate CLI commands documented in code blocks. Network detections are official Cloudflare URLs and localhost testing endpoints. Environment variable access is standard secret management documentation. No malicious behavior detected.

1
已掃描檔案
888
分析行數
3
發現項
1
審計總數

風險因素

⚙️ 外部命令 (133)
SKILL.md:12-14 SKILL.md:14-17 SKILL.md:17-19 SKILL.md:19-23 SKILL.md:23-24 SKILL.md:24-25 SKILL.md:25-26 SKILL.md:26-27 SKILL.md:27-28 SKILL.md:28 SKILL.md:28-32 SKILL.md:32-38 SKILL.md:38-44 SKILL.md:44-45 SKILL.md:45-46 SKILL.md:46-47 SKILL.md:47-48 SKILL.md:48-49 SKILL.md:49-50 SKILL.md:50-51 SKILL.md:51-59 SKILL.md:59-66 SKILL.md:66-70 SKILL.md:70-131 SKILL.md:131-135 SKILL.md:135-144 SKILL.md:144-152 SKILL.md:152-174 SKILL.md:174-178 SKILL.md:178-180 SKILL.md:180-190 SKILL.md:190-196 SKILL.md:196-198 SKILL.md:198-201 SKILL.md:201-209 SKILL.md:209-224 SKILL.md:224-228 SKILL.md:228-243 SKILL.md:243-247 SKILL.md:247-259 SKILL.md:259-267 SKILL.md:267-276 SKILL.md:276-280 SKILL.md:280-298 SKILL.md:298-302 SKILL.md:302-308 SKILL.md:308-316 SKILL.md:316-331 SKILL.md:331-335 SKILL.md:335-344 SKILL.md:344-348 SKILL.md:348-354 SKILL.md:354-362 SKILL.md:362-377 SKILL.md:377-381 SKILL.md:381-390 SKILL.md:390-394 SKILL.md:394-406 SKILL.md:406-410 SKILL.md:410-416 SKILL.md:416-420 SKILL.md:420-431 SKILL.md:431-439 SKILL.md:439-454 SKILL.md:454-458 SKILL.md:458-464 SKILL.md:464-468 SKILL.md:468-474 SKILL.md:474-482 SKILL.md:482-498 SKILL.md:498-502 SKILL.md:502-509 SKILL.md:509-517 SKILL.md:517-523 SKILL.md:523-527 SKILL.md:527-531 SKILL.md:531-541 SKILL.md:541-556 SKILL.md:556-560 SKILL.md:560-575 SKILL.md:575-583 SKILL.md:583-592 SKILL.md:592-596 SKILL.md:596-605 SKILL.md:605-609 SKILL.md:609-615 SKILL.md:615-619 SKILL.md:619-629 SKILL.md:629-637 SKILL.md:637-652 SKILL.md:652-656 SKILL.md:656-665 SKILL.md:665-669 SKILL.md:669-679 SKILL.md:679-687 SKILL.md:687-702 SKILL.md:702-706 SKILL.md:706-712 SKILL.md:712-720 SKILL.md:720-729 SKILL.md:729-733 SKILL.md:733-745 SKILL.md:745-749 SKILL.md:749-759 SKILL.md:759-765 SKILL.md:765-777 SKILL.md:777-785 SKILL.md:785-800 SKILL.md:800-804 SKILL.md:804-811 SKILL.md:811-819 SKILL.md:819-821 SKILL.md:821-823 SKILL.md:823-824 SKILL.md:824-836 SKILL.md:836-840 SKILL.md:840-846 SKILL.md:846-856 SKILL.md:856 SKILL.md:856-857 SKILL.md:857-858 SKILL.md:858-859 SKILL.md:859-860 SKILL.md:860-865 SKILL.md:865-874 SKILL.md:874-880 SKILL.md:880-882 SKILL.md:882-883 SKILL.md:883 SKILL.md:883-884 SKILL.md:884-885 SKILL.md:885-886 SKILL.md:886-887
🌐 網路存取 (3)
🔑 環境變數 (6)

偵測到的模式

False Positive: External Commands DetectionFalse Positive: Network URL DetectionFalse Positive: Environment Access DetectionFalse Positive: Weak Cryptographic AlgorithmFalse Positive: Critical Heuristic - Dangerous Combination
審計者: claude

品質評分

38
架構
100
可維護性
85
內容
50
社群
100
安全
74
規範符合性

你能建構什麼

部署新的 Worker 到 Cloudflare

取得初始化和部署新 Worker 並進行正確設定的逐步指引

設定 KV 和 R2 儲存綁定

了解如何為您的 Worker 設定鍵值儲存和物件儲存

管理正式環境 Workers 的密鑰

使用 wrangler secret 命令安全管理 API 金鑰和密鑰

試試這些提示

基本 Worker 部署
如何使用 wrangler 將我的 Worker 部署到 Cloudflare?
設定 KV 命名空間
示範如何在 wrangler.jsonc 設定中新增 KV 命名空間綁定
設定密鑰
如何安全地將 API 金鑰作為密鑰新增到我的 Worker?
使用綁定進行本機開發
如何在本地使用遠端 R2 和 AI 綁定測試我的 Worker?

最佳實務

  • 每次部署前執行 wrangler check 以發現設定錯誤
  • 任何設定變更後執行 wrangler types 以重新產生 TypeScript 綁定
  • 將 compatibility_date 設定為 30 天內的近期日期以取得最新功能

避免

  • 在 wrangler.jsonc 中直接寫死密鑰 - 請改用 wrangler secret
  • 新增新綁定後略過 wrangler types
  • 未先使用 wrangler dev 在本地測試就直接部署

常見問題

我應該使用哪個版本的 wrangler?
使用 wrangler v4.x 或更新版本。使用 wrangler --version 檢查。
我可以使用 TOML 或 JSON 作為設定嗎?
建議使用 wrangler.jsonc(支援註解的 JSON)。較新功能僅支援 JSON。
如何在本地測試我的 Worker?
執行 wrangler dev。使用 wrangler dev --remote 來使用 Cloudflare 綁定。
本機開發密鑰應該存在哪裡?
使用專案根目錄中的 .dev.vars 檔案。切勿提交此檔案。
如何回滾錯誤的部署?
使用 wrangler rollback 或 wrangler rollback <VERSION_ID>。
Workers AI 可以在本機運作嗎?
不行,Workers AI 一律在遠端執行,即使在本機開發中也會產生費用。

開發者詳情

檔案結構

📄 SKILL.md