Install
openclaw skills install remote-console通过手机/浏览器远程访问主机上的 Claude Code 或其他 CLI 工具。使用此技能来启动、停止和管理远程开发环境。 **必须触发此技能的场景**: - 用户提到"远程控制台"、"远程终端"、"远程开发"、"ttyd"、"SSH 隧道" - 用户想用手机/平板访问电脑上的开发环境 - 用户提到"移动端编程"...
openclaw skills install remote-console通过 ttyd + SSH 隧道,在手机浏览器中访问主机上的 Claude Code。
所有操作必须通过 Python 脚本执行,禁止直接拼接 Shell 命令!
脚本目录:./scripts/(与 SKILL.md 同目录)
pip install psutil
python ./scripts/start_console.py <项目名>
python ./scripts/start_console.py <项目名> -c <命令名>
python ./scripts/start_console.py --path /path/to/project
python ./scripts/stop_console.py
python ./scripts/check_tunnel.py
python ./scripts/check_tunnel.py --json
python ./scripts/validate_config.py
触发: "打开 {项目名} 的远程控制台"
执行:
python ./scripts/start_console.py {项目名}
返回格式:
✅ 远程控制台已启动
📁 项目:{项目名称}
🔗 访问地址:http://{host}:{port}
📂 工作目录:{project.path}
🚀 启动命令:{command}
触发: "关闭远程控制台" / "停止远程终端"
执行:
python ./scripts/stop_console.py
触发: "远程控制台状态" / "检查隧道"
执行:
python ./scripts/check_tunnel.py
触发: "验证远程控制台配置"
执行:
python ./scripts/validate_config.py
查看所有项目:
python ./scripts/start_console.py
配置文件:./config.json(与 SKILL.md 同目录)
{
"servers": {
"default": {
"name": "my-server",
"host": "your-server.com",
"port": 2222,
"user": "your-username",
"ssh_alias": "ssh-config-alias"
}
},
"ttyd": {
"port": 7681,
"path": "ttyd",
"options": "-W -t fontSize=16"
},
"defaults": {
"command": "claude",
"server": "default"
},
"commands": {
"claude": "claude",
"claude-bypass": "claude --dangerously-skip-permissions",
"codex": "codex"
},
"projects": {
"项目名": {
"path": "/path/to/project",
"command": "claude-bypass"
}
}
}
| 名称 | 实际命令 | 说明 |
|---|---|---|
| claude | claude | 标准 Claude Code |
| claude-bypass | claude --dangerously-skip-permissions | ⚠️ 跳过权限检查 |
| codex | codex | OpenAI Codex |
| cursor | cursor-agent | Cursor Agent |
claude-bypass 使用 --dangerously-skip-permissions 标志,会跳过所有权限检查。
仅在以下情况使用:
绝不使用于:
| 问题 | 解决方案 |
|---|---|
| 链接无法访问 | 运行 check_tunnel.py 检查隧道状态 |
| 配置错误 | 运行 validate_config.py 验证配置 |
| 端口被占用 | 运行 stop_console.py 先停止再启动 |
手机浏览器 → 服务器:{port} → SSH 隧道 → 主机 ttyd → Shell + Claude Code
pip install psutilconfig.json 中的服务器信息ssh {ssh_alias} echo testscoop install ttyd,Linux sudo apt install ttydGatewayPorts yes 和 AllowTcpForwarding yespython ./scripts/validate_config.py