Skip to content

Commit f656681

Browse files
authored
enhance(cli): Add conversation subcommand aliases (#454)
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 <git@jeanmertz.com>
1 parent 27c4174 commit f656681

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

crates/jp_cli/src/cmd/conversation.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,35 @@ impl Conversation {
3434
#[derive(Debug, clap::Subcommand)]
3535
enum Commands {
3636
/// Remove conversations.
37-
#[command(name = "rm")]
37+
#[command(name = "rm", aliases = ["remove", "rem", "delete", "del"])]
3838
Remove(rm::Rm),
3939

4040
/// List conversations.
41-
#[command(name = "ls")]
41+
#[command(name = "ls", alias = "list", visible_alias = "l")]
4242
List(ls::Ls),
4343

4444
/// Show conversation details.
45-
#[command(name = "show")]
45+
#[command(name = "show", visible_alias = "s")]
4646
Show(show::Show),
4747

4848
/// Set the active conversation.
49-
#[command(name = "use")]
49+
#[command(name = "use", visible_alias = "u")]
5050
Use(use_::Use),
5151

5252
/// Edit conversation details.
53-
#[command(name = "edit")]
53+
#[command(name = "edit", visible_alias = "e")]
5454
Edit(edit::Edit),
5555

5656
/// Fork a conversation.
57+
#[command(name = "fork", visible_alias = "f")]
5758
Fork(fork::Fork),
5859

5960
/// Search through conversation history.
61+
#[command(name = "grep", alias = "rg", visible_alias = "g")]
6062
Grep(grep::Grep),
6163

6264
/// Print conversation history to the terminal.
65+
#[command(name = "print", visible_alias = "p")]
6366
Print(print::Print),
6467
// /// Merge a conversation.
6568
// Merge(merge::Merge),

crates/jp_cli/src/cmd/query/tool/coordinator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ impl ToolCoordinator {
10211021
"Tool question received, routing to target",
10221022
);
10231023

1024-
if is_tty && target == QuestionTarget::User {
1024+
if is_tty && target.is_user() {
10251025
if *prompt_active {
10261026
pending_prompts.push_back(PendingPrompt::Question { index, question });
10271027
} else {

0 commit comments

Comments
 (0)