This repository has been archived on 2026-10-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
maestro/crates/maestro-tui/src/cli.rs
T
naps62-yolo c99f23c705
ci / rust (push) Successful in 15m43s
feat(maestro): scaffold maestro-tui crate + maestro tui subcommand (NAP-276)
New `crates/maestro-tui/` library behind a `tui` cargo feature on the umbrella
binary (default-on). Ships a clap-derive `TuiArgs` and a `run()` stub that
returns `NotImplemented` — exercises the full dispatch path so phases 2+ can
fill in the catalog, session liveness, widgets, and event loop without
touching scaffolding.

Acceptance:
- `cargo build -p maestro --features tui` succeeds
- `maestro tui` prints "maestro: not implemented" and exits 1
- `cargo test -p maestro-tui` passes (2 clap-parse tests)
- `cargo fmt --check` + `cargo clippy --all-targets --features tui -- -D warnings` clean

Phase 1 of the Maestro TUI epic (NAP-275); plan in
`docs/superpowers/plans/2026-05-28-maestro-tui.md`.
2026-05-28 19:24:34 +00:00

41 lines
1.0 KiB
Rust

//! Clap-derive subcommand definition for `maestro tui`.
#[derive(Debug, clap::Args)]
pub struct TuiArgs {
/// Override the local daemon's HTTP base URL (default `http://127.0.0.1:7070`).
#[arg(long, env = "MAESTRO_DAEMON_URL")]
pub daemon_url: Option<String>,
}
#[cfg(test)]
mod tests {
use super::*;
use clap::Parser;
#[derive(Debug, Parser)]
struct Harness {
#[command(subcommand)]
cmd: Cmd,
}
#[derive(Debug, clap::Subcommand)]
enum Cmd {
Tui(TuiArgs),
}
#[test]
fn parses_with_daemon_url() {
let h = Harness::try_parse_from(["maestro", "tui", "--daemon-url", "http://10.0.0.1:7070"])
.unwrap();
let Cmd::Tui(args) = h.cmd;
assert_eq!(args.daemon_url.as_deref(), Some("http://10.0.0.1:7070"));
}
#[test]
fn parses_without_daemon_url() {
let h = Harness::try_parse_from(["maestro", "tui"]).unwrap();
let Cmd::Tui(args) = h.cmd;
assert!(args.daemon_url.is_none());
}
}