MCPcopy Create free account
hub / github.com/RomanHotsiy/commitgpt / promptToken

Function promptToken

config.ts:4–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { getConfig, setGlobalConfig } from "./config_storage.js";
3
4async function promptToken() {
5 try {
6 const answer = await enquirer.prompt<{ apikey: string }>({
7 type: "password",
8 name: "apikey",
9 message: "Paste your OpenAI apikey here:",
10 });
11
12 return answer.apikey;
13 } catch (e) {
14 console.log("Aborted.");
15 process.exit(1);
16 }
17}
18
19export async function getApiKey(clean?: boolean): Promise<string> {
20 let apiKey = getConfig<string | undefined>("apiKey");

Callers 1

getApiKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected