Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/runbox-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ dirs = "5"
dialoguer = "0.11"
chrono = { version = "0.4", features = ["serde"] }
log = "0.4"
# TUI dependencies - use older versions for Rust 1.87 compatibility
ratatui = "0.26"
crossterm = "0.27"
tokio = { version = "1", features = ["full"] }

[features]
# Enable tests that require tmux to be installed
Expand Down
35 changes: 35 additions & 0 deletions crates/runbox-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mod tui;
use anyhow::{bail, Context, Result};
use chrono::Utc;
use clap::{Parser, Subcommand, ValueEnum};
Expand Down Expand Up @@ -219,6 +220,35 @@ RELATED COMMANDS:
#[arg(short, long, default_value = "20")]
limit: usize,
},
/// Interactive TUI process monitor
#[command(after_help = "\
EXAMPLES:
# Launch interactive monitor
runbox monitor

FEATURES:
- Real-time process list with auto-refresh
- Keyboard navigation (j/k, arrows)
- View logs for any process
- Stop processes directly
- Attach to tmux/zellij sessions

KEYBINDINGS:
j/↓ Move selection down
k/↑ Move selection up
Enter/l View logs for selected process
s Stop selected process (SIGTERM)
S Force stop (SIGKILL)
a Attach to tmux/zellij session
r Refresh process list
? Show help
q/Esc Quit

RELATED COMMANDS:
runbox ps Static process list
runbox logs View logs directly
runbox stop Stop a process")]
Monitor,
/// List all runnables (templates, replays, playlist items) in unified table
#[command(after_help = "\
EXAMPLES:
Expand Down Expand Up @@ -994,6 +1024,7 @@ fn main() -> Result<()> {
&storage, command, runtime, dry_run, timeout, env_vars, cwd, no_git,
),
Commands::Ps { status, all, limit } => cmd_ps(&storage, status, all, limit),
Commands::Monitor => cmd_monitor(&storage),
Commands::List {
r#type,
playlist,
Expand Down Expand Up @@ -1592,6 +1623,10 @@ fn cmd_run_replay(
Ok(())
}

// === Monitor Command (TUI) ===
fn cmd_monitor(storage: &Storage) -> Result<()> {
tui::run(storage)
}
// === Ps Command ===
fn cmd_ps(
storage: &Storage,
Expand Down
Loading