feat(onboard): add --morpheus-api-key CLI flag for non-interactive mode

This commit is contained in:
bowtiedbluefin 2026-01-26 10:53:20 -05:00
parent fa4c1245a4
commit 933e2bdf39
3 changed files with 23 additions and 0 deletions

View File

@ -75,6 +75,7 @@ export function registerOnboardCommand(program: Command) {
.option("--minimax-api-key <key>", "MiniMax API key") .option("--minimax-api-key <key>", "MiniMax API key")
.option("--synthetic-api-key <key>", "Synthetic API key") .option("--synthetic-api-key <key>", "Synthetic API key")
.option("--venice-api-key <key>", "Venice API key") .option("--venice-api-key <key>", "Venice API key")
.option("--morpheus-api-key <key>", "Morpheus API key")
.option("--opencode-zen-api-key <key>", "OpenCode Zen API key") .option("--opencode-zen-api-key <key>", "OpenCode Zen API key")
.option("--gateway-port <port>", "Gateway port") .option("--gateway-port <port>", "Gateway port")
.option("--gateway-bind <mode>", "Gateway bind: loopback|tailnet|lan|auto|custom") .option("--gateway-bind <mode>", "Gateway bind: loopback|tailnet|lan|auto|custom")

View File

@ -16,6 +16,7 @@ import {
applyOpenrouterConfig, applyOpenrouterConfig,
applySyntheticConfig, applySyntheticConfig,
applyVeniceConfig, applyVeniceConfig,
applyMorpheusConfig,
applyVercelAiGatewayConfig, applyVercelAiGatewayConfig,
applyZaiConfig, applyZaiConfig,
setAnthropicApiKey, setAnthropicApiKey,
@ -27,6 +28,7 @@ import {
setOpenrouterApiKey, setOpenrouterApiKey,
setSyntheticApiKey, setSyntheticApiKey,
setVeniceApiKey, setVeniceApiKey,
setMorpheusApiKey,
setVercelAiGatewayApiKey, setVercelAiGatewayApiKey,
setZaiApiKey, setZaiApiKey,
} from "../../onboard-auth.js"; } from "../../onboard-auth.js";
@ -309,6 +311,25 @@ export async function applyNonInteractiveAuthChoice(params: {
return applyVeniceConfig(nextConfig); 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 ( if (
authChoice === "minimax-cloud" || authChoice === "minimax-cloud" ||
authChoice === "minimax-api" || authChoice === "minimax-api" ||

View File

@ -71,6 +71,7 @@ export type OnboardOptions = {
minimaxApiKey?: string; minimaxApiKey?: string;
syntheticApiKey?: string; syntheticApiKey?: string;
veniceApiKey?: string; veniceApiKey?: string;
morpheusApiKey?: string;
opencodeZenApiKey?: string; opencodeZenApiKey?: string;
gatewayPort?: number; gatewayPort?: number;
gatewayBind?: GatewayBind; gatewayBind?: GatewayBind;