Show wicked-bus health, statistics, and diagnostics. Event counts, subscriber lag, provider list, database size, and configuration. Use when: "bus status", "is the bus healthy", "how many events", "show bus stats", or when diagnosing delivery issues.
Show the current state of the wicked-bus.
npx wicked-bus status 2>/dev/null
If this fails, the bus isn't initialized. Suggest running wicked-bus/init.
The status command returns JSON. Display it in a readable format:
## wicked-bus Status
**Database**: {db_path}
**Events**: {total_events} total, {active_events} active (not expired)
**Providers**: {provider_count} registered
**Subscribers**: {subscriber_count} active
### Subscriber Lag
| Plugin | Filter | Cursor | Latest | Lag |
|--------|--------|--------|--------|-----|
| {plugin} | {filter} | {last_event_id} | {max_event_id} | {lag} |
If the user wants deeper diagnostics, query SQLite directly:
Event distribution by type:
sqlite3 ~/.something-wicked/wicked-bus/bus.db \
"SELECT event_type, COUNT(*) as count FROM events GROUP BY event_type ORDER BY count DESC LIMIT 20;"
Event distribution by domain:
sqlite3 ~/.something-wicked/wicked-bus/bus.db \
"SELECT domain, COUNT(*) as count FROM events GROUP BY domain ORDER BY count DESC;"
Database size:
ls -lh ~/.something-wicked/wicked-bus/bus.db
WAL size (if checkpointing is lagging):
ls -lh ~/.something-wicked/wicked-bus/bus.db-wal 2>/dev/null
Events per hour (last 24h):
sqlite3 ~/.something-wicked/wicked-bus/bus.db \
"SELECT strftime('%Y-%m-%d %H:00', emitted_at/1000, 'unixepoch') as hour, COUNT(*) as count FROM events WHERE emitted_at > (strftime('%s','now')-86400)*1000 GROUP BY hour ORDER BY hour;"
Oldest and newest events:
sqlite3 ~/.something-wicked/wicked-bus/bus.db \
"SELECT 'oldest' as which, event_id, event_type, datetime(emitted_at/1000, 'unixepoch') as time FROM events ORDER BY event_id ASC LIMIT 1 UNION ALL SELECT 'newest', event_id, event_type, datetime(emitted_at/1000, 'unixepoch') FROM events ORDER BY event_id DESC LIMIT 1;"
Deregistered subscriptions:
npx wicked-bus list --include-deregistered --json
Configuration:
cat ~/.something-wicked/wicked-bus/config.json
If WICKED_BUS_DATA_DIR is set, use that path instead of the default.
Flag these issues if detected: