diff --git a/src/cli/parser/__tests__/command-suggestions.test.ts b/src/cli/parser/__tests__/command-suggestions.test.ts index 1ed03effa..ba007787e 100644 --- a/src/cli/parser/__tests__/command-suggestions.test.ts +++ b/src/cli/parser/__tests__/command-suggestions.test.ts @@ -109,6 +109,26 @@ test('get-text, gettext, and get_text suggest get text', () => { } }); +test('open-url suggests open ', () => { + assert.throws( + () => parseArgs(['open-url', 'https://example.com']), + (error: unknown) => + error instanceof AppError && + error.code === 'INVALID_ARGS' && + error.message === 'Unknown command: open-url. Did you mean open ?', + ); +}); + +test('close-session suggests close', () => { + assert.throws( + () => parseArgs(['close-session']), + (error: unknown) => + error instanceof AppError && + error.code === 'INVALID_ARGS' && + error.message === 'Unknown command: close-session. Did you mean close?', + ); +}); + test('screencap and capture suggest screenshot', () => { for (const guess of ['screencap', 'capture']) { assert.throws( diff --git a/src/cli/parser/command-suggestions.ts b/src/cli/parser/command-suggestions.ts index fac4a5237..a67dd40f3 100644 --- a/src/cli/parser/command-suggestions.ts +++ b/src/cli/parser/command-suggestions.ts @@ -38,6 +38,8 @@ const COMMAND_ALIAS_SUGGESTIONS: Record = { 'get-text': { command: 'get', example: 'get text' }, gettext: { command: 'get', example: 'get text' }, get_text: { command: 'get', example: 'get text' }, + 'open-url': { command: 'open', example: 'open ' }, + 'close-session': { command: 'close', example: 'close' }, }; export function listCommandAliasSuggestionEntries(): Array<[string, CommandAliasSuggestion]> {