MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / writeAuthProfile

Function writeAuthProfile

packages/config/src/auth-profiles.ts:86–97  ·  view source on GitHub ↗
(name: string, profile: AuthProfile)

Source from the content-addressed store, hash-verified

84 * 写入/更新一个 auth profile
85 */
86export function writeAuthProfile(name: string, profile: AuthProfile): void {
87 const configDir = getConfigDir()
88 if (!fs.existsSync(configDir)) {
89 fs.mkdirSync(configDir, { recursive: true })
90 }
91
92 const data = loadAuthProfiles()
93 data.profiles[name] = profile
94
95 const filePath = getAuthProfilesPath()
96 fs.writeFileSync(filePath, JSON.stringify(data, null, 2), { encoding: 'utf-8', mode: 0o600 })
97}
98
99/**
100 * 删除一个 auth profile

Callers 7

upFunction · 0.90
startInternalServerFunction · 0.90
addConfigFunction · 0.90
updateConfigFunction · 0.90
startHttpServerFunction · 0.90
addLlmConfigFunction · 0.90
updateLlmConfigFunction · 0.90

Calls 3

getConfigDirFunction · 0.90
loadAuthProfilesFunction · 0.85
getAuthProfilesPathFunction · 0.85

Tested by

no test coverage detected