macOS 菜单栏实时显示 OpenClaw agent 的上下文用量、模型和运行状态。基于 SwiftBar。
Real-time OpenClaw agent observability in your macOS menu bar, powered by SwiftBar.
Version: 1.1.0 Platform: macOS only Author: @hjklasdfg Source: GitHub
🔧 140k)text
🔧 98k ← menu bar
───────────────────────────────
🦞 OpenClaw Agents (6)
───────────────────────────────
▶ 🔧 tech 98k/1000k (9%) │ opus │ 26s ago
— 🎮 main 50k/1000k (5%) │ opus │ 2m ago
— 🎯 career 52k/1000k (5%) │ opus │ 1m ago
— ✍️ content 40k/1000k (4%) │ opus │ 20h ago
— 💰 finance 52k/200k (26%) │ haiku │ 1h ago
✖ 🧠 phil 26k/1000k (2%) │ opus │ 3d ago
───────────────────────────────
Refresh
Choose the scenario that matches your setup:
Everything on one machine — OpenClaw and the menu bar monitor.
bash
# 1. Install the skill via OpenClaw CLI
openclaw skills install menubar-context-monitor
# 2. Run the installer
bash ~/.openclaw/skills/context-monitor/scripts/install.sh
Most common setup — OpenClaw runs on a server / Raspberry Pi / Mac Mini, and you want the menu bar on your MacBook. No OpenClaw installation needed on the MacBook.
bash
# 1. Clone the repo
git clone https://github.com/hjklasdfg/openclaw-context-monitor.git
cd openclaw-context-monitor
# 2. Run the installer with your OpenClaw host's SSH address
bash scripts/install.sh --remote user@host
Example:
bash scripts/install.sh --remote linyili@192.168.1.100SSH key auth is required. If not set up yet, the installer will guide you.
If you have OpenClaw running locally, you can also just tell your agent:
"Help me set up agent menu bar monitoring"
The agent will read this skill and walk you through it.
When SwiftBar opens for the first time, it asks you to choose a plugin folder. Press Cmd+Shift+G and paste:
text
~/Library/Application Support/SwiftBar/Plugins
The installer places the plugin script in this directory. You only need to do this once.
text
SwiftBar plugin (your Mac) → SSH → status collector (OpenClaw host) → sessions.json
or locally ↗
Two components:
openclaw-status.py — Reads agent session data on the OpenClaw hostswiftbar-plugin.sh — Renders the menu bar on your MacSettingHow to changeRefresh intervalRename plugin: 30s → 10s, 1m, 5mWarning thresholdEdit WARN = 100000 in the pluginSSH targetEdit MINI= in plugin or set OPENCLAW_SSH_TARGET env var
Reads from each agent's IDENTITY.md:
markdown
- **Emoji:** 🔧
Falls back to agent name if not set.
Shows short aliases: opus, sonnet, haiku, flash, pro. User-configured modelAliases in openclaw.json take priority.
Menu barMeaningFix🦞 ❌Connection failedCheck SSH / network🦞 ⚠️Data parse errorRun python3 ~/.openclaw/openclaw-status.py on hostAgent missingNo session data yetUse the agent once to generate a session
MIT
When a user asks to set up context monitoring, follow this flow:
Before starting: This skill requires running commands on a Mac. If the user might be on a mobile device:
"This needs to run on a Mac. Are you at your Mac now? If you're on another device, I'll send you the commands to run later."
Step 1: Ask the user:
"Does OpenClaw run on this Mac, or on a remote machine? If remote, what's the SSH address? (e.g.
user@hostname)"
Step 2 (local mode): Run the installer directly:
bash
bash scripts/install.sh --yes
Step 2 (remote mode): The agent cannot install SwiftBar on the user's Mac remotely. Instead:
Deploy the status collector to the OpenClaw host: bash
scp scripts/openclaw-status.py <user>@<host>:~/.openclaw/openclaw-status.py
Generate copy-paste instructions for the user with the full install command, including the correct SSH target baked in.
SwiftBar installation: If SwiftBar needs to be installed, ask the user for permission first:
"This requires installing SwiftBar (a macOS menu bar tool). OK to install?"
After confirmation, pass --yes to skip the script's interactive prompt.
menu bar, SwiftBar, agent status, agent monitor, observability, dashboard mac, agent context, context monitor, 菜单栏, 上下文显示, agent 监控