Single-host, read-only system diagnostics TUI. Twelve tabs covering CPU, memory, disks, processes, GPU, power, services, network, plus a Timeline scrubber and an Insights anomaly engine. Sibling to netwatch.
useanyhow::Result;useclap::Parser;modapp;modcollect;modconfig;modinsights;modtabs;modui;useconfig::SyswatchConfig;#[derive(Parser, Debug)]#[command(
name ="syswatch",
version,
about ="Single-host system diagnostics TUI")]structCli{/// Fast-loop tick in milliseconds. Overrides the saved config when supplied.
#[arg(long)]tick:Option<u64>,
/// Start on a specific tab (overview, cpu, memory, disks, fs, procs, gpu, power, services, net, timeline, insights).
/// Overrides the saved config.default_tab when supplied.
#[arg(long)]tab:Option<String>,
}fnmain()->Result<()>{let cli =Cli::parse();letmut cfg =SyswatchConfig::load();// CLI --tick overrides config for this run only — it's mutated on the
// in-memory copy so the running app reads it consistently. Saved
// config on disk stays untouched until the user presses S in settings.
ifletSome(t)= cli.tick {
cfg.tick_ms = t;
cfg.validate();}// Apply theme before any rendering so the first frame uses it.
ui::theme::set_by_name(&cfg.theme);// CLI --tab wins; otherwise fall back to the persisted default.
let start_tab = cli.tab.or_else(||Some(cfg.default_tab.clone()));app::run(app::Options {
start_tab,
config: cfg,})}