MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / readCredentialsFile

Function readCredentialsFile

cli/src/utils/auth.ts:151–159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149
150/** Read existing credentials file, returns empty object if missing/invalid */
151const readCredentialsFile = (): Record<string, unknown> => {
152 const credentialsPath = getCredentialsPath()
153 if (!fs.existsSync(credentialsPath)) return {}
154 try {
155 return JSON.parse(fs.readFileSync(credentialsPath, 'utf8'))
156 } catch {
157 return {}
158 }
159}
160
161/**
162 * Save user credentials to file system.

Callers 2

saveUserCredentialsFunction · 0.85
clearUserCredentialsFunction · 0.85

Calls 2

parseMethod · 0.80
getCredentialsPathFunction · 0.70

Tested by

no test coverage detected