MCPcopy
hub / github.com/lingodotdev/lingo.dev / _loadSystemFile

Function _loadSystemFile

packages/cli/src/cli/utils/settings.ts:117–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115}
116
117function _loadSystemFile() {
118 const settingsFilePath = _getSettingsFilePath();
119 const content = fs.existsSync(settingsFilePath)
120 ? fs.readFileSync(settingsFilePath, "utf-8")
121 : "";
122 const data = Ini.parse(content);
123
124 return Z.looseObject({
125 auth: Z.looseObject({
126 apiKey: Z.string().optional(),
127 apiUrl: Z.string().optional(),
128 webUrl: Z.string().optional(),
129 vnext: Z.object({
130 apiKey: Z.string().optional(),
131 }).optional(),
132 }).optional(),
133 llm: Z.looseObject({
134 openaiApiKey: Z.string().optional(),
135 anthropicApiKey: Z.string().optional(),
136 groqApiKey: Z.string().optional(),
137 googleApiKey: Z.string().optional(),
138 openrouterApiKey: Z.string().optional(),
139 mistralApiKey: Z.string().optional(),
140 }).optional(),
141 }).parse(data);
142}
143
144function _saveSystemFile(settings: CliSettings) {
145 const settingsFilePath = _getSettingsFilePath();

Callers 3

getSettingsFunction · 0.85
loadSystemSettingsFunction · 0.85
_envVarsInfoFunction · 0.85

Calls 2

_getSettingsFilePathFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected