MCPcopy Create free account
hub / github.com/echoVic/blade-code / saveUserConfig

Function saveUserConfig

src/config/user-config.ts:60–73  ·  view source on GitHub ↗
(config: Partial<UserConfig>)

Source from the content-addressed store, hash-verified

58 * 保存用户配置
59 */
60export function saveUserConfig(config: Partial<UserConfig>): void {
61 try {
62 const currentConfig = getUserConfig();
63 const newConfig: UserConfig = {
64 ...currentConfig,
65 ...config,
66 lastUpdated: new Date().toISOString(),
67 };
68
69 writeFileSync(CONFIG_FILE_PATH, JSON.stringify(newConfig, null, 2));
70 } catch (error) {
71 throw new Error(`保存用户配置失败: ${error}`);
72 }
73}
74
75/**
76 * 设置当前 provider

Callers 3

setCurrentProviderFunction · 0.85
setCurrentModelFunction · 0.85
resetUserConfigFunction · 0.85

Calls 1

getUserConfigFunction · 0.85

Tested by

no test coverage detected