@vocoder/cli 0.1.24 → 0.1.25

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
@@ -3294,15 +3294,25 @@ async function sync(options = {}) {
3294
3294
  const startTime = Date.now();
3295
3295
  const projectRoot = process.cwd();
3296
3296
  p8.intro("Vocoder Sync");
3297
+ const mergedConfig = await getMergedConfig(options, options.verbose);
3298
+ if (!mergedConfig.apiKey) {
3299
+ p8.log.warn("No API key found. Run init to get started:");
3300
+ p8.log.info(" npx @vocoder/cli init");
3301
+ p8.log.info("");
3302
+ p8.log.info(
3303
+ " Or add your key to .env: VOCODER_API_KEY=vcp_..."
3304
+ );
3305
+ p8.outro("Run `npx @vocoder/cli init` to set up your project.");
3306
+ return 1;
3307
+ }
3297
3308
  const spinner4 = p8.spinner();
3298
3309
  try {
3299
3310
  spinner4.start("Detecting branch");
3300
3311
  const branch = detectBranch(options.branch);
3301
3312
  spinner4.stop(`Branch: ${chalk8.cyan(branch)}`);
3302
3313
  spinner4.start("Loading project configuration");
3303
- const mergedConfig = await getMergedConfig(options, options.verbose);
3304
3314
  const localConfig = {
3305
- apiKey: mergedConfig.apiKey || "",
3315
+ apiKey: mergedConfig.apiKey,
3306
3316
  apiUrl: mergedConfig.apiUrl || "https://vocoder.app"
3307
3317
  };
3308
3318
  validateLocalConfig(localConfig);
@@ -3608,14 +3618,6 @@ async function sync(options = {}) {
3608
3618
  p8.log.info(
3609
3619
  " Run `npx @vocoder/cli init` to create a new project and key."
3610
3620
  );
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_..."');
3614
- p8.log.info("");
3615
- p8.log.info(
3616
- " Note: if you use @vocoder/unplugin, `vocoder sync` is optional \u2014"
3617
- );
3618
- p8.log.info(" translations are fetched automatically at build time.");
3619
3621
  } else if (error.message.includes("git branch")) {
3620
3622
  p8.log.warn("Run from a git repository, or use:");
3621
3623
  p8.log.info(" vocoder sync --branch main");