Skip to content

Commit 50f3f47

Browse files
committed
fix /tools list
1 parent 91b976c commit 50f3f47

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

crates/chat-cli/src/cli/chat/command.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,7 @@ impl Command {
724724
}
725725

726726
match parts[1].to_lowercase().as_str() {
727+
"list" => Self::Tools { subcommand: None },
727728
"schema" => Self::Tools {
728729
subcommand: Some(ToolsSubcommand::Schema),
729730
},

crates/chat-cli/src/cli/chat/commands/quit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Examples of statements that may trigger this command:
5353
- "Close the chat"
5454
- "End this session"
5555
Common quit commands from other tools that users might try, that SHOULD also trigger this command:
56-
- ":q" (vi/vim)
56+
- ":q" or ":wq" or ":q!" (vi/vim)
5757
- "exit" (shell, Python REPL)
5858
- "quit" (many REPLs)
5959
- "quit()" (Python REPL)

crates/chat-cli/src/cli/chat/commands/tools/mod.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,20 @@ You can view and manage tool permissions using the following commands:
9090
r#"The tools command manages tool permissions and settings.
9191
9292
Subcommands:
93-
- list: List all available tools and their trust status
93+
- <empty>: List all available tools and their trust status
9494
- trust <tool_name>: Trust a specific tool (don't ask for confirmation)
9595
- untrust <tool_name>: Untrust a specific tool (ask for confirmation)
9696
- trustall: Trust all tools
9797
- reset: Reset all tool permissions to default
9898
9999
Examples:
100-
- "/tools list" - Lists all available tools
100+
- "/tools" - Lists all available tools
101101
- "/tools trust fs_write" - Trusts the fs_write tool
102102
- "/tools untrust execute_bash" - Untrusts the execute_bash tool
103103
- "/tools trustall" - Trusts all tools
104104
- "/tools reset" - Resets all tool permissions to default
105105
106-
To get the current tool status, use the command "/tools list" which will display all available tools with their current permission status."#.to_string()
106+
To get the current tool status, use the command "/tools" which will display all available tools with their current permission status."#.to_string()
107107
}
108108

109109
fn to_command(&self, args: Vec<&str>) -> Result<Command, ChatError> {
@@ -122,7 +122,7 @@ To get the current tool status, use the command "/tools list" which will display
122122
// Parse arguments to determine the subcommand
123123
let subcommand = if let Some(first_arg) = args.first() {
124124
match *first_arg {
125-
"list" => None, // Default is to list tools
125+
"list" => None, // "list" is an unlisted alias for the default behavior (list tools)
126126
"trust" => {
127127
let tool_names = args[1..].iter().map(|s| (*s).to_string()).collect();
128128
Some(ToolsSubcommand::Trust { tool_names })
@@ -195,10 +195,11 @@ To get the current tool status, use the command "/tools list" which will display
195195
return false; // Default list doesn't require confirmation
196196
}
197197

198+
// Shouldn't get here, as this should delegate to the subcommand
198199
match args[0] {
199200
"help" | "list" => false, // Help and list don't require confirmation
200201
"trustall" => true, // Trustall requires confirmation
201-
_ => false, // Other commands don't require confirmation
202+
_ => true, // Other commands require confirmation
202203
}
203204
}
204205
}

0 commit comments

Comments
 (0)