@codebakers/cli 1.0.10 → 1.0.11
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/dist/index.js +12 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -63,7 +63,13 @@ async function validateApiKey(apiKey) {
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
if (response.ok) {
|
|
66
|
-
|
|
66
|
+
try {
|
|
67
|
+
const data = await response.json();
|
|
68
|
+
const user = data.user;
|
|
69
|
+
return { valid: true, userName: user?.name || void 0 };
|
|
70
|
+
} catch {
|
|
71
|
+
return { valid: true };
|
|
72
|
+
}
|
|
67
73
|
}
|
|
68
74
|
try {
|
|
69
75
|
const data = await response.json();
|
|
@@ -172,6 +178,7 @@ Validation failed: ${validation.error || "Unknown error"}`));
|
|
|
172
178
|
}
|
|
173
179
|
process.exit(1);
|
|
174
180
|
}
|
|
181
|
+
const userName = validation.userName;
|
|
175
182
|
spinner.succeed("API key validated");
|
|
176
183
|
setApiKey(apiKey);
|
|
177
184
|
console.log(chalk.green("\n\u2713 API key saved\n"));
|
|
@@ -196,9 +203,12 @@ Validation failed: ${validation.error || "Unknown error"}`));
|
|
|
196
203
|
if (ide) {
|
|
197
204
|
await configureIDE(ide, options.force);
|
|
198
205
|
}
|
|
206
|
+
const firstName = userName?.split(" ")[0];
|
|
207
|
+
const greeting = firstName ? `${firstName}, you're` : "You're";
|
|
199
208
|
console.log(chalk.bold.green("\n\u{1F389} Setup complete!\n"));
|
|
200
209
|
if (ide === "claude-code") {
|
|
201
|
-
console.log(chalk.green(
|
|
210
|
+
console.log(chalk.green(`\u2713 ${greeting} ready to build!
|
|
211
|
+
`));
|
|
202
212
|
console.log(chalk.bold("You say:"));
|
|
203
213
|
console.log(chalk.cyan(' "Add a contact form"\n'));
|
|
204
214
|
console.log(chalk.bold("CodeBakers generates:"));
|