refactor(onboard): unify auth-choice aliases and provider flags

This commit is contained in:
Peter Steinberger
2026-02-14 05:58:14 +01:00
parent 2f4cef2021
commit d8beddc8b7
9 changed files with 351 additions and 143 deletions

View File

@@ -1,5 +1,6 @@
import type { AuthProfileStore } from "../agents/auth-profiles.js";
import type { AuthChoice, AuthChoiceGroupId } from "./onboard-types.js";
import { AUTH_CHOICE_LEGACY_ALIASES_FOR_CLI } from "./auth-choice-legacy.js";
export type { AuthChoiceGroupId };
@@ -33,6 +34,12 @@ const AUTH_CHOICE_GROUP_DEFS: {
hint: "setup-token + API key",
choices: ["token", "apiKey"],
},
{
value: "chutes",
label: "Chutes",
hint: "OAuth",
choices: ["chutes"],
},
{
value: "vllm",
label: "vLLM",
@@ -287,15 +294,6 @@ const BASE_AUTH_CHOICE_OPTIONS: ReadonlyArray<AuthChoiceOption> = [
{ value: "custom-api-key", label: "Custom Provider" },
];
const LEGACY_AUTH_CHOICE_ALIASES: ReadonlyArray<AuthChoice> = [
"setup-token",
"oauth",
"claude-cli",
"codex-cli",
"minimax-cloud",
"minimax",
];
export function formatAuthChoiceChoicesForCli(params?: {
includeSkip?: boolean;
includeLegacyAliases?: boolean;
@@ -308,7 +306,7 @@ export function formatAuthChoiceChoicesForCli(params?: {
values.push("skip");
}
if (includeLegacyAliases) {
values.push(...LEGACY_AUTH_CHOICE_ALIASES);
values.push(...AUTH_CHOICE_LEGACY_ALIASES_FOR_CLI);
}
return values.join("|");