@thebros/create-benjamin 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.js +15 -7
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -8,16 +8,24 @@ import inquirer from "inquirer";
|
|
|
8
8
|
import ora from "ora";
|
|
9
9
|
import OpenAI from "openai";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
let apiKey = process.env.OPENAI_API_KEY;
|
|
12
12
|
|
|
13
13
|
if (!apiKey) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const answer = await inquirer.prompt([
|
|
15
|
+
{
|
|
16
|
+
type: "password",
|
|
17
|
+
name: "key",
|
|
18
|
+
message: "Enter OpenAI API Key (or press enter to skip):",
|
|
19
|
+
},
|
|
20
|
+
]);
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
apiKey = answer.key;
|
|
23
|
+
|
|
24
|
+
if (!apiKey) {
|
|
25
|
+
console.log("⚠️ Running in template mode (no AI)");
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
21
29
|
async function main() {
|
|
22
30
|
console.log(chalk.cyan("\n🤖 Create Benjamin AI Project Generator\n"));
|
|
23
31
|
|