MCPcopy Create free account
hub / github.com/thesysdev/openui / writeChatEnv

Function writeChatEnv

packages/openui-cli/src/commands/create-app.ts:161–170  ·  view source on GitHub ↗
(targetDir: string, interactive: boolean)

Source from the content-addressed store, hash-verified

159}
160
161async function writeChatEnv(targetDir: string, interactive: boolean): Promise<boolean> {
162 if (!interactive) return false;
163 const { input } = await import("@inquirer/prompts");
164 const apiKey = (
165 await input({ message: "Enter your OpenAI API key (leave blank to skip):" })
166 ).trim();
167 if (!apiKey) return false;
168 fs.writeFileSync(path.join(targetDir, ".env"), `OPENAI_API_KEY=${apiKey}\n`);
169 return true;
170}
171
172async function writeCloudEnv(
173 targetDir: string,

Callers 1

runCreateAppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected