A macOS status bar application for Pi with a local daemon for process discovery, telemetry aggregation, and one-click session jump/focus.
This repository contains:
pi-statusd(Python daemon): discovers Pi agents, merges telemetry, and handles jump/focus actions.PiStatusBar(SwiftUI app): menu bar UI that visualizes agent state and context pressure.
pi-statusbarconsumes telemetry from the separatepi-telemetrypackage.
Current version: 0.1.0
- macOS (menu bar app)
- Swift toolchain (
swift --version) - Python 3 (
python3 --version) - Pi installed (recommended for realistic testing)
git clone https://github.com/jademind/pi-statusbar.git
cd pi-statusbarswift builddaemon/statusdctl restart
daemon/statusdctl status
daemon/statusdctl pingExpected: status shows running daemon + healthy socket, and ping returns {"ok": true, "pong": true, ...}.
swift run PiStatusBarThe π icon should appear in the macOS menu bar.
pi install npm:pi-telemetryThen, in an active Pi session:
/pi-telemetry --dataIf telemetry is active, the app should show source: telemetry.
- This README avoids machine-specific absolute paths and credentials.
- Runtime data is stored locally under
~/.pi/agent. - Do not commit local logs, telemetry dumps, or screenshots that expose private paths/session names.
- Shows a live menu bar indicator of overall Pi agent state
- Lists active agents with:
- mux/session + telemetry session name + activity
- cwd path
- pid + window attachment status (including detected terminal app)
- model + token metrics (when telemetry is available)
- context pressure line with clear health/mood signal
- Supports Jump to the correct terminal window/session
- Falls back gracefully when telemetry is unavailable
- Red: all agents running/working
- Green: all agents waiting for input
- Yellow: mixed states
- White/neutral: no agents
- Unix socket:
~/.pi/agent/statusd.sock - Commands:
statuspingjump <pid>
- Status payload version:
2 - Source field values:
pi-telemetryprocess-fallback
- Polls daemon every 2 seconds
- Renders status chips:
- source (
telemetry | fallback | offline) - active/running/waiting counts
- context pressure (
close to limit/at limit)
- source (
- Shows attention banners for close-to-limit/at-limit context pressure
Each agent row is rendered as:
- Primary line: mux/session + telemetry session name (when available) + activity
- Workspace line: cwd path
- Attachment line:
PID <pid> · window attached|no attached window · <terminal app> - Model metrics line: model name/id + token usage (
used/contextWindow) when telemetry provides it - Context line: context percent + classification (
healthy,close to limit,at limit) with emoji indicator
When telemetry is unavailable, the row gracefully falls back to process-only metadata.
pi-statusd follows this data source strategy:
- Primary: per-process telemetry files at:
~/.pi/agent/telemetry/instances/*.json
- Optional fallback:
pi-telemetry-snapshot - Final fallback: process heuristics via
ps+lsof
Compatibility notes:
- Supports telemetry activity mapping (
working,waiting_input, fallback inference) - Reads context metrics (
tokens,contextWindow,remainingTokens,percent,pressure,closeToLimit,nearLimit) - Reads model/session metadata for richer UI rows (
model.*,session.name) - Adds window attachment/app metadata in daemon responses (
attached_window,terminal_app) - Applies stale/alive filtering when reading telemetry files
- Defensively handles malformed telemetry entries
Install telemetry:
pi install npm:pi-telemetryWhen jump <pid> is requested, the daemon uses this order:
- Focus attached mux client window
- Fallback focus via Pi ancestry
- Ghostty hint fallback (split pane support)
- TTY/title fallback for iTerm2/Terminal
- If no attached client exists, open terminal + attach/open shell
- Never Finder fallback
Terminal preference config:
- Config file:
~/.pi/agent/statusd.json - Env override:
PI_STATUS_TERMINAL - Values:
auto | Ghostty | iTerm2 | Terminal - Auto order:
Ghostty → iTerm2 → Terminal
daemon/statusdctl restartdaemon/statusdctl status
daemon/statusdctl pingswift run PiStatusBarswift builddaemon/statusdctl supports:
startstoprestartstatuspingterminalterminal <auto|Ghostty|iTerm2|Terminal>
- Keep daemon and app restarted after daemon/UI changes
- If UI shows fallback unexpectedly, verify active Pi sessions are emitting telemetry (
/pi-telemetry) - Socket is user-local (
0600permissions)
daemon/statusdctl restart
daemon/statusdctl statusIf status is unhealthy, inspect ~/.pi/agent/statusd.log.
- Confirm telemetry is installed:
pi install npm:pi-telemetry - In an active Pi session run:
/pi-telemetry --data - Ensure telemetry files exist under
~/.pi/agent/telemetry/instances
- This is expected in process-fallback mode (no telemetry session metadata)
- With telemetry enabled,
session.nameis shown in the row primary line
- Ensure Accessibility permissions are granted for terminal apps and automation
- If using Ghostty split panes, keep session hints in titles/session names
- Verify terminal preference via:
daemon/statusdctl terminal
daemon/statusdctl terminal GhosttyMIT — see LICENSE.