MCPcopy Index your code
hub / github.com/CommandCodeAI/BaseAI / createEnvBaseAIExample

Function createEnvBaseAIExample

packages/baseai/src/init/index.ts:269–313  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

267}
268
269async function createEnvBaseAIExample(): Promise<void> {
270 const envBaseAIExamplePath = path.join(
271 process.cwd(),
272 '.env.baseai.example'
273 );
274 const envBaseAIExampleContent = `# !! SERVER SIDE ONLY !!
275# Keep all your API keys secret — use only on the server side.
276
277# TODO: ADD: Both in your production and local env files.
278# Langbase API key for your User or Org account.
279# How to get this API key https://langbase.com/docs/api-reference/api-keys
280LANGBASE_API_KEY=
281
282# TODO: ADD: LOCAL ONLY. Add only to local env files.
283# Following keys are needed for local pipe runs. For providers you are using.
284# For Langbase, please add the key to your LLM keysets.
285# Read more: Langbase LLM Keysets https://langbase.com/docs/features/keysets
286OPENAI_API_KEY=
287ANTHROPIC_API_KEY=
288COHERE_API_KEY=
289FIREWORKS_API_KEY=
290GOOGLE_API_KEY=
291GROQ_API_KEY=
292MISTRAL_API_KEY=
293PERPLEXITY_API_KEY=
294TOGETHER_API_KEY=
295XAI_API_KEY=
296`;
297
298 try {
299 const exists = await checkFileExists(envBaseAIExamplePath);
300 if (!exists) {
301 await fs.writeFile(envBaseAIExamplePath, envBaseAIExampleContent);
302 // p.log.success('Created `.env.baseai.example` file.');
303 } else {
304 // p.log.info(
305 // '`.env.baseai.example` file already exists. Skipping creation.'
306 // );
307 }
308 } catch (error) {
309 p.log.error(
310 `Error creating .env.baseai.example: Check the example env file here https://github.com/LangbaseInc/baseai/blob/main/.env.baseai.example\n Error: ${error instanceof Error ? error.message : String(error)}`
311 );
312 }
313}
314
315export async function init({
316 calledAsCommand = false,

Callers 1

initFunction · 0.85

Calls 1

checkFileExistsFunction · 0.85

Tested by

no test coverage detected