MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / getApiKey

Function getApiKey

scripts/auto-translate.mjs:77–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75}
76
77async function getApiKey() {
78 try {
79 const apiKey = await readFile("./ai-api.key", "utf8");
80 return apiKey;
81 } catch (error) {
82 console.error(
83 "Error reading API key, please create 'ai-api.key' file, and put your API key in it."
84 );
85 process.exit(1);
86 }
87}
88
89/**
90 * Translate a list of texts to a target language

Callers 1

checkAndFillMissingKeysFunction · 0.70

Calls 2

errorMethod · 0.80
exitMethod · 0.45

Tested by

no test coverage detected