diff --git a/extensions/cli/src/slashCommands.ts b/extensions/cli/src/slashCommands.ts index daf8c4ff7..c88d8f13f 100644 --- a/extensions/cli/src/slashCommands.ts +++ b/extensions/cli/src/slashCommands.ts @@ -163,5 +163,16 @@ export async function handleSlashCommands( return { newInput }; } + // Check if this command would match any available commands (same logic as UI) + const allCommands = getAllSlashCommands(assistant); + const hasMatches = allCommands.some((cmd) => + cmd.name.toLowerCase().includes(command.toLowerCase()), + ); + + // If no commands match, treat this as regular text instead of an unknown command + if (!hasMatches) { + return null; + } + return { output: `Unknown command: ${command}` }; }