(config: Config, key: string)
| 101 | } |
| 102 | |
| 103 | async 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. |
| 111 | export const ensureApiKey = ensureAuth; |
no test coverage detected