From 5dfb5b4ce521a44eb4e9173d20c58e665c78e979 Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 2 Nov 2026 13:35:56 +0100 Subject: ctl: interactive shell with history, editing and completion `rsp ctl` opens a prompt in the spirit of bluetoothctl. Lines are parsed with the same clap definitions as the one-shot CLI, so every command and flag works exactly as it does from a terminal, `help ` included. Tab completes subcommands, and track/album/artist paths for `play` through `db-complete` (run out of process, keeping its 100 ms timeout away from the input loop). History lives in the state directory. Piped input falls back to a plain line loop, so `rsp ctl < commands` works without a terminal. --- src/cli.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/cli.rs') diff --git a/src/cli.rs b/src/cli.rs index 79c31a8..8b39519 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -104,6 +104,8 @@ pub enum Commands { }, /// display lyrics Lyrics, + /// Interactive control shell (like bluetoothctl) + Ctl, } #[derive(Subcommand)] @@ -350,6 +352,9 @@ impl Cli { Commands::Lyrics => { let _ = crate::daemon::send_command("lyrics".to_string()); } + Commands::Ctl => { + crate::ctl::run()?; + } } Ok(()) } -- cgit v1.2.3