mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-07 00:24:50 +08:00
feat: add 40 slash commands — command surface 67/141
Port 40 missing user-facing slash commands from upstream parity audit: Session: /doctor, /login, /logout, /usage, /stats, /rename, /privacy-settings Workspace: /branch, /add-dir, /files, /hooks, /release-notes Discovery: /context, /tasks, /doctor, /ide, /desktop Analysis: /review, /security-review, /advisor, /insights Appearance: /theme, /vim, /voice, /color, /effort, /fast, /brief, /output-style, /keybindings, /stickers Communication: /copy, /share, /feedback, /summary, /tag, /thinkback, /plan, /exit, /upgrade, /rewind All commands have full SlashCommandSpec, enum variant, parse arm, and stub handler. Category system expanded with two new categories. Tests updated for new counts (67 specs, 39 resume-supported). fmt/clippy/tests all green.
This commit is contained in:
@@ -1464,7 +1464,47 @@ fn run_resume_command(
|
||||
| SlashCommand::Model { .. }
|
||||
| SlashCommand::Permissions { .. }
|
||||
| SlashCommand::Session { .. }
|
||||
| SlashCommand::Plugins { .. } => Err("unsupported resumed slash command".into()),
|
||||
| SlashCommand::Plugins { .. }
|
||||
| SlashCommand::Doctor
|
||||
| SlashCommand::Login
|
||||
| SlashCommand::Logout
|
||||
| SlashCommand::Vim
|
||||
| SlashCommand::Upgrade
|
||||
| SlashCommand::Stats
|
||||
| SlashCommand::Share
|
||||
| SlashCommand::Feedback
|
||||
| SlashCommand::Files
|
||||
| SlashCommand::Fast
|
||||
| SlashCommand::Exit
|
||||
| SlashCommand::Summary
|
||||
| SlashCommand::Desktop
|
||||
| SlashCommand::Brief
|
||||
| SlashCommand::Advisor
|
||||
| SlashCommand::Stickers
|
||||
| SlashCommand::Insights
|
||||
| SlashCommand::Thinkback
|
||||
| SlashCommand::ReleaseNotes
|
||||
| SlashCommand::SecurityReview
|
||||
| SlashCommand::Keybindings
|
||||
| SlashCommand::PrivacySettings
|
||||
| SlashCommand::Plan { .. }
|
||||
| SlashCommand::Review { .. }
|
||||
| SlashCommand::Tasks { .. }
|
||||
| SlashCommand::Theme { .. }
|
||||
| SlashCommand::Voice { .. }
|
||||
| SlashCommand::Usage { .. }
|
||||
| SlashCommand::Rename { .. }
|
||||
| SlashCommand::Copy { .. }
|
||||
| SlashCommand::Hooks { .. }
|
||||
| SlashCommand::Context { .. }
|
||||
| SlashCommand::Color { .. }
|
||||
| SlashCommand::Effort { .. }
|
||||
| SlashCommand::Branch { .. }
|
||||
| SlashCommand::Rewind { .. }
|
||||
| SlashCommand::Ide { .. }
|
||||
| SlashCommand::Tag { .. }
|
||||
| SlashCommand::OutputStyle { .. }
|
||||
| SlashCommand::AddDir { .. } => Err("unsupported resumed slash command".into()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1970,6 +2010,49 @@ impl LiveCli {
|
||||
Self::print_skills(args.as_deref())?;
|
||||
false
|
||||
}
|
||||
SlashCommand::Doctor
|
||||
| SlashCommand::Login
|
||||
| SlashCommand::Logout
|
||||
| SlashCommand::Vim
|
||||
| SlashCommand::Upgrade
|
||||
| SlashCommand::Stats
|
||||
| SlashCommand::Share
|
||||
| SlashCommand::Feedback
|
||||
| SlashCommand::Files
|
||||
| SlashCommand::Fast
|
||||
| SlashCommand::Exit
|
||||
| SlashCommand::Summary
|
||||
| SlashCommand::Desktop
|
||||
| SlashCommand::Brief
|
||||
| SlashCommand::Advisor
|
||||
| SlashCommand::Stickers
|
||||
| SlashCommand::Insights
|
||||
| SlashCommand::Thinkback
|
||||
| SlashCommand::ReleaseNotes
|
||||
| SlashCommand::SecurityReview
|
||||
| SlashCommand::Keybindings
|
||||
| SlashCommand::PrivacySettings
|
||||
| SlashCommand::Plan { .. }
|
||||
| SlashCommand::Review { .. }
|
||||
| SlashCommand::Tasks { .. }
|
||||
| SlashCommand::Theme { .. }
|
||||
| SlashCommand::Voice { .. }
|
||||
| SlashCommand::Usage { .. }
|
||||
| SlashCommand::Rename { .. }
|
||||
| SlashCommand::Copy { .. }
|
||||
| SlashCommand::Hooks { .. }
|
||||
| SlashCommand::Context { .. }
|
||||
| SlashCommand::Color { .. }
|
||||
| SlashCommand::Effort { .. }
|
||||
| SlashCommand::Branch { .. }
|
||||
| SlashCommand::Rewind { .. }
|
||||
| SlashCommand::Ide { .. }
|
||||
| SlashCommand::Tag { .. }
|
||||
| SlashCommand::OutputStyle { .. }
|
||||
| SlashCommand::AddDir { .. } => {
|
||||
eprintln!("Command registered but not yet implemented.");
|
||||
false
|
||||
}
|
||||
SlashCommand::Unknown(name) => {
|
||||
eprintln!("{}", format_unknown_slash_command(&name));
|
||||
false
|
||||
@@ -5590,9 +5673,9 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn formats_unknown_slash_command_with_suggestions() {
|
||||
let report = format_unknown_slash_command_message("stats");
|
||||
assert!(report.contains("unknown slash command: /stats"));
|
||||
assert!(report.contains("Did you mean /status?"));
|
||||
let report = format_unknown_slash_command_message("statsu");
|
||||
assert!(report.contains("unknown slash command: /statsu"));
|
||||
assert!(report.contains("Did you mean"));
|
||||
assert!(report.contains("Use /help"));
|
||||
}
|
||||
|
||||
@@ -5830,8 +5913,45 @@ mod tests {
|
||||
assert_eq!(
|
||||
names,
|
||||
vec![
|
||||
"help", "status", "sandbox", "compact", "clear", "cost", "config", "mcp", "memory",
|
||||
"init", "diff", "version", "export", "agents", "skills",
|
||||
"help",
|
||||
"status",
|
||||
"sandbox",
|
||||
"compact",
|
||||
"clear",
|
||||
"cost",
|
||||
"config",
|
||||
"mcp",
|
||||
"memory",
|
||||
"init",
|
||||
"diff",
|
||||
"version",
|
||||
"export",
|
||||
"agents",
|
||||
"skills",
|
||||
"doctor",
|
||||
"plan",
|
||||
"tasks",
|
||||
"theme",
|
||||
"vim",
|
||||
"usage",
|
||||
"stats",
|
||||
"copy",
|
||||
"hooks",
|
||||
"files",
|
||||
"context",
|
||||
"color",
|
||||
"effort",
|
||||
"fast",
|
||||
"summary",
|
||||
"tag",
|
||||
"brief",
|
||||
"advisor",
|
||||
"stickers",
|
||||
"insights",
|
||||
"thinkback",
|
||||
"keybindings",
|
||||
"privacy-settings",
|
||||
"output-style",
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user