@vocoder/cli 0.1.22 → 0.1.24

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/bin.mjs CHANGED
@@ -3600,17 +3600,22 @@ async function sync(options = {}) {
3600
3600
  }
3601
3601
  if (error instanceof Error) {
3602
3602
  p8.log.error(error.message);
3603
- if (error.message.includes("VOCODER_API_KEY")) {
3603
+ const isInvalidKey = error.message.toLowerCase().includes("invalid api key") || error instanceof VocoderAPIError && error.status === 401;
3604
+ if (isInvalidKey) {
3604
3605
  p8.log.warn(
3605
- "VOCODER_API_KEY is only needed for `vocoder sync` (CLI push)."
3606
+ "API key rejected \u2014 the project may have been deleted or the key revoked."
3606
3607
  );
3607
- p8.log.info(" Create one at: https://vocoder.app/dashboard");
3608
- p8.log.info(' Then: export VOCODER_API_KEY="vc_..." or add it to .env');
3608
+ p8.log.info(
3609
+ " Run `npx @vocoder/cli init` to create a new project and key."
3610
+ );
3611
+ } else if (error.message.includes("VOCODER_API_KEY")) {
3612
+ p8.log.info(" Get an API key at: https://vocoder.app/dashboard");
3613
+ p8.log.info(' Then add to .env: VOCODER_API_KEY="vcp_..."');
3609
3614
  p8.log.info("");
3610
3615
  p8.log.info(
3611
- " Note: If you use @vocoder/unplugin, `vocoder sync` is optional."
3616
+ " Note: if you use @vocoder/unplugin, `vocoder sync` is optional \u2014"
3612
3617
  );
3613
- p8.log.info(" Translations are fetched automatically at build time.");
3618
+ p8.log.info(" translations are fetched automatically at build time.");
3614
3619
  } else if (error.message.includes("git branch")) {
3615
3620
  p8.log.warn("Run from a git repository, or use:");
3616
3621
  p8.log.info(" vocoder sync --branch main");