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("--synthetic-api-key <key>", "Synthetic 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("--gateway-port <port>", "Gateway port")
.option("--gateway-bind <mode>", "Gateway bind: loopback|tailnet|lan|auto|custom")

View File

@ -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" ||

View File

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