{"record":{"id":"1e76d00f7d525a65","repo":"slopus/happy","slug":"unsupported-vendor-vendor","errorCode":null,"errorMessage":"Unsupported vendor: ${vendor}","messagePattern":"Unsupported vendor: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/happy-cli/src/commands/connect.ts","lineNumber":116,"sourceCode":"        process.exit(0);\n    } else if (vendor === 'claude') {\n        console.log('🚀 Registering Anthropic token with server');\n        const anthropicAuthTokens = await authenticateClaude();\n        await api.registerVendorToken('anthropic', { oauth: anthropicAuthTokens });\n        console.log('✅ Anthropic token registered with server');\n        process.exit(0);\n    } else if (vendor === 'gemini') {\n        console.log('🚀 Registering Gemini token with server');\n        const geminiAuthTokens = await authenticateGemini();\n        await api.registerVendorToken('gemini', { oauth: geminiAuthTokens });\n        console.log('✅ Gemini token registered with server');\n        \n        // Also update local Gemini config to keep tokens in sync\n        updateLocalGeminiCredentials(geminiAuthTokens);\n        \n        process.exit(0);\n    } else {\n        throw new Error(`Unsupported vendor: ${vendor}`);\n    }\n}\n\n/**\n * Show connection status for all vendors\n */\nasync function handleConnectStatus(): Promise<void> {\n    console.log(chalk.bold('\\n🔌 Connection Status\\n'));\n\n    // Check if authenticated\n    const credentials = await readCredentials();\n    if (!credentials) {\n        console.log(chalk.yellow('⚠️  Not authenticated with Happy'));\n        console.log(chalk.gray('  Please run \"happy auth login\" first'));\n        process.exit(1);\n    }\n\n    // Create API client","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/slopus/happy/blob/b824cd0a4681d41af631a8e422a813873e4455b0/packages/happy-cli/src/commands/connect.ts#L98-L134","documentation":"handleConnectVendor supports a fixed set of vendors (e.g. claude, gemini); any other value falls into the final else branch and throws 'Unsupported vendor: <vendor>'. It's an argument-validation error for the `happy connect <vendor>` command.","triggerScenarios":"Running `happy connect <vendor>` with a misspelled or unimplemented vendor name (e.g. `happy connect codex`, `happy connect gemni`), or an older CLI invoked with a vendor added only in newer versions.","commonSituations":"Typo in the vendor argument; following docs/blogs for a vendor your CLI version doesn't support yet; scripts parameterizing the vendor with a wrong value.","solutions":["Run `happy connect --help` (or check the status subcommand) to list supported vendors","Fix the spelling of the vendor argument","Update happy-cli to the latest version if the vendor was recently added","For Codex, use `happy codex` instead of `happy connect codex`"],"exampleFix":"// before\n$ happy connect gemni\nError: Unsupported vendor: gemni\n\n// after\n$ happy connect gemini","handlingStrategy":"validation","validationCode":"const SUPPORTED_VENDORS = ['claude', 'gemini'] as const;\ntype Vendor = typeof SUPPORTED_VENDORS[number];\nfunction isSupportedVendor(v: string): v is Vendor {\n  return (SUPPORTED_VENDORS as readonly string[]).includes(v);\n}\nif (!isSupportedVendor(vendor)) {\n  console.error(`Unsupported vendor: ${vendor}. Supported: ${SUPPORTED_VENDORS.join(', ')}`);\n  process.exit(1);\n}","typeGuard":"function isVendor(v: string): v is 'claude' | 'gemini' {\n  return v === 'claude' || v === 'gemini';\n}","tryCatchPattern":"try {\n  await handleConnectVendor(vendor);\n} catch (error) {\n  if ((error as Error).message.startsWith('Unsupported vendor:')) {\n    console.error((error as Error).message + '\\nRun `happy connect --help` for supported vendors.');\n  } else { throw error; }\n}","preventionTips":["Use tab-completion or --help to pick the vendor argument","Keep happy-cli updated so newly added vendors are available","Validate vendor values in scripts against the supported list before invoking the CLI"],"tags":["cli","validation","argument","vendor"],"backgroundTag":"unsupported-vendor","analyzedSha":"b824cd0a4681d41af631a8e422a813873e4455b0","analyzedAt":"2026-08-31T23:12:36.205Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}