Skip to content

Interactive monitoring (Terminal UI)

The Daemonitor Terminal UI (TUI) is a standalone native Go application built with Bubble Tea v2. It renders in the terminal alternate screen and requires no JDK or desktop runtime.

Daemonitor Terminal UI showing live processes, memory metrics, and footer controls

Interactive walkthrough

Starting the TUI

Run daemonitor-cli with no subcommand in an interactive terminal (TTY with TERM != "dumb"):

daemonitor-cli

Or invoke it explicitly with top:

daemonitor-cli top --poll-interval 1s

By default, daemonitor-cli connects to daemonitor-cored over the local IPC socket and starts daemonitor-cored automatically if it is not running (pass --no-autostart to disable).

If stdout is not a TTY or TERM=dumb:

  • daemonitor-cli (no subcommand) falls back to a one-shot ps snapshot.
  • daemonitor-cli top prints an error and exits with status 1.
  • Passing --json with top exits with status 2.

Minimum terminal size and layout

The TUI requires at least 40 columns × 8 rows (smaller windows display "Terminal too small. Please enlarge the window.").

The main view includes:

  1. Title bar: DAEMONITOR and Updated HH:MM:SS.
  2. Summary strip: Active process count, total RSS, connection or pause state, Grouped by parent indicator (when active), active sort column/direction (Sort RSS desc), and refresh interval (Refresh 2s).
  3. Process table: Live rows with inline signals (CRIT MEM >= 8192 MB, HIGH MEM >= 4096 MB, AUTOMATED) appended to the right of PROJECT.
  4. Footer: Responsive key hint bar (5 width tiers), inline help (?), or kill confirmation prompt.

Build system sections and adaptive column layouts

The TUI partitions live processes into collapsible sections by build system (GRADLE, BAZEL, XCODE, KOTLIN TOOLCHAIN, OTHER / UNKNOWN), omitting empty sections. Each section header displays ▼/▶, process count, and double-count-free RSS/CPU totals. Press z to collapse/expand the selected section or Z to toggle all sections.

Each section selects its own column family based on its runtime composition and drops lower-priority columns as terminal width narrows:

Section runtime composition Full-width columns Narrowest fallback
JVM-only (Gradle, Kotlin Toolchain, JVM-only Bazel) TYPE GC PID RSS THR HEAP% META HEAP CMT XMX YGCT(s) FGCT(s) CGCT(s) GCT(s) CPU UPTIME PROJECT (17 cols) TYPE GC PID RSS CPU PROJECT (6 cols)
Native-only (Xcode, native-only Bazel) TYPE PID RSS FOOTPR THR DISK_R DISK_W CPU UPTIME PROJECT (10 cols) TYPE PID RSS CPU PROJECT (5 cols)
Mixed / Unknown (e.g., Bazel with JVM + Swift/native workers) TYPE RUNTIME PID RSS THR CPU UPTIME PROJECT (8 cols) TYPE RUNTIME PID RSS (4 cols)

TYPE labels adapt to toolchain metadata (Kotlin worker, Java worker, Swift worker, Swift compiler, Clang compiler). Remaining horizontal width beyond fixed columns is allocated to PROJECT (minimum 8 columns).

Refresh and sorting

  • Default poll interval is 2s (--poll-interval overrides). Polling pauses automatically when you press space or open Process details.
  • Press r to force an immediate refresh.
  • Press s to cycle the sort column (RSS → CPU → PID → TYPE → UPTIME → PROJECT, plus HEAP → CMT → XMX when JVM processes are present).
  • Press S to reverse sort direction (desc ↔ asc).
  • Disable ANSI colors with --no-color or by setting the NO_COLOR environment variable.