TUI — Terminal UI Dashboard
Runix includes an interactive terminal dashboard built with BubbleTea.
Implementation
Located at internal/tui/:
| File | Responsibility |
|---|---|
app.go | Main BubbleTea model — window management, key handling |
components/process_table.go | Process list table view |
components/log_view.go | Log viewer for selected process |
components/status_bar.go | Bottom status bar |
components/help_view.go | Help overlay with keybindings |
components/styles.go | Lipgloss styling constants |
Launch
runix tui
The TUI uses alternate screen buffer and mouse cell motion for full terminal integration.
Interface Layout
┌──────────────────────────────────────────────────────┐
│ Runix Process Manager v0.1.0 │
├──────┬──────────┬───────────┬─────────┬──────────────┤
│ ID │ NAME │ STATUS │ PID │ UPTIME │
│ 1 │ api │ ● running │ 48291 │ 5m 30s │
│ 2 │ worker │ ● running │ 48292 │ 3m 12s │
│ 3 │ cron │ ○ stopped │ - │ - │
├──────┴──────────┴───────────┴─────────┴──────────────┤
│ Logs: api │
│ 2025-01-15 10:30:00 [out] Server listening on :8080 │
│ 2025-01-15 10:30:01 [out] Connected to database │
│ 2025-01-15 10:30:05 [err] Connection timeout │
│ │
├──────────────────────────────────────────────────────┤
│ q:quit ↑↓:nav r:restart s:stop l:logs ?:help │
└──────────────────────────────────────────────────────┘
Keybindings
| Key | Action |
|---|---|
↑ / k | Move selection up |
↓ / j | Move selection down |
r | Restart selected process |
s | Stop selected process |
l | Toggle log view for selected process |
? | Show help overlay |
q | Quit the TUI |
Data Sources
The TUI uses the ProcessLister interface:
type ProcessLister interface {
ListProcesses() ([]types.ProcessInfo, error)
GetProcess(idOrName string) (types.ProcessInfo, error)
}
Two implementations:
| Implementation | When Used |
|---|---|
daemonLister | When the daemon is running — fetches via IPC |
DirectLister | When no daemon — reads from a local supervisor instance |
Components
Process Table
Displays a scrollable list of all managed processes with their state, PID, and uptime. The selected process is highlighted.
Log View
When a process is selected and l is pressed, the lower pane shows recent log output for that process.
Status Bar
Shows available keybindings at the bottom of the screen.
Help View
Pressing ? overlays a help panel listing all keybindings.
What's Next
- TUI Command — CLI usage