소스 검색

Tighten help and clear messaging across the CLI surface

Refresh shared slash help and REPL help wording so the command surface reads more like an integrated console, and make successful /clear output match the newer structured reporting style. This keeps discoverability consistent now that status, model, permissions, config, and cost all use richer operator-oriented copy.

Constraint: Help text must stay synchronized with the actual implemented command surface and resume behavior
Rejected: Larger README/doc pass in the same commit | keeping the slice limited to runtime help/output makes it easier to review and revert
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Prefer shared help-copy changes in commands crate first, then layer REPL-specific additions in the CLI binary
Tested: cargo fmt --manifest-path ./rust/Cargo.toml --all; cargo clippy --manifest-path ./rust/Cargo.toml --workspace --all-targets -- -D warnings; cargo test --manifest-path ./rust/Cargo.toml --workspace
Not-tested: Manual comparison of help wording against upstream Claude Code terminal screenshots
Yeachan-Heo 2 달 전
부모
커밋
cba31c4f95
2개의 변경된 파일30개의 추가작업 그리고 9개의 파일을 삭제
  1. 4 4
      rust/crates/commands/src/lib.rs
  2. 26 5
      rust/crates/rusty-claude-cli/src/main.rs

+ 4 - 4
rust/crates/commands/src/lib.rs

@@ -174,8 +174,8 @@ pub fn resume_supported_slash_commands() -> Vec<&'static SlashCommandSpec> {
 #[must_use]
 pub fn render_slash_command_help() -> String {
     let mut lines = vec![
-        "Available commands:".to_string(),
-        "  (resume-safe commands are marked with [resume])".to_string(),
+        "Slash commands".to_string(),
+        "  [resume] means the command also works with --resume SESSION.json".to_string(),
     ];
     for spec in slash_command_specs() {
         let name = match spec.argument_hint {
@@ -288,7 +288,7 @@ mod tests {
     #[test]
     fn renders_help_from_shared_specs() {
         let help = render_slash_command_help();
-        assert!(help.contains("resume-safe commands"));
+        assert!(help.contains("works with --resume SESSION.json"));
         assert!(help.contains("/help"));
         assert!(help.contains("/status"));
         assert!(help.contains("/compact"));
@@ -340,7 +340,7 @@ mod tests {
         let result = handle_slash_command("/help", &session, CompactionConfig::default())
             .expect("help command should be handled");
         assert_eq!(result.session, session);
-        assert!(result.message.contains("Available commands:"));
+        assert!(result.message.contains("Slash commands"));
     }
 
     #[test]

+ 26 - 5
rust/crates/rusty-claude-cli/src/main.rs

@@ -623,7 +623,14 @@ impl LiveCli {
             true,
             permission_mode_label(),
         )?;
-        println!("Cleared local session history.");
+        println!(
+            "Session cleared
+  Mode             fresh session
+  Preserved model  {}
+  Permission mode  {}",
+            self.model,
+            permission_mode_label()
+        );
         Ok(())
     }
 
@@ -685,10 +692,16 @@ impl LiveCli {
 }
 
 fn render_repl_help() -> String {
-    format!(
-        "{}
-  /exit                Quit the REPL",
-        render_slash_command_help()
+    [
+        "REPL".to_string(),
+        "  /exit                Quit the REPL".to_string(),
+        "  /quit                Quit the REPL".to_string(),
+        String::new(),
+        render_slash_command_help(),
+    ]
+    .join(
+        "
+",
     )
 }
 
@@ -1351,9 +1364,17 @@ mod tests {
         );
     }
 
+    #[test]
+    fn shared_help_uses_resume_annotation_copy() {
+        let help = commands::render_slash_command_help();
+        assert!(help.contains("Slash commands"));
+        assert!(help.contains("works with --resume SESSION.json"));
+    }
+
     #[test]
     fn repl_help_includes_shared_commands_and_exit() {
         let help = render_repl_help();
+        assert!(help.contains("REPL"));
         assert!(help.contains("/help"));
         assert!(help.contains("/status"));
         assert!(help.contains("/model [model]"));