← 返回
AI智能 中文

OpenClaw Usage Manager

Monitors dual Claude Max accounts' 5h/7d usage, shows real-time dashboard, and auto-switches when utilization exceeds 80%.
监控双Claude Max账户5小时/7天用量,实时展示仪表盘,超80%自动切换。
takao-mochizuki
AI智能 clawhub v1.1.0 1 版本 99866.8 Key: 无需
★ 0
Stars
📥 750
下载
💾 6
安装
1
版本
#latest

概述

OpenClaw Usage Manager

Monitor and auto-switch between two Claude Max accounts (C1/C2) based on 5-hour and 7-day utilization rates.

What This Does

  • Usage Dashboard: Browser UI showing C1/C2 utilization in real time
  • Auto-Switcher: Checks rates every 3h (via cron), switches when either 5h OR 7d hits 80%
  • Security-audited: Reviewed by Claude Code + Codex before release

Setup

See full setup guide: https://github.com/Takao-Mochizuki/openclaw-usage-manager

Quick Start

# 1. Clone and install
git clone https://github.com/Takao-Mochizuki/openclaw-usage-manager.git
mkdir -p ~/.openclaw/workspace/tools/usage-dashboard
mkdir -p ~/.openclaw/workspace/tools/usage-switch
cp usage-dashboard/server.mjs ~/.openclaw/workspace/tools/usage-dashboard/
cp usage-switch/check.mjs ~/.openclaw/workspace/tools/usage-switch/
cp usage-switch/setup-tokens.sh ~/.openclaw/workspace/tools/usage-switch/

# 2. Configure 1Password item IDs in setup-tokens.sh and server.mjs
# Replace "your-c1-item-id" and "your-c2-item-id" with your actual 1Password item IDs

# 3. Run one-time token setup (requires TouchID)
chmod +x ~/.openclaw/workspace/tools/usage-switch/setup-tokens.sh
~/.openclaw/workspace/tools/usage-switch/setup-tokens.sh

# 4. Add usage alias to ~/.zshrc
alias usage='lsof -ti:18800 | xargs kill -9 2>/dev/null; sleep 0.5; node ~/.openclaw/workspace/tools/usage-dashboard/server.mjs & sleep 1 && open http://localhost:18800'

Usage

# Launch dashboard
usage

# Check utilization (JSON output)
node ~/.openclaw/workspace/tools/usage-switch/check.mjs

# Output example:
# {"c1":{"5h":7,"7d":43,"over":false},"c2":{"5h":4,"7d":69,"over":false},"current":"C2","needSwitch":false}

OpenClaw Cron (Auto-Switch every 3h)

Set up a cron job in OpenClaw with schedule 0 /3 :

Run: node ~/.openclaw/workspace/tools/usage-switch/check.mjs
If needSwitch is true → run openclaw gateway restart and notify your channel.
If bothOver is true → post manual intervention request.
Otherwise → silent.

Requirements

  • OpenClaw installed
  • Claude Max × 2 accounts
  • Node.js >= 18
  • 1Password CLI (op) recommended for secure token storage

Security

  • tokens.json: chmod 600, excluded from git
  • Atomic writes: tmp file + renameSync
  • Dashboard: localhost-only, CSRF tokens, POST-only API
  • Audited by Claude Code + Codex

Links

  • GitHub: https://github.com/Takao-Mochizuki/openclaw-usage-manager
  • Author: @5dmgmt (五次元経営株式会社)

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-03-19 18:36 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Nano Banana Pro

steipete
使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。
★ 418 📥 115,248
ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 836 📥 213,209
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,358 📥 318,511