diff --git a/src/cli/program/register.onboard.ts b/src/cli/program/register.onboard.ts index 8f31635f0..478bae5d4 100644 --- a/src/cli/program/register.onboard.ts +++ b/src/cli/program/register.onboard.ts @@ -75,6 +75,7 @@ export function registerOnboardCommand(program: Command) { .option("--minimax-api-key ", "MiniMax API key") .option("--synthetic-api-key ", "Synthetic API key") .option("--venice-api-key ", "Venice API key") + .option("--morpheus-api-key ", "Morpheus API key") .option("--opencode-zen-api-key ", "OpenCode Zen API key") .option("--gateway-port ", "Gateway port") .option("--gateway-bind ", "Gateway bind: loopback|tailnet|lan|auto|custom") diff --git a/src/commands/onboard-non-interactive/local/auth-choice.ts b/src/commands/onboard-non-interactive/local/auth-choice.ts index 7d952730c..6215d7d04 100644 --- a/src/commands/onboard-non-interactive/local/auth-choice.ts +++ b/src/commands/onboard-non-interactive/local/auth-choice.ts @@ -16,6 +16,7 @@ import { applyOpenrouterConfig, applySyntheticConfig, applyVeniceConfig, + applyMorpheusConfig, applyVercelAiGatewayConfig, applyZaiConfig, setAnthropicApiKey, @@ -27,6 +28,7 @@ import { setOpenrouterApiKey, setSyntheticApiKey, setVeniceApiKey, + setMorpheusApiKey, setVercelAiGatewayApiKey, setZaiApiKey, } from "../../onboard-auth.js"; @@ -309,6 +311,25 @@ export async function applyNonInteractiveAuthChoice(params: { return applyVeniceConfig(nextConfig); } + if (authChoice === "morpheus-api-key") { + const resolved = await resolveNonInteractiveApiKey({ + provider: "morpheus", + cfg: baseConfig, + flagValue: opts.morpheusApiKey, + flagName: "--morpheus-api-key", + envVar: "MORPHEUS_API_KEY", + runtime, + }); + if (!resolved) return null; + if (resolved.source !== "profile") await setMorpheusApiKey(resolved.key); + nextConfig = applyAuthProfileConfig(nextConfig, { + profileId: "morpheus:default", + provider: "morpheus", + mode: "api_key", + }); + return applyMorpheusConfig(nextConfig); + } + if ( authChoice === "minimax-cloud" || authChoice === "minimax-api" || diff --git a/src/commands/onboard-types.ts b/src/commands/onboard-types.ts index 51c0ff7b2..f04d04de2 100644 --- a/src/commands/onboard-types.ts +++ b/src/commands/onboard-types.ts @@ -71,6 +71,7 @@ export type OnboardOptions = { minimaxApiKey?: string; syntheticApiKey?: string; veniceApiKey?: string; + morpheusApiKey?: string; opencodeZenApiKey?: string; gatewayPort?: number; gatewayBind?: GatewayBind;