From ddcac4201d13bfa948c900f10f8c6cd227099c7b Mon Sep 17 00:00:00 2001 From: Harold Mciver Date: Wed, 16 Jul 2025 11:56:05 -0400 Subject: update `/docs` to new slash command arch (#4133) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- packages/cli/src/services/CommandService.test.ts | 8 +++++++- packages/cli/src/services/CommandService.ts | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'packages/cli/src/services') diff --git a/packages/cli/src/services/CommandService.test.ts b/packages/cli/src/services/CommandService.test.ts index 3bc618a2..5e5e25ae 100644 --- a/packages/cli/src/services/CommandService.test.ts +++ b/packages/cli/src/services/CommandService.test.ts @@ -10,6 +10,7 @@ import { type SlashCommand } from '../ui/commands/types.js'; import { memoryCommand } from '../ui/commands/memoryCommand.js'; import { helpCommand } from '../ui/commands/helpCommand.js'; import { clearCommand } from '../ui/commands/clearCommand.js'; +import { docsCommand } from '../ui/commands/docsCommand.js'; import { chatCommand } from '../ui/commands/chatCommand.js'; import { authCommand } from '../ui/commands/authCommand.js'; import { themeCommand } from '../ui/commands/themeCommand.js'; @@ -30,6 +31,9 @@ vi.mock('../ui/commands/helpCommand.js', () => ({ vi.mock('../ui/commands/clearCommand.js', () => ({ clearCommand: { name: 'clear', description: 'Mock Clear' }, })); +vi.mock('../ui/commands/docsCommand.js', () => ({ + docsCommand: { name: 'docs', description: 'Mock Docs' }, +})); vi.mock('../ui/commands/authCommand.js', () => ({ authCommand: { name: 'auth', description: 'Mock Auth' }, })); @@ -56,7 +60,7 @@ vi.mock('../ui/commands/mcpCommand.js', () => ({ })); describe('CommandService', () => { - const subCommandLen = 12; + const subCommandLen = 13; describe('when using default production loader', () => { let commandService: CommandService; @@ -88,6 +92,7 @@ describe('CommandService', () => { expect(commandNames).toContain('memory'); expect(commandNames).toContain('help'); expect(commandNames).toContain('clear'); + expect(commandNames).toContain('docs'); expect(commandNames).toContain('chat'); expect(commandNames).toContain('theme'); expect(commandNames).toContain('stats'); @@ -127,6 +132,7 @@ describe('CommandService', () => { chatCommand, clearCommand, compressCommand, + docsCommand, extensionsCommand, helpCommand, mcpCommand, diff --git a/packages/cli/src/services/CommandService.ts b/packages/cli/src/services/CommandService.ts index 49e26833..b9a8df1c 100644 --- a/packages/cli/src/services/CommandService.ts +++ b/packages/cli/src/services/CommandService.ts @@ -8,6 +8,7 @@ import { SlashCommand } from '../ui/commands/types.js'; import { memoryCommand } from '../ui/commands/memoryCommand.js'; import { helpCommand } from '../ui/commands/helpCommand.js'; import { clearCommand } from '../ui/commands/clearCommand.js'; +import { docsCommand } from '../ui/commands/docsCommand.js'; import { mcpCommand } from '../ui/commands/mcpCommand.js'; import { authCommand } from '../ui/commands/authCommand.js'; import { themeCommand } from '../ui/commands/themeCommand.js'; @@ -24,6 +25,7 @@ const loadBuiltInCommands = async (): Promise => [ chatCommand, clearCommand, compressCommand, + docsCommand, extensionsCommand, helpCommand, mcpCommand, -- cgit v1.2.3