MCPcopy Create free account
hub / github.com/IAmUnbounded/devctx / loadConfig

Function loadConfig

devctx/src/utils/config.ts:41–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 * Returns defaults if the file doesn't exist or is malformed.
40 */
41export async function loadConfig(): Promise<UserConfig> {
42 try {
43 const dir = await getDevCtxDir();
44 const configPath = path.join(dir, "config.json");
45
46 if (!fs.existsSync(configPath)) return { ...DEFAULT_CONFIG };
47
48 const raw = JSON.parse(fs.readFileSync(configPath, "utf-8"));
49 return { ...DEFAULT_CONFIG, ...raw };
50 } catch {
51 return { ...DEFAULT_CONFIG };
52 }
53}
54
55/**
56 * Save user preferences to `.devctx/config.json`.

Callers 4

configCommandFunction · 0.90
watchCommandFunction · 0.90
callAIFunction · 0.90
saveConfigFunction · 0.85

Calls 1

getDevCtxDirFunction · 0.90

Tested by

no test coverage detected