Agent skill
cf-tunnel
Cloudflare Tunnel 一键管理工具,支持统一 Bun CLI(share + panel 合并)、端口自动避让、状态检查与自解释文档
Install this agent skill to your Project
npx add-skill https://github.com/Dwsy/agent/tree/main/skills/cf-tunnel
SKILL.md
Cloudflare Tunnel 管理技能(统一版)
目标:把“临时暴露 + 管理面板 + 端口管理”统一到一个命令入口,避免端口混乱。
✅ 推荐入口(统一 Bun CLI)
bun ~/.pi/agent/skills/cf-tunnel/scripts/cf.ts
命令总览
# 启动临时暴露(等同 share start)
bun ~/.pi/agent/skills/cf-tunnel/scripts/cf.ts start --dir ./demos/html
# 暴露已有端口
bun ~/.pi/agent/skills/cf-tunnel/scripts/cf.ts start --port 8766
# 暴露单文件
bun ~/.pi/agent/skills/cf-tunnel/scripts/cf.ts start --file ./demos/html/index.html --route /index.html
# 启动/停止/查看面板
bun ~/.pi/agent/skills/cf-tunnel/scripts/cf.ts panel start --port 8788 --host 127.0.0.1
bun ~/.pi/agent/skills/cf-tunnel/scripts/cf.ts panel status
bun ~/.pi/agent/skills/cf-tunnel/scripts/cf.ts panel stop
# 综合状态(share + panel)
bun ~/.pi/agent/skills/cf-tunnel/scripts/cf.ts status
# 停止(默认全停)
bun ~/.pi/agent/skills/cf-tunnel/scripts/cf.ts stop
# 只停 share
bun ~/.pi/agent/skills/cf-tunnel/scripts/cf.ts stop --share
# 只停 panel
bun ~/.pi/agent/skills/cf-tunnel/scripts/cf.ts stop --panel
功能特性
- 统一入口:
cf.ts同时管理 share / panel - 端口自动避让:面板端口占用时自动切换到下一个可用端口
- 会话清晰:固定 tmux session 名
cf-share-webcf-share-tunnelcf-share-panel
- 状态聚合:一个命令看完整状态(本地服务 / tunnel / panel / 公网 URL)
- 向后兼容:
share.ts、panel.ts仍可直接使用
底层命令(兼容保留)
# share 底层
bun ~/.pi/agent/skills/cf-tunnel/scripts/share.ts start --dir ./demos/html
bun ~/.pi/agent/skills/cf-tunnel/scripts/share.ts status
bun ~/.pi/agent/skills/cf-tunnel/scripts/share.ts stop
# panel 底层
bun ~/.pi/agent/skills/cf-tunnel/scripts/panel.ts --port 8788 --host 127.0.0.1
建议优先使用
cf.ts,底层命令主要用于调试。
API 与面板
启动面板后默认地址:
http://127.0.0.1:8788(若占用会自动避让)
API:
GET /api/status当前状态POST /api/start启动(body 支持port/dir/file/route)POST /api/stop停止GET /api/logs日志 tailGET /api/history历史记录POST /api/history/clear清空历史
依赖
# Cloudflared(如未安装)
wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb
本地静态服务优先级:python3 > bunx > npx(无可用工具时直接失败)
故障排查
cf.ts status先看三类会话是否在线- 如果 tunnel 无 URL:检查
~/.cf-tunnel/share-tunnel.log - 如果 panel 打不开:
cf.ts panel status看实际端口(可能已自动避让) - 彻底重置:
cf.ts stop --all后重新start
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
undo-redo
Use the undo_redo tool to rewind or reapply buffered file changes or inspect diffs without UI navigation. Use when you need to adjust or verify changes in the current session history.
exa
使用 Exa.ai API 进行高质量的互联网搜索。需要 EXA_API_KEY 环境变量。
backend-unit-test
后端单元测试技能。触发场景: - 用户要求运行/创建单元测试 - 用户要求验证数据 - 用户要求用 Maven 运行测试 - 关键词:test, maven test, junit, springboot test, 单元测试, 测试验证 核心:不改 pom,用 reactor 模式运行。
mermaid-flow-image
将流程需求整理为可渲染的 Mermaid(简化版/详细版),并通过 Kroki 生成可发送的高分辨率 PNG 图片。适用于“把架构流程画出来并直接发图”的场景。
web-browser
Allows to interact with web pages by performing actions such as clicking buttons, filling out forms, and navigating links. It works by remote controlling Google Chrome or Chromium browsers using the Chrome DevTools Protocol (CDP). When Claude needs to browse the web, it can use this skill to do so.
ralph-loop-gen
任务管理系统模板生成器 - 根据用户输入或JSON配置生成完整的任务管理结构(模板生成器,非直接执行器)
Didn't find tool you were looking for?