@codebakers/cli 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -155,15 +155,17 @@ function setupCommand(program2) {
155
155
  const validation = await validateApiKey(apiKey);
156
156
  if (!validation.valid) {
157
157
  spinner.fail("API key validation failed");
158
- if (validation.error?.includes("Invalid API key")) {
158
+ const errLower = validation.error?.toLowerCase() || "";
159
+ if (errLower.includes("invalid api key") || validation.error === "HTTP 401") {
159
160
  console.log(chalk.red("\nInvalid API key."));
160
161
  console.log(chalk.dim("Get your key at: https://codebakers.ai/dashboard"));
161
- } else if (validation.error?.includes("fetch") || validation.error?.includes("ENOTFOUND")) {
162
+ } else if (errLower.includes("enotfound") || errLower.includes("econnrefused") || errLower.includes("unable to connect")) {
162
163
  console.log(chalk.red("\nCould not connect to CodeBakers API."));
163
164
  console.log(chalk.dim("Check your internet connection and try again."));
165
+ console.log(chalk.dim(`Details: ${validation.error}`));
164
166
  } else {
165
167
  console.log(chalk.red(`
166
- Error: ${validation.error || "Unknown error"}`));
168
+ Validation failed: ${validation.error || "Unknown error"}`));
167
169
  console.log(chalk.dim("Get your key at: https://codebakers.ai/dashboard"));
168
170
  }
169
171
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebakers/cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "CodeBakers CLI - AI prompt patterns for production-ready code",
5
5
  "main": "dist/index.js",
6
6
  "bin": {