Viewing docs for v0.4.0 · view latest docs

TUI Guide

The bewitch TUI is built with bubbletea and provides 8 views for real-time system monitoring with historical charts.

launch
bewitch

# or connect to a remote daemon
bewitch -addr myserver:9119 -token my-secret

Views

Views are accessed via number keys. Tab numbering is fixed regardless of hardware availability.

KeyViewDescription
1DashboardMulti-column overview of all subsystems
2CPUPer-core usage with historical chart
3MemoryRAM and swap breakdown with history
4DiskPer-mount space, I/O rates, SMART health
5NetworkPer-interface throughput with bits/bytes toggle
6HardwareTemperature, power (RAPL), ECC memory, and GPU sub-sections
7ProcessAll processes, sortable, searchable, pinnable
8AlertsAlert rules and fired alerts

Navigation

KeyAction
Tab / Shift+TabCycle views forward / backward
/ or h / lCycle views forward / backward
< / >Cycle history time range (1h, 6h, 24h, 7d, 30d)
qQuit

Hardware View

The Hardware view combines temperature sensors, power consumption (RAPL), ECC memory errors, and GPU metrics into sub-sections. Use Tab / Shift+Tab to cycle between sub-sections. Sections without data are dimmed but still accessible. The active sub-section is persisted across sessions.

KeyAction
Tab / Shift+TabCycle sub-sections (Temperature, Power, ECC, GPU)
j / kNavigate sensor/zone list
SpaceToggle sensor/zone in chart
aSelect / deselect all

Process View

Shows all processes on the system. Non-enriched processes display -- for cmdline and FD count. The history chart shows top N processes by CPU over time.

KeyAction
j / kNavigate process list
cSort by CPU
mSort by memory
pSort by PID
nSort by name
tSort by threads
fSort by FDs
*Pin/unpin selected process
aCreate alert for selected process
/Search by name or cmdline
EscClear search filter
PToggle pinned-only filter
TabToggle history chart: Top CPU / Pinned

Alerts View

Two panels: a rules list on the left and fired alerts on the right. Create, toggle, and delete rules directly from the TUI.

KeyAction
j / kNavigate rules or alerts
TabSwitch focus between rules and alerts
nCreate new alert rule
dDelete selected rule
SpaceToggle rule enabled/disabled
EnterAcknowledge selected alert
tTest all notification channels
EscCancel alert creation form

Historical Charts

CPU, memory, disk, hardware (temperature/power/GPU), and process views include a historical braille chart below the live data. Use < / > to cycle through time ranges: 1h, 6h, 24h, 7d, 30d.

Charts use DuckDB's time_bucket aggregation. Bucket size auto-scales based on the selected range (1 minute for 1h up to 6 hours for 30d). History data is fetched asynchronously and cached per-view for instant display on tab switch.

Staleness Detection

The status bar monitors when fresh data last arrived for the current view. If no new data appears within 3x the longest collector interval for that view, a stale indicator shows: stale (Xs ago).

Debug Mode

bewitch -debug

Adds a scrollable debug console at the bottom of the TUI showing timestamped diagnostic messages: data fetches, cache hits/misses, view transitions, errors, and pin operations.

KeyAction
{ / }Scroll debug console up / down
( / )Shrink / grow debug panel

Styling

The TUI uses a pink and purple color palette with bordered panels (lipgloss.RoundedBorder). The dashboard adapts to a multi-column grid layout on terminals wider than 120 columns.