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

Function persistApiKey

src/auth/setup.ts:103–108  ·  view source on GitHub ↗
(config: Config, key: string)

Source from the content-addressed store, hash-verified

101}
102
103async function persistApiKey(config: Config, key: string): Promise<void> {
104 const data = { ...(readConfigFile() as Record<string, unknown>), api_key: key };
105 await writeConfigFile(data);
106 config.fileApiKey = key;
107 process.stderr.write(`API key saved to ${config.configPath ?? '~/.mmx/config.json'}\n`);
108}
109
110// Legacy alias kept so main.ts keeps working without churn.
111export const ensureApiKey = ensureAuth;

Callers 1

ensureAuthFunction · 0.85

Calls 2

readConfigFileFunction · 0.90
writeConfigFileFunction · 0.90

Tested by

no test coverage detected