summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useCompletion.ts
diff options
context:
space:
mode:
authorSeth Troisi <[email protected]>2025-05-05 21:16:13 +0000
committerSeth Troisi <[email protected]>2025-05-05 22:33:22 +0000
commit2cd976987e0a4837301df161479e44dfcca6e206 (patch)
treea4b7f0cafbd7e2f402bd2449437ccdaebdd35bd9 /packages/cli/src/ui/hooks/useCompletion.ts
parentbb52149a06012ddb5e5535d60decf40aa11ac344 (diff)
slash command altnames and support for ?
Diffstat (limited to 'packages/cli/src/ui/hooks/useCompletion.ts')
-rw-r--r--packages/cli/src/ui/hooks/useCompletion.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/cli/src/ui/hooks/useCompletion.ts b/packages/cli/src/ui/hooks/useCompletion.ts
index 31c59bcf..97ad48ed 100644
--- a/packages/cli/src/ui/hooks/useCompletion.ts
+++ b/packages/cli/src/ui/hooks/useCompletion.ts
@@ -119,9 +119,18 @@ export function useCompletion(
// --- Handle Slash Command Completion ---
if (trimmedQuery.startsWith('/')) {
const partialCommand = trimmedQuery.substring(1);
- const filteredSuggestions = slashCommands
+ const commands = slashCommands
.map((cmd) => cmd.name)
+ .concat(
+ slashCommands
+ .map((cmd) => cmd.altName)
+ .filter((cmd) => cmd !== undefined),
+ );
+
+ const filteredSuggestions = commands
.filter((name) => name.startsWith(partialCommand))
+ // Filter out ? and any other single character commands
+ .filter((name) => name.length > 1)
.map((name) => ({ label: name, value: name }))
.sort();