From 0c8e5f8246355ac20ba33ff8bdb8e7ea2dfd8dcb Mon Sep 17 00:00:00 2001 From: Jean Mertz Date: Wed, 18 Mar 2026 21:49:04 +0100 Subject: [PATCH] enhance(cli): Add conversation subcommand aliases Each subcommand in the `conversation` command now has one or more short aliases. Visible aliases (shown in `--help`) are single- letter shortcuts: `l` for `ls`, `s` for `show`, `u` for `use`, `e` for `edit`, `f` for `fork`, `g` for `grep`, and `p` for `print`. Hidden extras include `list` for `ls`, `rg` for `grep`, and `remove`, `rem`, `delete`, `del` for `rm`. Also replaces a direct equality check against `QuestionTarget::User` with the idiomatic `target.is_user()` helper in the tool coordinator. Signed-off-by: Jean Mertz --- crates/jp_cli/src/cmd/conversation.rs | 13 ++++++++----- crates/jp_cli/src/cmd/query/tool/coordinator.rs | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/crates/jp_cli/src/cmd/conversation.rs b/crates/jp_cli/src/cmd/conversation.rs index 33482bdb..ca220309 100644 --- a/crates/jp_cli/src/cmd/conversation.rs +++ b/crates/jp_cli/src/cmd/conversation.rs @@ -34,32 +34,35 @@ impl Conversation { #[derive(Debug, clap::Subcommand)] enum Commands { /// Remove conversations. - #[command(name = "rm")] + #[command(name = "rm", aliases = ["remove", "rem", "delete", "del"])] Remove(rm::Rm), /// List conversations. - #[command(name = "ls")] + #[command(name = "ls", alias = "list", visible_alias = "l")] List(ls::Ls), /// Show conversation details. - #[command(name = "show")] + #[command(name = "show", visible_alias = "s")] Show(show::Show), /// Set the active conversation. - #[command(name = "use")] + #[command(name = "use", visible_alias = "u")] Use(use_::Use), /// Edit conversation details. - #[command(name = "edit")] + #[command(name = "edit", visible_alias = "e")] Edit(edit::Edit), /// Fork a conversation. + #[command(name = "fork", visible_alias = "f")] Fork(fork::Fork), /// Search through conversation history. + #[command(name = "grep", alias = "rg", visible_alias = "g")] Grep(grep::Grep), /// Print conversation history to the terminal. + #[command(name = "print", visible_alias = "p")] Print(print::Print), // /// Merge a conversation. // Merge(merge::Merge), diff --git a/crates/jp_cli/src/cmd/query/tool/coordinator.rs b/crates/jp_cli/src/cmd/query/tool/coordinator.rs index a792ce5e..63f4d12c 100644 --- a/crates/jp_cli/src/cmd/query/tool/coordinator.rs +++ b/crates/jp_cli/src/cmd/query/tool/coordinator.rs @@ -1021,7 +1021,7 @@ impl ToolCoordinator { "Tool question received, routing to target", ); - if is_tty && target == QuestionTarget::User { + if is_tty && target.is_user() { if *prompt_active { pending_prompts.push_back(PendingPrompt::Question { index, question }); } else {