(apiKey: string)
| 33 | } |
| 34 | |
| 35 | export async function createOrUpdateConfig(apiKey: string): Promise<void> { |
| 36 | const configDir = path.dirname(CONFIG_PATH); |
| 37 | |
| 38 | if (!fs.existsSync(configDir)) { |
| 39 | fs.mkdirSync(configDir, { recursive: true }); |
| 40 | } |
| 41 | |
| 42 | const existingContent = fs.existsSync(CONFIG_PATH) |
| 43 | ? fs.readFileSync(CONFIG_PATH, "utf8") |
| 44 | : ""; |
| 45 | |
| 46 | const updatedContent = updateAnthropicModelInYaml(existingContent, apiKey); |
| 47 | fs.writeFileSync(CONFIG_PATH, updatedContent); |
| 48 | setConfigFilePermissions(CONFIG_PATH); |
| 49 | } |
| 50 | |
| 51 | export async function runOnboardingFlow( |
| 52 | configPath: string | undefined, |
no test coverage detected