RTS Dashboard
A StarCraft/C&C-inspired tactical command center for OpenClaw monitoring.
Agent Actions
Start Dashboard
When the user wants to open/view/launch the dashboard, or when visiting 127.0.0.1:4320 fails:
- 1. Check if already running:
Get-NetTCPConnection -LocalPort 4320 -ErrorAction SilentlyContinue
- 2. If not running, start it in background:
cd "<skill_dir>"; node server.js
Use
exec with
background: true and
yieldMs: 3000, then check logs to confirm
⚡ Online message.
- 3. If
node_modules/ is missing, run npm install first. - Tell the user:
http://127.0.0.1:4320 is ready.
Stop Dashboard
CODEBLOCK2
Quick Start (Manual)
CODEBLOCK3
Open http://127.0.0.1:4320 in browser.
Requirements
- - Node.js 18+
- OpenClaw Gateway running (default port 18789)
- INLINECODE9 npm package (auto-installed via
npm install)
Features
- - Tactical map: Active agents as diamond nodes with orbiting skill dots and trail animation
- Left panel: Full agent list + skill library with search
- Right panel: System vitals (CPU/RAM), gateway status, event logs, selected target details
- Agent detail: Model, current task, deployed skills, recent conversation
- Skill detail: Description, use cases, related agents
- Chat bar: Send messages to agents via Gateway WebSocket
chat.send RPC - Cron jobs: Display scheduled tasks with status on the map
- 5-min cooldown: Agents remain visible for 5 minutes after going offline (amber blink + countdown)
- CRT scan line + radar sweep + grid: Full military-UI aesthetic
Configuration
Environment variables (all optional):
| Variable | Default | Description |
|---|
| INLINECODE12 | INLINECODE13 | Dashboard HTTP port |
| INLINECODE14 |
18789 | Gateway port |
|
OPENCLAW_HOME |
~/.openclaw | OpenClaw home directory |
|
OPENCLAW_GATEWAY_TOKEN | (from config) | Gateway auth token |
Authentication
The dashboard implements Ed25519 device signing for Gateway WebSocket authentication:
- - On first launch, generates a keypair and saves to INLINECODE19
- Signs each
connect.challenge nonce using v3 protocol - Gateway token is auto-discovered from
OPENCLAW_GATEWAY_TOKEN env var or gateway.auth.token in INLINECODE23 - Localhost connections are auto-approved by Gateway (no manual pairing needed)
- No
dangerouslyDisableDeviceAuth or allowInsecureAuth required
Cross-Platform
- - OpenClaw installation path auto-detected via
require.resolve → which/where → npm root -g → fallback paths - Skill directories:
~/.agents/skills/ (user) + {openclaw}/skills/ (built-in) + {openclaw}/extensions/*/skills/ (extensions) - Agent/skill config parsed via
JSON.parse (robust, no regex) - Works on Windows, macOS, and Linux
Gateway Requirements
The dashboard needs the Gateway to allow its WebSocket origin:
CODEBLOCK4
This is the only Gateway config change needed. Apply with openclaw config set gateway.controlUi.allowedOrigins '["http://127.0.0.1:4320"]' or via the Control UI config panel.
Data Sources (refreshed every 3 seconds)
- - Agents:
~/.openclaw/openclaw.json → INLINECODE35 - Skills: Filesystem scan of skill directories
- Active sessions:
.jsonl.lock files in INLINECODE37 - System vitals: Node.js
os module (CPU delta sampling every 2s) - Gateway status: HTTP GET to gateway root
- Cron jobs: INLINECODE39
File Structure
CODEBLOCK5
RTS仪表盘
一款受《星际争霸》/《命令与征服》启发的战术指挥中心,用于OpenClaw监控。
智能体操作
启动仪表盘
当用户想要打开/查看/启动仪表盘,或访问127.0.0.1:4320失败时:
- 1. 检查是否已在运行:
powershell
Get-NetTCPConnection -LocalPort 4320 -ErrorAction SilentlyContinue
- 2. 如果未运行,在后台启动:
powershell
cd
; node server.js
使用exec并设置background: true和yieldMs: 3000,然后检查日志确认⚡ Online消息。
- 3. 如果缺少node_modules/,先运行npm install。
- 告知用户:http://127.0.0.1:4320已就绪。
停止仪表盘
powershell
Get-NetTCPConnection -LocalPort 4320 | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }
快速启动(手动)
bash
cd rts-dashboard
npm install
node server.js
在浏览器中打开http://127.0.0.1:4320。
系统要求
- - Node.js 18+
- OpenClaw网关正在运行(默认端口18789)
- ws npm包(通过npm install自动安装)
功能特性
- - 战术地图:活跃智能体以菱形节点显示,带有环绕技能点和轨迹动画
- 左侧面板:完整智能体列表 + 技能库(支持搜索)
- 右侧面板:系统状态(CPU/内存)、网关状态、事件日志、选定目标详情
- 智能体详情:模型、当前任务、已部署技能、近期对话
- 技能详情:描述、使用场景、相关智能体
- 聊天栏:通过网关WebSocket的chat.send RPC向智能体发送消息
- 定时任务:在地图上显示带状态的任务计划
- 5分钟冷却:智能体离线后仍可见5分钟(琥珀色闪烁 + 倒计时)
- CRT扫描线 + 雷达扫描 + 网格:完整的军事界面美学
配置
环境变量(均为可选):
| 变量 | 默认值 | 描述 |
|---|
| RTSPORT | 4320 | 仪表盘HTTP端口 |
| OPENCLAWGATEWAY_PORT |
18789 | 网关端口 |
| OPENCLAW_HOME | ~/.openclaw | OpenClaw主目录 |
| OPENCLAWGATEWAYTOKEN | (来自配置) | 网关认证令牌 |
身份认证
仪表盘实现了Ed25519设备签名用于网关WebSocket认证:
- - 首次启动时生成密钥对并保存到.device-keys.json
- 使用v3协议签署每个connect.challenge随机数
- 网关令牌自动从OPENCLAWGATEWAYTOKEN环境变量或openclaw.json中的gateway.auth.token发现
- 本地主机连接由网关自动批准(无需手动配对)
- 无需dangerouslyDisableDeviceAuth或allowInsecureAuth
跨平台支持
- - OpenClaw安装路径通过require.resolve → which/where → npm root -g → 回退路径自动检测
- 技能目录:~/.agents/skills/(用户)+ {openclaw}/skills/(内置)+ {openclaw}/extensions/*/skills/(扩展)
- 智能体/技能配置通过JSON.parse解析(健壮,无正则表达式)
- 支持Windows、macOS和Linux
网关要求
仪表盘需要网关允许其WebSocket来源:
json5
{
gateway: {
controlUi: {
allowedOrigins: [http://127.0.0.1:4320]
}
}
}
这是唯一需要修改的网关配置。可通过openclaw config set gateway.controlUi.allowedOrigins [http://127.0.0.1:4320]或通过控制UI配置面板应用。
数据源(每3秒刷新一次)
- - 智能体:~/.openclaw/openclaw.json → agents.list
- 技能:技能目录的文件系统扫描
- 活跃会话:~/.openclaw/agents/*/sessions/中的.jsonl.lock文件
- 系统状态:Node.js os模块(每2秒CPU增量采样)
- 网关状态:HTTP GET请求网关根路径
- 定时任务:~/.openclaw/cron/jobs.json
文件结构
rts-dashboard/
├── SKILL.md # 本文件
├── server.js # Node.js服务器(HTTP + WebSocket)
├── package.json # 依赖(仅ws)
└── public/
└── index.html # 单文件仪表盘(HTML + CSS + Canvas JS)