GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - RyanMeg123/openclaw-monitor: Real-time monitoring dashboard for OpenClaw AI Agent — track tool calls, conversations, token usage & costs locally. Zero dependencies, MIT license.

BranchesTags
Open more actions menu

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
bin
bin
 
 
public
public
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
android-chrome-192x192.png
android-chrome-192x192.png
 
 
android-chrome-512x512.png
android-chrome-512x512.png
 
 
apple-touch-icon.png
apple-touch-icon.png
 
 
favicon-16x16.png
favicon-16x16.png
 
 
favicon-32x32.png
favicon-32x32.png
 
 
favicon.ico
favicon.ico
 
 
fix_screenshot.py
fix_screenshot.py
 
 
image-cn.png
image-cn.png
 
 
image.png
image.png
 
 
index.html
index.html
 
 
index.html.backup
index.html.backup
 
 
screenshot-en.png
screenshot-en.png
 
 
screenshot.png
screenshot.png
 
 
server.py
server.py
 
 
setup.py
setup.py
 
 
site.webmanifest
site.webmanifest
 
 

Repository files navigation

🦞 OpenClaw Monitor

中文 | English

Python License GitHub Pages


🇨🇳 中文

简介

OpenClaw Gateway 实时监控面板 — 通过读取本地日志文件,实时显示 OpenClaw Agent 的工具调用、对话记录、token 用量等信息。

🔗 在线预览: https://ryanmeg123.github.io/openclaw-monitor

预览

OpenClaw Monitor 截图

功能特性

  • 实时日志流 — 每3秒读取 gateway.log,显示 tavily 搜索、API 请求等
  • 对话监控 — 每2秒读取 session JSONL,捕获工具调用、用户消息、Agent 回复
  • Token 用量 — 实时显示 token 消耗和成本
  • 安全预警 — Shell 调用频率过高、危险命令、文件删除等自动报警
  • 工具调用记录 — 可视化展示每次工具调用及结果
  • 多语言支持 — 支持中文/英文切换界面

快速开始

方式一:直接运行(推荐)

git clone https://github.com/RyanMeg123/openclaw-monitor.git
cd openclaw-monitor
python3 server.py

浏览器会自动打开 http://127.0.0.1:19999。

方式二:安装为命令行工具

git clone https://github.com/RyanMeg123/openclaw-monitor.git
cd openclaw-monitor
pip3 install -e .

# 之后任何地方都可以运行:
openclaw-monitor

命令行参数

用法: python3 server.py [选项]

选项:
  --port, -p PORT         监听端口 (默认: 19999)
  --openclaw-dir, -d DIR  OpenClaw 数据目录 (默认自动检测)
  --no-open               不自动打开浏览器
  -h, --help              显示帮助

示例:

# 自定义端口
python3 server.py --port 8080

# 指定 OpenClaw 目录
python3 server.py --openclaw-dir /custom/path/.openclaw

# 不自动打开浏览器
python3 server.py --no-open

系统要求

  • Python 3.7+
  • macOS / Linux(Windows 需要 WSL)
  • 已安装并运行 OpenClaw

故障排查

问题:启动后显示 "OpenClaw 目录不存在" 或 "Gateway 日志不存在"

  1. 确认 OpenClaw 已安装

    openclaw status

    如果命令找不到,请先安装 OpenClaw。

  2. 确认 OpenClaw 已运行过

    • 首次安装后需要运行一次 openclaw 命令
    • 确保生成了 ~/.openclaw/logs/gateway.log 文件
  3. OpenClaw 安装在非标准位置

    # 指定自定义 OpenClaw 目录
    python3 server.py --openclaw-dir /path/to/.openclaw
  4. 检查自动检测结果

    python3 server.py
    # 查看启动时显示的 "OpenClaw 目录" 路径是否正确

问题:监控面板没有数据显示

  1. 确认 OpenClaw 正在运行(有活跃的对话)
  2. 检查浏览器开发者工具 Console 是否有错误
  3. 确认访问的是 http://127.0.0.1:19999,不是 file:// 协议

目录结构

openclaw-monitor/
├── server.py          # 本地 HTTP 服务器(核心)
├── public/
│   └── index.html     # 监控面板前端(支持中英文)
├── bin/
│   └── openclaw-monitor  # 命令行入口脚本
├── setup.py           # pip 安装配置
└── README.md          # 本文件

工作原理

监控面板不使用 WebSocket(因为 OpenClaw Gateway 的 WebSocket 只允许一个 webchat 连接),而是通过本地 HTTP 服务器轮询读取文件:

  • GET /logs → 读取 ~/.openclaw/logs/gateway.log 最后200行
  • GET /session → 读取 ~/.openclaw/agents/main/sessions/ 最新 JSONL 文件最后80行
  • GET /health → 检查服务状态
  • GET / → 提供监控面板 HTML

