feat(onboard): add --morpheus-api-key CLI flag for non-interactive mode
This commit is contained in:
parent
fa4c1245a4
commit
933e2bdf39
@ -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")
|
||||
|
||||
@ -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" ||
|
||||
|
||||
@ -71,6 +71,7 @@ export type OnboardOptions = {
|
||||
minimaxApiKey?: string;
|
||||
syntheticApiKey?: string;
|
||||
veniceApiKey?: string;
|
||||
morpheusApiKey?: string;
|
||||
opencodeZenApiKey?: string;
|
||||
gatewayPort?: number;
|
||||
gatewayBind?: GatewayBind;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user