MCPcopy
hub / github.com/continuedev/continue / createOrUpdateConfig

Function createOrUpdateConfig

extensions/cli/src/onboarding.ts:35–49  ·  view source on GitHub ↗
(apiKey: string)

Source from the content-addressed store, hash-verified

33}
34
35export 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
51export async function runOnboardingFlow(
52 configPath: string | undefined,

Callers 2

runOnboardingFlowFunction · 0.85
initializeServicesFunction · 0.85

Calls 2

setConfigFilePermissionsFunction · 0.85

Tested by

no test coverage detected