MCPcopy
hub / github.com/MiniMax-AI/cli / pickOAuthRegion

Function pickOAuthRegion

src/auth/setup.ts:77–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75 * Region-only picker used by `mmx auth login --recommend` (no API-key option).
76 */
77export async function pickOAuthRegion(): Promise<Region> {
78 const { select, isCancel } = await import('@clack/prompts');
79 const value = await select({
80 message: 'Select an OAuth region:',
81 options: [
82 { value: 'global', label: `Global → ${stripScheme(REGIONS.global)}` },
83 { value: 'cn', label: `China → ${stripScheme(REGIONS.cn)}` },
84 ],
85 });
86 if (isCancel(value)) throw new CLIError('Authentication cancelled.', ExitCode.AUTH);
87 return value as Region;
88}
89
90export async function runOAuthLogin(region: Region): Promise<void> {
91 const creds = await deviceCodeLogin(region);

Callers 1

runFunction · 0.90

Calls 1

stripSchemeFunction · 0.70

Tested by

no test coverage detected