Skip to content

feat: add interactive TUI process monitor (runbox monitor)#58

Open
proboscis wants to merge 1 commit intomainfrom
issue/ISSUE-035/run-20260120-154855
Open

feat: add interactive TUI process monitor (runbox monitor)#58
proboscis wants to merge 1 commit intomainfrom
issue/ISSUE-035/run-20260120-154855

Conversation

@proboscis
Copy link
Owner

Summary

Implements ISSUE-035: Ratatui TUI for enhanced CLI experience.

This PR adds an interactive terminal user interface for runbox using ratatui, providing:

  • Process Monitor (runbox monitor): Real-time process list with auto-refresh
  • Log Viewer: Scrollable log view with follow mode
  • Keyboard Navigation: vim-style navigation (j/k, g/G, etc.)
  • Process Control: Stop processes directly from the TUI

Changes

New Files

  • crates/runbox-cli/src/tui/mod.rs - TUI module entry point
  • crates/runbox-cli/src/tui/app.rs - Application state and event loop
  • crates/runbox-cli/src/tui/event.rs - Event handling (keyboard, tick)
  • crates/runbox-cli/src/tui/ui.rs - UI rendering functions
  • crates/runbox-cli/src/tui/views/ - View components (process list, log viewer)

Modified Files

  • crates/runbox-cli/Cargo.toml - Added ratatui, crossterm, tokio dependencies
  • crates/runbox-cli/src/main.rs - Added monitor command

Features

Process Monitor

  • Real-time process list with 1-second auto-refresh
  • Color-coded status indicators (running=green, exited=blue, failed=red)
  • Keyboard navigation: j/k (down/up), g/G (top/bottom), PageUp/PageDown
  • Actions: Enter/l (view logs), s (stop), S (force stop), r (refresh)

Log Viewer

  • Scrollable log view with scrollbar
  • Follow mode (auto-scroll to bottom)
  • Keyboard shortcuts: j/k (scroll), g/G (top/bottom), f (toggle follow)

Help System

  • ? key shows help overlay with all keybindings

Acceptance Criteria Checklist

  • runbox monitor launches TUI with process list
  • Auto-refresh shows real-time status updates
  • Keyboard navigation works (j/k, arrows, Enter)
  • Can stop a process from TUI
  • Can view logs for selected process
  • Log viewer supports scrollback
  • q exits cleanly, restores terminal state
  • Works on macOS and Linux terminals

Future Enhancements (not in this PR)

  • Log search functionality
  • Runnable browser (runbox list --tui)
  • Dashboard (split-pane view)
  • Mouse support
  • Configurable keybindings

Closes ISSUE-035

Implements ISSUE-035 Phase 1-2:
- Add 'runbox monitor' command for interactive process monitoring
- Real-time auto-refresh (1 second interval)
- Keyboard navigation (j/k, arrows, page up/down)
- View logs for any process with Enter/l
- Stop processes with s (graceful) or S (force)
- Help overlay with ? key
- Color-coded status indicators
- Scrollable log viewer with follow mode

Uses ratatui 0.26 and crossterm 0.27 for terminal UI.
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.

1 participant