Use this skill when the user wants to manage Cloudflare authentication — login, check status, or logout. Trigger phrases include: "login cloudflare", "登入 cloudflare", "我有登入嗎", "auth status", "登出 cloudflare", "logout cloudflare", "認證狀態", "cloudflare 帳號".
管理 Cloudflare 認證(login / status / logout)。全程使用中文回應(除非使用者用英文提問)。
tunnelbox auth login --json
JSON 輸出範例(成功):
{ "success": true, "data": { "status": "success", "message": "Login successful" } }
JSON 輸出範例(已登入):
{ "success": true, "data": { "status": "already_logged_in", "message": "Already logged in" } }
tunnelbox auth status --json
JSON 輸出範例(已登入):
{ "success": true, "data": { "loggedIn": true, "status": "logged_in" } }
JSON 輸出範例(未登入):
{ "success": true, "data": { "loggedIn": false, "status": "logged_out" } }
tunnelbox auth logout --json
JSON 輸出範例:
{ "success": true, "data": { "message": "Logged out successfully" } }
tunnelbox auth status --json 確認是否已登入。請先在瀏覽器中登入你的 Cloudflare 帳號(https://dash.cloudflare.com),否則授權流程可能無法正常完成。
tunnelbox auth login --json
tunnelbox auth status --json
loggedIn: true → 已登入 CloudflareloggedIn: false → 未登入,需要執行 tunnelbox auth logintunnelbox auth logout --json
所有指令加上 --json 以取得結構化輸出。錯誤格式:
{ "success": false, "error": "error message" }
| 錯誤訊息 | 原因 | 建議 |
|---|---|---|
| Login timed out | 使用者未在 2 分鐘內完成授權 | 確認已在瀏覽器登入 Cloudflare 後重試 |
| Login failed: 認證已取消 | 使用者取消了授權 | 重新執行登入 |
| cloudflared 尚未安裝 | cloudflared 未安裝 | 執行 tunnelbox env install |
遇到錯誤時,向使用者說明原因並提供可行的解決建議。