- Docs
- Production & Operations
- Terminal UI (top)
Monitor and triage queues without leaving your shell.
bunqueue top is a zero-dependency live terminal dashboard built into the CLI. Watch Braille throughput waves, inspect jobs, logs, workflows, and multi-node clusters, cluster dead letters by root cause, and control queues over TCP+TLS.
Try it live
Section titled “Try it live”This interactive terminal runs the exact TypeScript engine behind bunqueue top --demo. Use the presets or click inside to drive it with real hotkeys (1–8, j/k, Enter, Esc, [/], a, p, d, R, s, t, :, Space, ?).
| QUEUE | STATE | WAIT | Δ | PRIO | ACTIVE | DELAY | DLQ | LOAD | |
|---|---|---|---|---|---|---|---|---|---|
| No queues match filter. | |||||||||
How it works
Section titled “How it works”One persistent TCP+TLS socket streams metrics, DLQ clusters, and live controls
bunqueue top reuses standard broker commands over port 6789 so you can triage production queues straight from your terminal.Quick start
Section titled “Quick start”bunx bunqueue top --demo # 3-node cluster simulator (no server)bunx bunqueue top # local broker on localhost:6789bunx bunqueue top --view dlq --queue billing-webhooks # jump straight to DLQ triage
# Remote broker with auth, native TLS, 500ms refresh, and Tokyo themebunx bunqueue top -H queues.internal -p 6789 -t "$BQ_TOKEN" --tls -i 500 --theme tokyoCLI options
Section titled “CLI options”Honors all global connection flags (-H/--host, -p/--port, -t/--token, --tls, --tls-ca, --tls-no-verify, --json) plus:
| Flag | Short | Default | Description |
|---|---|---|---|
--interval <ms> | -i | 1000 | Refresh interval in ms (200–60000). Adjustable live with + / -. |
--view <name> | queues | Initial view: queues, workers, crons, dlq, webhooks, activity, workflows, or nodes. | |
--queue <name> | -q | highest DLQ | Pre-select a queue (also the initial target for --view dlq). |
--theme <name> | cyber | Color theme: cyber, tokyo, amber, or mono. Cycle live with t. | |
--limit <n> | 200 | Max recent DLQ entries analyzed per triage query (1–1000). | |
--nodes <list> | env fallback | Comma-separated cluster endpoints ([label@]host[:port],..., repeatable; env: BUNQUEUE_NODES, BQ_NODES). | |
--node <endpoint> | Add one cluster node endpoint (repeatable shorthand for --nodes). | ||
--workflow-db <path> | env fallback | Zero-DDL SQLite Workflow Engine dataPath for [7] Workflows (env: BUNQUEUE_WORKFLOW_DB). | |
--workflow-pg <url> | env fallback | Zero-DDL PostgreSQL 17-19 URL for [7] Workflows (env: BUNQUEUE_WORKFLOW_POSTGRES_URL; mutually exclusive with --workflow-db). | |
--workflow-ns <ns> | default | PostgreSQL workflow namespace for --workflow-pg (env: BUNQUEUE_WORKFLOW_POSTGRES_NAMESPACE). | |
--workflow-queue <q> | __wf:steps | Step queue name used when delivering workflow signals (s). | |
--demo | false | Run the built-in 3-node cluster simulator without a broker. | |
--once | false | Render one frame and exit (automatic when stdout is not a TTY). | |
--json | false | Emit one ANSI-free JSON snapshot (with dlqTriage / workflows when selected) and exit. |
Multi-node & Kubernetes clusters
Section titled “Multi-node & Kubernetes clusters”bunqueue top monitors clusters in two complementary modes:
- Zero-config PostgreSQL discovery (single VIP / Kubernetes Service): point at your normal Service or LoadBalancer (
bunx bunqueue top -H bunqueue.prod.svc -p 6789 -t "$BQ_TOKEN"). PostgreSQL brokers include livebunqueue_brokersmembership, active leases, worker counts, uptime, and stale-heartbeat detection inDashboardOverview, lighting up theCLUSTER online/totalheader badge and[8] Nodeswith no extra flags. - Direct parallel polling (
--nodes/--node/BUNQUEUE_NODES): poll each broker pod or VM directly for summed cluster throughput, worst-casep95/p99latency, combined heap/RSS, per-node RTT, node pinning, and automatic control failover:
# Direct multi-node polling with optional labelsbunx bunqueue top \ --nodes "az1@10.30.0.71:6789,az2@10.30.0.72:6789,az3@10.30.0.73:6789" \ --token "$BQ_TOKEN" --view nodes
# Or configure once via env varexport BUNQUEUE_NODES="pod-0.bunqueue-headless:6789,pod-1.bunqueue-headless:6789,pod-2.bunqueue-headless:6789"bunx bunqueue top --token "$BQ_TOKEN"- Shared PostgreSQL clusters: detects shared namespaces automatically—deduplicating global queue/worker/cron counts while summing per-broker throughput and memory and listing additional autoscaled PG peers as
PEERrows. - Independent brokers: aggregates queue counts, totals, throughput, and memory across online SQLite/memory nodes and routes queue/job/webhook commands to the owning node.
- Focus & failover: press
Enteron a direct node in[8] Nodes(or[/], or:node <label|index|all>) to scope metrics and actions to one broker; pressaorEscforALL NODES. Offline brokers are markedOFFLINE, logged in Activity, and control commands fail over to surviving peers.
Views and drill-down
Section titled “Views and drill-down”Switch views with 1–8, Tab / Shift+Tab, or ::
- Queues (
1):RUNNING/PAUSED,WAIT, tick delta (Δ),PRIO,ACTIVE,DELAY,DLQ, and heat-gradientLOADbar. Sort withs(dlq,waiting,active,delayed,name), invert withS, toggle live mix bar withv. - Workers (
2): active vs stale (30s heartbeat threshold), subscribed queues, active jobs, processed/failed totals, success rate, and last-seen age. - Crons (
3): cron expression or interval, target queue, next-run countdown, run count, and safe delete (X). - DLQ Triage (
4ord): fetches the queue’s DLQ tail, scrubs dynamic noise, and groups entries into ranked root-cause clusters with attempt chains and sample job IDs. - Webhooks (
5): ID, enabled state (etoggles), queue scope, credential-scrubbed URL, delivery counters, and delete (X). - Activity (
6): real-time diff log of operational events between polls (DLQ spikes, pauses/resumes, worker joins/drops, disk-full alerts, operator actions). - Workflows (
7or:wf): zero-DDL Workflow Engine inspector for SQLite (--workflow-db) or PostgreSQL 17-19 (--workflow-pg).Entershows the step timeline, signals, and scrubbed input;ssends a transactionalwaitForsignal (eventorevent={json}). - Nodes (
8or:nodes): cluster roster of direct nodes and PG peers with status (ONLINE,PEER,DEGRADED,STALE,OFFLINE),PUSH/S,P99,HEAP/RSS, active leases, uptime, and RTT / heartbeat age.Enterfocuses a direct node;areturns toALL NODES.
Drill-down: Enter on a queue opens Queue Inspect (rate/concurrency limits, stacked state bar, job previews across active/waiting/paused/delayed/DLQ). Enter on any job opens Job Inspect (metadata, redacted JSON payload, latest logs, plus m promote, x cancel, X discard). Esc or Backspace steps back.
DLQ clustering and secret scrubbing
Section titled “DLQ clustering and secret scrubbing”Before rendering or clustering, a deterministic scrubber runs on all broker-supplied strings:
- Terminal safety: strips CSI, OSC (
\x1b]...BEL/ST), DCS/APC/PM/SOS escape sequences, and control characters from labels, errors, prompts, and payloads. - Secret redaction: masks Bearer tokens, JWTs,
password/secret/token/api_key/authorization/cookiepairs, provider keys (sk_live_*,pk_live_*), email addresses, webhook URL credentials (user:pass@), and sensitive query params (?token=,?api_key=). - Root-cause normalization: replaces UUIDs, ISO timestamps, IPv4 addresses,
req_*/evt_*/job_*IDs, hex strings, and numbers with placeholders so noisy retries collapse into actionable clusters. - Canary retry: press
Rto retry one sample job first, thenAto retry all orPto purge.
Keybindings and command palette
Section titled “Keybindings and command palette”All destructive or bulk mutations (D, R, A, P, x, X, M) require explicit y/N confirmation before sending any command.
| Keys | Action |
|---|---|
1..8 / Tab / Shift+Tab | Switch between the 8 views |
↑ ↓ / j k / PgUp PgDn / g G | Navigate lists and jump top/bottom |
Enter / Esc | Drill down (Queue -> Job + Logs, Workflow -> Steps), focus node in Nodes / step back |
[ / ] or a (in Nodes) | Cycle focused cluster node / return to ALL NODES aggregate |
/ | Live filter on current view (Enter locks, Esc clears) |
: | Open k9s-style command palette (:nodes, :node <id|all>, :wf, :dlq, :theme, :pause, :compact) |
s / S | Cycle queue sort column / reverse sort (or send signal in [7] Workflows) |
p | Pause or resume selected queue |
d | Jump to DLQ Triage for selected queue |
l / c | Set or clear (0) rate limit (jobs/s) or concurrency limit |
n | Quick-push a JSON job (Enter on empty pushes {}) |
D | Drain all waiting jobs in selected queue (y/N) |
R / A / P | In DLQ: canary retry 1 sample / retry all / purge (y/N) |
x / m / X | In Job Inspect: cancel (y/N) / promote delayed / discard (y/N) |
e / X | In Webhooks/Crons: toggle enabled / remove (y/N) |
M | Compact broker memory (y/N) |
t / v / + - / Space / r | Cycle theme / toggle split bar / speed / freeze / refresh now |
? / q / Ctrl+C | Toggle help overlay / quit and restore terminal |
Command palette (:)
Section titled “Command palette (:)”- Views:
:queues(:queue),:workers(:w),:crons(:c),:dlq [queue](:triage [queue]),:webhooks(:wh),:activity(:act,:events,:log),:workflows(:wf),:nodes(:n,:cluster,:brokers) - Cluster focus:
:node <label|brokerId|index|all>(:focus <target>) - Operations:
:pause <queue>,:resume <queue>,:drain <queue>(y/N),:compact(:gc,y/N— compacts all online nodes inALL NODESmode) - Session:
:theme <cyber|tokyo|amber|mono>,:help,:q/:quit/:exit
Scripting, CI, and color policy
Section titled “Scripting, CI, and color policy”bunx bunqueue top --once -H 127.0.0.1 -p 6789 # plain snapshot (ANSI auto-off on pipes)FORCE_COLOR=1 bunx bunqueue top --once --theme cyber # force ANSI into a file or pagerbunx bunqueue top --json --view dlq -q billing-webhooks | jq '.dlqTriage.clusters'- Exit codes:
0clean exit (q, signal,--help,--once,--json);1connection, auth, or broker error;2invalid CLI flag/value (validated before connecting). - Color & viewport: respects
FORCE_COLOR,NO_COLOR, andTERM=dumb;--jsonis strictly ANSI-free. Terminals smaller than60x14render a fitted resize notice without wrapping.
Next steps
Section titled “Next steps”- Launch deep dive: Introducing
bunqueue top. - Full CLI & transport security: CLI Reference and TLS Encryption.