From a6da819b939b8761b37491b1f7cf38e6b8c3bd3c Mon Sep 17 00:00:00 2001 From: Ponder <190127701@qq.com> Date: Mon, 2 Feb 2026 05:17:16 +0800 Subject: [PATCH] feat: Allow third-party plugins to add quick connection support. (#11004) --- app/lib/cli.ts | 3 +-- tabby-core/src/cli.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/lib/cli.ts b/app/lib/cli.ts index 03213dd8..1b8fb06e 100644 --- a/app/lib/cli.ts +++ b/app/lib/cli.ts @@ -30,9 +30,8 @@ export function parseArgs (argv: string[], cwd: string): any { }) .command('quickConnect ', 'open a tab for specified quick connect provider', yargs => { return yargs.positional('providerId', { - describe: 'The name of a quick connect profile provider', + describe: 'The name of a quick connect profile provider (e.g., ssh, telnet)', type: 'string', - choices: ['ssh', 'telnet'], }).positional('query', { describe: 'The quick connect query string', type: 'string', diff --git a/tabby-core/src/cli.ts b/tabby-core/src/cli.ts index 15914070..99235f65 100644 --- a/tabby-core/src/cli.ts +++ b/tabby-core/src/cli.ts @@ -55,9 +55,12 @@ export class ProfileCLIHandler extends CLIHandler { } private async handleOpenQuickConnect (providerId: string, query: string) { - const provider = this.profiles.getProviders().find(x => x.id === providerId) - if(!provider || !(provider instanceof QuickConnectProfileProvider)) { - console.error(`Requested provider "${providerId}" not found`) + const quickConnectProviders = this.profiles.getProviders() + .filter((x): x is QuickConnectProfileProvider => x instanceof QuickConnectProfileProvider) + const provider = quickConnectProviders.find(x => x.id === providerId) + if(!provider) { + const available = quickConnectProviders.map(x => x.id).join(', ') + console.error(`Requested provider "${providerId}" not found. Available providers: ${available}`) return } const profile = provider.quickConnect(query)