summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/slashCommandProcessor.ts
diff options
context:
space:
mode:
authorEddie Santos <[email protected]>2025-06-04 14:01:38 -0700
committerGitHub <[email protected]>2025-06-04 14:01:38 -0700
commitd99d132cdfdfeb3d06118cb1787406f8eac4434a (patch)
tree39ded9d58f0fcf38c2bab89d972b4c8b8a9360f8 /packages/cli/src/ui/hooks/slashCommandProcessor.ts
parentfdc8bd8ed9ecab675f2eb0f52ec9c0263d45876b (diff)
Add `/tools` slash command to view available tools (#752)
Diffstat (limited to 'packages/cli/src/ui/hooks/slashCommandProcessor.ts')
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.ts23
1 files changed, 22 insertions, 1 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
index 51def9d5..6de2ceab 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
@@ -161,7 +161,28 @@ export const useSlashCommandProcessor = (
}
},
},
-
+ {
+ name: 'tools',
+ description: 'list available tools',
+ action: async (_mainCommand, _subCommand, _args) => {
+ const toolRegistry = await config?.getToolRegistry();
+ const tools = toolRegistry?.getAllTools();
+ if (!tools) {
+ addMessage({
+ type: MessageType.ERROR,
+ content: 'Could not retrieve tools.',
+ timestamp: new Date(),
+ });
+ return;
+ }
+ const toolList = tools.map((tool) => tool.name);
+ addMessage({
+ type: MessageType.INFO,
+ content: `Available tools:\n\n${toolList.join('\n')}`,
+ timestamp: new Date(),
+ });
+ },
+ },
{
name: 'corgi',
action: (_mainCommand, _subCommand, _args) => {