← 返回 Skills 市场
18
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install cc-log-viewer
功能描述
实时 Log Viewer,捕获 Claude Code 终端输出,通过 WebSocket 推送到浏览器页面实时显示。用于远程/移动设备上观察 CC 执行任务的过程,或者将 CC 终端嵌入监控面板。同时也提供 CC 进程管理和命令行发送功能。
使用说明 (SKILL.md)
Cc Log Viewer
实时捕获 Claude Code 终端输出,通过 WebSocket 推送到浏览器。支持远程/移动设备观察 CC 执行任务,也可嵌入监控面板。
快速开始
前置条件
| 条件 | 说明 |
|---|---|
| Node.js ≥ v18 | 运行后端服务 |
| npm | 包管理 |
| Claude Code CLI | 需 claude 命令可用 |
| C++ 编译工具 | node-pty 编译需要(Linux: build-essential, macOS: Xcode CLT) |
网络要求
服务端和浏览器之间需要网络可达:
| 场景 | 方案 |
|---|---|
| 同一台机器 | http://localhost:18798/,无需额外配置 |
| 局域网(同 WiFi) | 用服务端局域网 IP,如 http://192.168.1.x:18798/ |
| 远程/移动设备 | 推荐装 Tailscale,手机连上后通过 Tailscale IP 访问,无需公网 IP 或端口转发 |
⚠️ 手机和服务端不在同一网络且没有 Tailscale 时,浏览器会显示空白或反复重连。
安装
cd ~/.openclaw/workspace/skills/cc-log-viewer
cd assets && npm install && cd ..
bash assets/start-all.sh
验证
curl http://localhost:18798/api/status
# → {"running":true,"clients":0,"bufferLines":87}
访问浏览器
http://localhost:18798/
嵌入模式:http://localhost:18798/?embed=1
HTTP API
| 方法 | 路径 | 说明 |
|---|---|---|
GET |
/api/status |
状态查询 |
POST |
/api/send |
向 CC 发命令(body: {"command":"..."}) |
POST |
/api/restart |
重启 CC 进程 |
技术架构
log-streamer.js (单进程,端口可配置 — 默认 18798)
├─ node-pty — 为 CC 提供真实 pty 环境
│ ↓ stdout
├─ 环形缓冲 (1000行)
│ ↓ 100ms 轮询
├─ WebSocket Server — 实时推送
│ ↓
├─ xterm.js (自托管 /cdn/) — 浏览器终端渲染
└─ HTTP API
停止
kill $(lsof -t -i:18798) 2>/dev/null
# 仅重启 CC 不停服务:
curl -X POST http://localhost:18798/api/restart
文件
| 路径 | 说明 |
|---|---|
scripts/log-streamer.js |
后端服务(HTTP + WebSocket + CC 进程管理) |
assets/index.html |
前端 xterm.js 页面 |
assets/start-all.sh |
一键启动脚本 |
assets/package.json |
npm 依赖 |
安全使用建议
Install only in a tightly controlled local environment, and do not expose this service to a LAN, Tailscale network, or the internet unless you add authentication, localhost-only defaults, and remove --dangerously-skip-permissions. Treat anything shown in the terminal viewer as potentially sensitive, and review the startup script because it may terminate unrelated services on the selected port.
能力评估
Purpose & Capability
The log-viewing purpose is coherent and the docs disclose command sending and process management, but the implementation also creates a high-impact remote control surface for a live Claude session.
Instruction Scope
The service listens on 0.0.0.0, allows all CORS origins, accepts HTTP and WebSocket commands, and documents LAN/Tailscale access without clear authentication, authorization, or exposure warnings.
Install Mechanism
The startup script installs normal npm dependencies but also kills any process on the configured port and starts a background server with nohup, without ownership checks or confirmation.
Credentials
Mirroring terminal output to network clients can expose prompts, paths, secrets, and operational data; this is not proportionate without localhost-only defaults or access controls.
Persistence & Privilege
The server is long-running, can restart the Claude subprocess remotely, and launches Claude with --dangerously-skip-permissions while inheriting the process environment.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install cc-log-viewer - 安装完成后,直接呼叫该 Skill 的名称或使用
/cc-log-viewer触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
移除无关的 /api/graph 接口(知识图谱数据不在此 skill 范围内)
v1.0.0
- Initial release of cc-log-viewer.
- Real-time log viewer for Claude Code, streaming terminal output to browsers via WebSocket.
- Supports remote/mobile monitoring and embedding in dashboards.
- Includes CC process management and remote command sending through HTTP API.
- Provides quick setup guides, mobile access via Tailscale, and embedded terminal UI with xterm.js.
- Offers essential HTTP endpoints for status, command execution, process restart, and knowledge graph data.
元数据
常见问题
Cc Log Viewer 是什么?
实时 Log Viewer,捕获 Claude Code 终端输出,通过 WebSocket 推送到浏览器页面实时显示。用于远程/移动设备上观察 CC 执行任务的过程,或者将 CC 终端嵌入监控面板。同时也提供 CC 进程管理和命令行发送功能。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 18 次。
如何安装 Cc Log Viewer?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install cc-log-viewer」即可一键安装,无需额外配置。
Cc Log Viewer 是免费的吗?
是的,Cc Log Viewer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Cc Log Viewer 支持哪些平台?
Cc Log Viewer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Cc Log Viewer?
由 zn(@1zn)开发并维护,当前版本 v1.0.1。
推荐 Skills