Skip to content

Commit 997eb7c

Browse files
committed
refactor(cli): rename /reset command to /clear
Rename the chat slash command from /reset to /clear for better clarity. Changes include updating the enum variant, parsing logic, help text, autocomplete suggestions, and confirmation message.
1 parent 33265df commit 997eb7c

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

crates/rullm-cli/src/commands/chat/completer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ impl SlashCommandCompleter {
1010
Self {
1111
commands: vec![
1212
"/system".to_string(),
13-
"/reset".to_string(),
13+
"/clear".to_string(),
1414
"/help".to_string(),
1515
"/quit".to_string(),
1616
"/exit".to_string(),
@@ -36,7 +36,7 @@ impl Completer for SlashCommandCompleter {
3636
value: cmd.clone(),
3737
description: match cmd.as_str() {
3838
"/system" => Some("Set system prompt".to_string()),
39-
"/reset" => Some("Clear conversation history".to_string()),
39+
"/clear" => Some("Clear conversation history".to_string()),
4040
"/help" => Some("Show available commands".to_string()),
4141
"/quit" => Some("Exit chat".to_string()),
4242
"/exit" => Some("Exit chat".to_string()),

crates/rullm-cli/src/commands/chat/slash_command.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rullm_core::types::ChatRole;
66
#[derive(Debug, Clone)]
77
pub enum SlashCommand {
88
System(String),
9-
Reset,
9+
Clear,
1010
Help,
1111
Quit,
1212
Edit,
@@ -20,7 +20,7 @@ impl SlashCommand {
2020
match input.to_lowercase().as_str() {
2121
"quit" | "exit" => return Some(SlashCommand::Quit),
2222
"help" => return Some(SlashCommand::Help),
23-
"reset" => return Some(SlashCommand::Reset),
23+
"clear" => return Some(SlashCommand::Clear),
2424
"edit" => return Some(SlashCommand::Edit),
2525
_ => {}
2626
}
@@ -42,7 +42,7 @@ impl SlashCommand {
4242
SlashCommand::System(String::new())
4343
}
4444
}
45-
"reset" => SlashCommand::Reset,
45+
"clear" => SlashCommand::Clear,
4646
"help" => SlashCommand::Help,
4747
"quit" | "exit" => SlashCommand::Quit,
4848
"edit" => SlashCommand::Edit,
@@ -79,9 +79,9 @@ pub async fn handle_slash_command(
7979
);
8080
Ok(HandleCommandResult::NoOp)
8181
}
82-
SlashCommand::Reset => {
82+
SlashCommand::Clear => {
8383
conversation.clear();
84-
println!("{}", "Conversation reset.".green());
84+
println!("{}", "Conversation cleared.".green());
8585
Ok(HandleCommandResult::NoOp)
8686
}
8787
SlashCommand::Help => {
@@ -94,7 +94,7 @@ pub async fn handle_slash_command(
9494
println!(" {} - Set system prompt", "/system <message>".yellow());
9595
println!(
9696
" {} - Clear conversation history",
97-
"/reset (reset)".yellow()
97+
"/clear (clear)".yellow()
9898
);
9999
println!(" {} - Show this help", "/help (help)".yellow());
100100
println!(

0 commit comments

Comments
 (0)