feat(cli): give visibility to /tools list command in the TUI and follow the subcommand pattern of other commands (#21213)

This commit is contained in:
JAYADITYA
2026-03-10 22:06:12 +05:30
committed by GitHub
parent b158c96465
commit 556825f81c
2 changed files with 90 additions and 4 deletions
+12 -3
View File
@@ -41,7 +41,16 @@ async function listTools(
context.ui.addItem(toolsListItem);
}
const toolsDescSubCommand: SlashCommand = {
const listSubCommand: SlashCommand = {
name: 'list',
description: 'List available Gemini CLI tools.',
kind: CommandKind.BUILT_IN,
autoExecute: true,
action: async (context: CommandContext): Promise<void> =>
listTools(context, false),
};
const descSubCommand: SlashCommand = {
name: 'desc',
altNames: ['descriptions'],
description: 'List available Gemini CLI tools with descriptions.',
@@ -57,11 +66,11 @@ export const toolsCommand: SlashCommand = {
'List available Gemini CLI tools. Use /tools desc to include descriptions.',
kind: CommandKind.BUILT_IN,
autoExecute: false,
subCommands: [toolsDescSubCommand],
subCommands: [listSubCommand, descSubCommand],
action: async (context: CommandContext, args?: string): Promise<void> => {
const subCommand = args?.trim();
// Keep backward compatibility for typed arguments while exposing desc in TUI via subcommands.
// Keep backward compatibility for typed arguments while exposing subcommands in TUI.
const useShowDescriptions =
subCommand === 'desc' || subCommand === 'descriptions';