Token Burn Monitor

👤 kasparchen 📦 v5.3.1 ⭐ 4.5 ⬇️ 1.1K 下載
🔒 IT運維與安全 免費

📖 技能介紹

Token Burn Monitor

Zero-dependency Node.js dashboard. Core API + swappable frontend themes.

Architecture

server.js          → Core API (stable, don't modify)
themes/default/    → Default dark dashboard theme
themes/<custom>/   → User/agent-generated themes
API.md             → API contract for theme developers
config.json        → Port, theme, agents, pricing overrides

Quick Start

bash start.sh            # Start (default port 3847)
bash start.sh status     # Check status
bash start.sh restart    # Restart after config change
bash start.sh stop       # Stop

Configuration

Copy config.default.json to config.json:

{
  "port": 3847,
  "theme": "default",
  "agents": {
    "main": { "name": "Karl", "icon": "/assets/karl.png" }
  },
  "modelPricing": {}
}
  • theme: Directory name under themes/. Default: "default"
  • agents: Display names/icons. Auto-discovered; config only overrides display.
  • port: Also settable via PORT env var.
  • modelPricing: Override/add model pricing ($/1M tokens).

Set OPENCLAW_AGENTS_DIR to override agent directory (default: /home/node/.openclaw/agents).

Themes

Themes live in themes/<name>/. Minimum: one index.html that fetches data from the API.

To create a custom theme:

  1. Read API.md for all available endpoints
  2. Create themes/my-theme/index.html
  3. Set "theme": "my-theme" in config.json
  4. Restart

The default theme (themes/default/) is a full reference implementation.

API Overview

All endpoints return JSON. GET-only. Server binds to localhost. Full docs in API.md.

Endpoint Description
GET /api/config Agent names and icons
GET /api/stats?date= All agents aggregated
GET /api/agent/:id?date= Single agent with per-call breakdown
GET /api/history?days= 30-day cost history
GET /api/pricing Model pricing table
GET /api/crons Scheduled jobs (read from filesystem)
GET /api/cron/:id/runs Job run history

Security

  • Server binds to 127.0.0.1 by default (localhost only)
  • No shell execution — all data read from filesystem
  • No outbound network requests — default theme uses system fonts
  • User prompts redacted by default ([redacted]), opt-in via showPrompts: true in config
  • HTML responses include CSP: connect-src 'self'; font-src 'self'

    訪問小蔥技能站7w4.net,解鎖更多實用的AI技能外掛。

  • GET-only — all other HTTP methods rejected

Troubleshooting

  • No data: Verify OPENCLAW_AGENTS_DIR points to correct agents directory.
  • Port conflict: PORT=4000 bash start.sh
  • Theme not loading: Check themes/<name>/index.html exists.

🤖 AI 評測

這是一個質量很高的監控 Dashboard Skill。文件非常詳細,配置靈活,支援自定義主題和安全保護(提示詞預設脫敏)。介面美觀,功能實用,可以追蹤每個 agent 的 token 消耗、費用和快取效率。優點是零依賴、啟動簡單、安全性強。不足之處是缺少自動化測試,錯誤提示資訊有限。不過對於普通使用者來說開箱即用,安裝和配置都很直觀,是一個值得安裝的生產級工具。

📊 多維度評分

適應性4.3
規範性4.3
有效性4.8
可靠性4.4
可信度4.8

📁 包含檔案 (9 個)

📄 API.md 5.4 KB
📄 README.md 7.6 KB
📄 SKILL.md 3.5 KB
📄 _meta.json 137 B
📄 config.default.json 103 B
📄 server.js 23.8 KB
📄 setup.sh 479 B
📄 start.sh 1.4 KB
📄 themes/default/index.html 41.7 KB