@albinberisha/codex-cli
Version:
Codex cli to scaffold plugins with Node
19 lines (17 loc) • 526 B
JavaScript
import inquirer from 'inquirer';
export async function getApiKey() {
const res = await inquirer.prompt(
{
type: 'string',
name: 'apiKey',
message: `Please enter an API Key for Environment - ${process.env.ENVIRONMENT}: `,
validate: (input) => {
if (input.length < 3) {
return "Please enter a valid API Key";
}
return true;
},
}
);
return res.apiKey;
}