前端每2~3秒增量拉取新数据,只处理新增内容。


🇺🇸 English

Introduction

OpenClaw Gateway real-time monitoring dashboard — displays OpenClaw Agent's tool calls, conversation records, token usage, and more by reading local log files.

🔗 Live Demo: https://ryanmeg123.github.io/openclaw-monitor

Preview

OpenClaw Monitor Screenshot

Features

  • Real-time Log Stream — Reads gateway.log every 3 seconds, displays tavily searches, API requests, etc.
  • Conversation Monitor — Reads session JSONL every 2 seconds, captures tool calls, user messages, Agent replies
  • Token Usage — Real-time display of token consumption and costs
  • Security Alerts — Automatic alerts for high-frequency Shell calls, dangerous commands, file deletions
  • Tool Call Records — Visual display of each tool call and results
  • Multi-language Support — Interface supports Chinese/English switching

Quick Start

Method 1: Direct Run (Recommended)

git clone https://github.com/RyanMeg123/openclaw-monitor.git
cd openclaw-monitor
python3 server.py

The browser will automatically open http://127.0.0.1:19999.

Method 2: Install as CLI Tool

git clone https://github.com/RyanMeg123/openclaw-monitor.git
cd openclaw-monitor
pip3 install -e .

# Then run from anywhere:
openclaw-monitor

Command Line Arguments

Usage: python3 server.py [options]

Options:
  --port, -p PORT         Listen port (default: 19999)
  --openclaw-dir, -d DIR  OpenClaw data directory (auto-detect by default)
  --no-open               Don't open browser automatically
  -h, --help              Show help

Examples:

# Custom port
python3 server.py --port 8080

# Specify OpenClaw directory
python3 server.py --openclaw-dir /custom/path/.openclaw

# Don't open browser
python3 server.py --no-open

System Requirements

  • Python 3.7+
  • macOS / Linux (Windows requires WSL)
  • OpenClaw installed and running

Troubleshooting

Problem: Shows "OpenClaw directory does not exist" or "Gateway log not found"

  1. Confirm OpenClaw is installed

    openclaw status

    If command not found, please install OpenClaw first.

  2. Confirm OpenClaw has been run

    • After first installation, need to run openclaw command once
    • Ensure ~/.openclaw/logs/gateway.log file is generated
  3. OpenClaw installed in non-standard location

    # Specify custom OpenClaw directory
    python3 server.py --openclaw-dir /path/to/.openclaw
  4. Check auto-detection result

    python3 server.py
    # Check if the "OpenClaw directory" path shown at startup is correct

Problem: Monitor panel shows no data

  1. Confirm OpenClaw is running (has active conversations)
  2. Check browser developer tools Console for errors
  3. Ensure accessing via http://127.0.0.1:19999, not file:// protocol

Directory Structure

openclaw-monitor/
├── server.py          # Local HTTP server (core)
├── public/
│   └── index.html     # Dashboard frontend (bilingual)
├── bin/
│   └── openclaw-monitor  # CLI entry script
├── setup.py           # pip install config
└── README.md          # This file

How It Works

The monitoring panel doesn't use WebSocket (because OpenClaw Gateway's WebSocket only allows one webchat connection), but instead polls files through a local HTTP server:

  • GET /logs → Read last 200 lines of ~/.openclaw/logs/gateway.log
  • GET /session → Read last 80 lines of latest JSONL in ~/.openclaw/agents/main/sessions/
  • GET /health → Check service status
  • GET / → Serve dashboard HTML

Frontend pulls new data incrementally every 2-3 seconds, only processing new content.


🛠️ Development Background

中文

在尝试直接连接 OpenClaw WebSocket Gateway 时,发现 Gateway 对每个客户端类型(webchat)只允许一个连接,导致监控面板和官方 webchat 互相踢掉对方。因此改用读取日志文件的方案,稳定可靠,不干扰正常使用。

English

When trying to directly connect to OpenClaw WebSocket Gateway, we found that Gateway only allows one connection per client type (webchat), causing the monitoring panel and official webchat to kick each other out. Therefore, we switched to a log file reading solution, which is stable, reliable, and doesn't interfere with normal use.


📄 License / 许可证

MIT License - see LICENSE file for details.


Made with 🦞 by Ryan's Suit

Report Bug · Request Feature

About

Real-time monitoring dashboard for OpenClaw AI Agent — track tool calls, conversations, token usage & costs locally. Zero dependencies, MIT license.

ryanmeg123.github.io/openclaw-monitor

Topics

ai-agentdashboardmonitoringopen-sourceopenclawpython

Resources

Readme
Activity

Stars

4 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.