名称: vibetunnel
描述: 管理 VibeTunnel 终端会话。创建、列出、监控和控制 VibeTunnel 网页仪表板中可见的终端会话。
主页: https://github.com/AugmentedMomentum/vibetunnel
元数据: {"clawdbot":{"emoji":"🖥️","requires":{"bins":["vibetunnel","curl","jq"]},"primaryEnv":"VT_URL","install":[{"id":"vibetunnel","kind":"node","package":"vibetunnel","bins":["vibetunnel"],"label":"安装 VibeTunnel (npm)"}]}}
通过 REST API 管理 VibeTunnel 终端会话。可创建、列出、监控和控制网页仪表板中显示的会话。
VibeTunnel 服务必须正在运行。默认地址为 http://localhost:8080。可通过 VT_URL 环境变量覆盖此设置。
curl -s ${VT_URL:-http://localhost:8080}/api/health | jq .
curl -s ${VT_URL:-http://localhost:8080}/api/sessions | jq .
简洁视图:
curl -s ${VT_URL:-http://localhost:8080}/api/sessions | jq -r '.[] | "\(.status | if . == "running" then "●" else "○" end) \(.name) [\(.id | .[0:8])]"'
curl -s -X POST ${VT_URL:-http://localhost:8080}/api/sessions \
-H "Content-Type: application/json" \
-d '{"command": ["zsh", "-l", "-i"], "name": "my-session", "workingDir": "/path/to/dir"}' | jq .
参数说明:
- command: 数组 — 命令及其参数(默认:["zsh", "-l", "-i"])
- name: 字符串 — 显示名称
- workingDir: 字符串 — 工作目录
- cols: 数字 — 终端宽度(默认:120)
- rows: 数字 — 终端高度(默认:30)
curl -s ${VT_URL:-http://localhost:8080}/api/sessions/<id> | jq .
curl -s -X DELETE ${VT_URL:-http://localhost:8080}/api/sessions/<id> | jq .
curl -s -X POST ${VT_URL:-http://localhost:8080}/api/sessions/<id>/input \
-H "Content-Type: application/json" \
-d '{"text": "ls -la\n"}' | jq .
注意:需包含 \n 来执行命令。
curl -s -X POST ${VT_URL:-http://localhost:8080}/api/sessions/<id>/resize \
-H "Content-Type: application/json" \
-d '{"cols": 150, "rows": 40}' | jq .
启动 Claude Code 会话:
curl -s -X POST ${VT_URL:-http://localhost:8080}/api/sessions \
-H "Content-Type: application/json" \
-d '{"command": ["claude"], "name": "claude-code", "workingDir": "~/repos/my-project"}' | jq .
启动 tmux 会话:
curl -s -X POST ${VT_URL:-http://localhost:8080}/api/sessions \
-H "Content-Type: application/json" \
-d '{"command": ["tmux", "new", "-A", "-s", "work"], "name": "tmux-work"}' | jq .
清理已退出的会话:
curl -s ${VT_URL:-http://localhost:8080}/api/sessions | jq -r '.[] | select(.status == "exited") | .id' | \
xargs -I {} curl -s -X DELETE ${VT_URL:-http://localhost:8080}/api/sessions/{}
| 变量名 | 默认值 | 描述 |
|---|---|---|
VT_URL |
http://localhost:8080 |
VibeTunnel 服务器地址 |