MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / loadTuiConfig

Function loadTuiConfig

apps/kimi-code/src/tui/config.ts:103–115  ·  view source on GitHub ↗
(filePath: string = getTuiConfigPath())

Source from the content-addressed store, hash-verified

101}
102
103export async function loadTuiConfig(filePath: string = getTuiConfigPath()): Promise<TuiConfig> {
104 if (!existsSync(filePath)) {
105 await saveTuiConfig(DEFAULT_TUI_CONFIG, filePath);
106 return DEFAULT_TUI_CONFIG;
107 }
108
109 try {
110 const text = await readFile(filePath, 'utf-8');
111 return parseTuiConfig(text);
112 } catch {
113 throw new TuiConfigParseError(DEFAULT_TUI_CONFIG);
114 }
115}
116
117export function parseTuiConfig(tomlText: string): TuiConfig {
118 if (tomlText.trim().length === 0) {

Callers 5

config.test.tsFile · 0.90
handleReloadTuiCommandFunction · 0.90
handleReloadCommandFunction · 0.90
runShellFunction · 0.90
shouldAutoInstallUpdatesFunction · 0.90

Calls 4

getTuiConfigPathFunction · 0.85
saveTuiConfigFunction · 0.85
parseTuiConfigFunction · 0.85
readFileFunction · 0.50

Tested by

no test coverage detected