diff options
| author | Harold Mciver <[email protected]> | 2025-07-16 16:12:22 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-16 20:12:22 +0000 |
| commit | 21eb44b242e045cad957d21b049d00b55abf9489 (patch) | |
| tree | a6fdec98e5ea79285950978ad18960c504f4013c /packages/cli/src/ui/hooks/slashCommandProcessor.ts | |
| parent | e4ed1aabac10101a6ad6c25e46e84a3d2091bb88 (diff) | |
update `/tools` to new slash command arch (#4236)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: matt korwel <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/hooks/slashCommandProcessor.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/slashCommandProcessor.ts | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts index 8fa3f880..24758842 100644 --- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts @@ -66,7 +66,6 @@ export const useSlashCommandProcessor = ( openAuthDialog: () => void, openEditorDialog: () => void, toggleCorgiMode: () => void, - showToolDescriptions: boolean = false, setQuittingMessages: (message: HistoryItem[]) => void, openPrivacyNotice: () => void, ) => { @@ -206,80 +205,6 @@ export const useSlashCommandProcessor = ( action: (_mainCommand, _subCommand, _args) => openEditorDialog(), }, { - name: 'tools', - description: 'list available Gemini CLI tools', - action: async (_mainCommand, _subCommand, _args) => { - // Check if the _subCommand includes a specific flag to control description visibility - let useShowDescriptions = showToolDescriptions; - if (_subCommand === 'desc' || _subCommand === 'descriptions') { - useShowDescriptions = true; - } else if ( - _subCommand === 'nodesc' || - _subCommand === 'nodescriptions' - ) { - useShowDescriptions = false; - } else if (_args === 'desc' || _args === 'descriptions') { - useShowDescriptions = true; - } else if (_args === 'nodesc' || _args === 'nodescriptions') { - useShowDescriptions = false; - } - - const toolRegistry = await config?.getToolRegistry(); - const tools = toolRegistry?.getAllTools(); - if (!tools) { - addMessage({ - type: MessageType.ERROR, - content: 'Could not retrieve tools.', - timestamp: new Date(), - }); - return; - } - - // Filter out MCP tools by checking if they have a serverName property - const geminiTools = tools.filter((tool) => !('serverName' in tool)); - - let message = 'Available Gemini CLI tools:\n\n'; - - if (geminiTools.length > 0) { - geminiTools.forEach((tool) => { - if (useShowDescriptions && tool.description) { - // Format tool name in cyan using simple ANSI cyan color - message += ` - \u001b[36m${tool.displayName} (${tool.name})\u001b[0m:\n`; - - // Apply green color to the description text - const greenColor = '\u001b[32m'; - const resetColor = '\u001b[0m'; - - // Handle multi-line descriptions by properly indenting and preserving formatting - const descLines = tool.description.trim().split('\n'); - - // If there are multiple lines, add proper indentation for each line - if (descLines) { - for (const descLine of descLines) { - message += ` ${greenColor}${descLine}${resetColor}\n`; - } - } - } else { - // Use cyan color for the tool name even when not showing descriptions - message += ` - \u001b[36m${tool.displayName}\u001b[0m\n`; - } - }); - } else { - message += ' No tools available\n'; - } - message += '\n'; - - // Make sure to reset any ANSI formatting at the end to prevent it from affecting the terminal - message += '\u001b[0m'; - - addMessage({ - type: MessageType.INFO, - content: message, - timestamp: new Date(), - }); - }, - }, - { name: 'corgi', action: (_mainCommand, _subCommand, _args) => { toggleCorgiMode(); @@ -503,7 +428,6 @@ export const useSlashCommandProcessor = ( openEditorDialog, toggleCorgiMode, config, - showToolDescriptions, session, gitService, loadHistory, |
