Skip to content

Add live terminal dashboard for PDS monitoring#135

Merged
ascorbic merged 5 commits intofeat/pds-dashboardfrom
claude/cli-dashboard-terminal-vBWp7
Mar 15, 2026
Merged

Add live terminal dashboard for PDS monitoring#135
ascorbic merged 5 commits intofeat/pds-dashboardfrom
claude/cli-dashboard-terminal-vBWp7

Conversation

@ascorbic
Copy link
Copy Markdown
Owner

Summary

This PR adds a comprehensive live terminal dashboard for monitoring PDS (Personal Data Server) instances, complementing the existing web-based dashboard. The new CLI dashboard provides real-time visibility into repository state, federation sync status, firehose activity, and account notifications.

Key Changes

  • New CLI Dashboard Command (packages/pds/src/cli/commands/dashboard.ts):

    • Live terminal UI with three-column layout showing Repository, Federation, and Firehose panels
    • Real-time event stream from firehose with WebSocket connection
    • Notifications panel displaying account activity (likes, reposts, follows, etc.)
    • Account status indicator and interactive commands (activate, crawl, emit identity)
    • ANSI color-coded output with responsive terminal sizing
    • Automatic reconnection logic for WebSocket failures
    • Firehose frame parsing using CBOR decoder
  • Enhanced PDSClient (packages/pds/src/cli/utils/pds-client.ts):

    • Added getSubscribers() method to fetch firehose subscriber details and latest sequence number
    • Added listNotifications() method to retrieve account notifications from AppView
    • Added listRepos() method to get PDS revision information
    • Added getFirehoseStatus() method to fetch firehose status
    • Added getAccountStatus() method to check account activation state
  • Web Dashboard Formatting (packages/pds/src/dashboard.html):

    • Reformatted HTML/CSS/JavaScript for improved readability and consistency
    • Changed DOCTYPE to lowercase <!doctype html>
    • Improved indentation and spacing throughout
    • No functional changes to the web dashboard
  • CLI Integration (packages/pds/src/cli/index.ts):

    • Registered new dashboard command in CLI command registry

Implementation Details

  • The terminal dashboard uses ANSI escape sequences for cursor control, colors, and screen management
  • Supports both WebSocket (Node 22+) and polling-based data fetching for compatibility
  • Implements responsive layout that adapts to terminal dimensions
  • Includes collection name mapping and sorting by priority for better UX
  • Handles graceful degradation when certain endpoints are unavailable (e.g., notifications on accounts not yet on AppView)
  • Status messages provide user feedback for long-running operations

https://claude.ai/code/session_01XjTynB9skS7w4f14XUzTrC

claude added 5 commits March 15, 2026 12:24
Adds `pds dashboard` command that shows a real-time terminal UI with:
- Repository panel (collection counts)
- Federation panel (relay sync status)
- Firehose panel (subscribers, sequence number)
- Notifications panel (likes, reposts, follows via AppView proxy)
- Events panel (live firehose events via WebSocket)
- Keybindings: [a] activate, [r] request crawl, [e] emit identity, [q] quit

Uses ANSI escape codes + picocolors for rendering (no new dependencies).
Firehose frames decoded with existing @atproto/lex-cbor decodeAll.

https://claude.ai/code/session_01XjTynB9skS7w4f14XUzTrC
The separator line didn't account for the WebSocket status text width,
causing it to overflow and merge with the status indicator.

https://claude.ai/code/session_01XjTynB9skS7w4f14XUzTrC
…r padding

- Fetch latestSeq from authenticated getFirehoseStatus endpoint as primary
  source, falling back to getSubscribers
- Sort collections by priority (posts, likes, follows first) and filter
  out empty collections
- Add missing collection names (chat, postgates, labeler)
- Add right padding to events separator so "connected" isn't flush with edge

https://claude.ai/code/session_01XjTynB9skS7w4f14XUzTrC
Parse #identity frames from the firehose in addition to #commit frames.
Identity events display with cyan "IDENTITY" action and the handle.

https://claude.ai/code/session_01XjTynB9skS7w4f14XUzTrC
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
atproto-pds 1870165 Mar 15 2026, 06:41 PM

@ascorbic ascorbic merged commit 0ea70b7 into feat/pds-dashboard Mar 15, 2026
4 checks passed
@ascorbic ascorbic deleted the claude/cli-dashboard-terminal-vBWp7 branch March 15, 2026 18:45
ascorbic added a commit that referenced this pull request Mar 15, 2026
* feat(pds): add live status dashboard at /status

Dark-themed dashboard for conference demos. Shows server identity,
repository record counts, relay federation sync status, firehose
subscriber details, and a live event stream with inline CBOR decoding.

- GET /status serves the dashboard HTML
- GET /xrpc/gg.mk.experimental.getSubscribers exposes sanitized
  firehose subscriber metadata (connectedAt, cursor)
- Relay sync polling (bsky.network) with animated status transitions
- WebSocket firehose connection with minimal inline CBOR decoder

* Add live terminal dashboard for PDS monitoring (#135)

* feat(pds): add CLI dashboard command for live PDS monitoring

Adds `pds dashboard` command that shows a real-time terminal UI with:
- Repository panel (collection counts)
- Federation panel (relay sync status)
- Firehose panel (subscribers, sequence number)
- Notifications panel (likes, reposts, follows via AppView proxy)
- Events panel (live firehose events via WebSocket)
- Keybindings: [a] activate, [r] request crawl, [e] emit identity, [q] quit

Uses ANSI escape codes + picocolors for rendering (no new dependencies).
Firehose frames decoded with existing @atproto/lex-cbor decodeAll.

https://claude.ai/code/session_01XjTynB9skS7w4f14XUzTrC

* style: apply prettier formatting

https://claude.ai/code/session_01XjTynB9skS7w4f14XUzTrC

* fix(pds): fix events panel separator overflow in CLI dashboard

The separator line didn't account for the WebSocket status text width,
causing it to overflow and merge with the status indicator.

https://claude.ai/code/session_01XjTynB9skS7w4f14XUzTrC

* fix(pds): fix dashboard seq display, collection sorting, and separator padding

- Fetch latestSeq from authenticated getFirehoseStatus endpoint as primary
  source, falling back to getSubscribers
- Sort collections by priority (posts, likes, follows first) and filter
  out empty collections
- Add missing collection names (chat, postgates, labeler)
- Add right padding to events separator so "connected" isn't flush with edge

https://claude.ai/code/session_01XjTynB9skS7w4f14XUzTrC

* feat(pds): show identity events in dashboard firehose log

Parse #identity frames from the firehose in addition to #commit frames.
Identity events display with cyan "IDENTITY" action and the handle.

https://claude.ai/code/session_01XjTynB9skS7w4f14XUzTrC

---------

Co-authored-by: Claude <noreply@anthropic.com>

* Remove firehose status from web dash

* Changeset

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants