fix(terminal): offer Copilot's, Qwen Code's, CodeBuddy's and Kimi Code's commands

All four take typed slash commands, but the composer knew none of them: `/`
opened no menu and the placeholder offered only `@` files. List each one's
everyday commands as its installed version names them: Copilot CLI 1.0,
Qwen Code 0.24, CodeBuddy Code 2.161 and Kimi Code 2.1, which has `/new`
rather than `/clear` and `/permission` in the singular.
This commit is contained in:
l0ng-ai
2026-10-01 15:28:01 +08:00
parent 8ca1d57a7f
commit f155fa59de
+61
View File
@@ -617,6 +617,63 @@ fn builtin_commands(agent: CLIAgent) -> &'static [(&'static str, &'static str)]
("/mcps", "Toggle MCPs"),
("/help", "Help"),
],
CLIAgent::Copilot => &[
("/model", "Switch the model"),
("/clear", "Abandon this session and start fresh"),
("/compact", "Summarize the conversation to free up context"),
("/context", "Show context window usage"),
("/resume", "Switch to another session"),
("/review", "Review the current changes"),
("/diff", "Review the changes in the current directory"),
("/init", "Create Copilot instructions for this repo"),
("/usage", "Show session usage metrics"),
("/permissions", "Choose how requests are approved"),
("/agent", "Browse and select agents"),
("/mcp", "Manage MCP servers"),
("/help", "Show help for interactive commands"),
],
CLIAgent::Qwen => &[
("/compress", "Summarize to free up context"),
("/clear", "Clear conversation history and free up context"),
("/model", "Switch the model"),
("/resume", "Resume a previous session"),
("/init", "Create a QWEN.md for this repo"),
("/approval-mode", "Change the approval mode for tools"),
("/tools", "List available tools"),
("/mcp", "Manage MCP servers"),
("/stats", "Show usage statistics"),
("/help", "Show help"),
],
CLIAgent::CodeBuddy => &[
("/compact", "Compress context"),
("/clear", "Start a new conversation"),
("/model", "Switch or view the main model"),
("/resume", "Resume a previous session"),
("/rewind", "Rewind the conversation or code"),
("/init", "Create a CODEBUDDY.md for this repo"),
("/context", "Show context usage"),
("/cost", "Show session cost and token usage"),
("/memory", "Manage long-term memory"),
("/permissions", "Manage tool permissions"),
("/mcp", "Manage MCP connections"),
("/status", "Show repository and session status"),
("/help", "Show help"),
],
CLIAgent::Kimi => &[
("/new", "Start a fresh session"),
("/compact", "Compact the conversation context"),
("/model", "Switch LLM model"),
("/effort", "Switch thinking effort"),
("/sessions", "Browse and resume sessions"),
("/undo", "Withdraw the last prompt"),
("/init", "Analyze the codebase and generate AGENTS.md"),
("/plan", "Toggle plan mode"),
("/permission", "Select permission mode"),
("/usage", "Show session tokens and context window"),
("/status", "Show session and runtime status"),
("/mcp", "Show MCP server status"),
("/help", "Show available commands and shortcuts"),
],
// Amp has no typed commands: `/` on an empty input opens its command
// palette, which a message cannot drive.
_ => &[],
@@ -2798,6 +2855,10 @@ mod tests {
CLIAgent::Codex,
CLIAgent::Gemini,
CLIAgent::OpenCode,
CLIAgent::Copilot,
CLIAgent::Qwen,
CLIAgent::CodeBuddy,
CLIAgent::Kimi,
] {
let names: Vec<&str> = builtin_commands(agent).iter().map(|(n, _)| *n).collect();
for (i, name) in names.iter().enumerate() {