maestro-bundle 1.2.1 → 1.3.0

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/package.json +1 -1
  2. package/src/cli.mjs +29 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maestro-bundle",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Instala bundles de governança para projetos com AI agents. Um comando, tudo configurado.",
5
5
  "bin": {
6
6
  "maestro-bundle": "./src/cli.mjs"
package/src/cli.mjs CHANGED
@@ -332,34 +332,33 @@ async function main() {
332
332
  const primaryEditor = editorsToInstall[0];
333
333
  const aiFlag = aiFlags[primaryEditor] || "claude";
334
334
 
335
- // 4a. Instalar specify-cli se não tiver
336
- const spinner4 = ora("Verificando GitHub Spec Kit (specify-cli)").start();
335
+ // 4a. Instalar specify-cli
336
+ const SPECKIT_VERSION = "v0.4.3";
337
+ const spinner4 = ora("Instalando GitHub Spec Kit (specify-cli)").start();
337
338
  let specifyInstalled = false;
339
+
340
+ // Verificar se já está instalado (specify não aceita --version, usar --help)
338
341
  try {
339
- execSync("specify --version", { stdio: "ignore" });
342
+ execSync("specify --help", { stdio: "ignore" });
340
343
  specifyInstalled = true;
341
344
  spinner4.succeed("specify-cli já instalado");
342
345
  } catch {
343
- spinner4.info("specify-cli não encontrado");
344
- const spinner4b = ora("Instalando specify-cli...").start();
346
+ // Não instalado — instalar
345
347
  try {
346
- const SPECKIT_VERSION = "v0.4.3";
347
- execSync(`uv tool install specify-cli --from git+https://github.com/github/spec-kit.git@${SPECKIT_VERSION}`, {
348
- stdio: "ignore", timeout: 120000,
348
+ execSync(`uv tool install specify-cli --from "git+https://github.com/github/spec-kit.git@${SPECKIT_VERSION}"`, {
349
+ stdio: "pipe", timeout: 120000,
349
350
  });
350
351
  specifyInstalled = true;
351
- spinner4b.succeed(`specify-cli ${SPECKIT_VERSION} instalado`);
352
- } catch {
352
+ spinner4.succeed(`specify-cli ${SPECKIT_VERSION} instalado`);
353
+ } catch (err) {
354
+ // Pode já estar instalado mas uv retorna erro, checar de novo
353
355
  try {
354
- const SPECKIT_VERSION = "v0.4.3";
355
- execSync(`pip install specify-cli --src git+https://github.com/github/spec-kit.git@${SPECKIT_VERSION}`, {
356
- stdio: "ignore", timeout: 60000,
357
- });
356
+ execSync("specify --help", { stdio: "ignore" });
358
357
  specifyInstalled = true;
359
- spinner4b.succeed("specify-cli instalado via pip");
358
+ spinner4.succeed("specify-cli instalado");
360
359
  } catch {
361
- spinner4b.warn("Não foi possível instalar. Instale manualmente:");
362
- console.log(chalk.dim(" uv tool install specify-cli --from git+https://github.com/github/spec-kit.git@v0.4.3"));
360
+ spinner4.warn("Não foi possível instalar. Rode manualmente:");
361
+ console.log(chalk.dim(` uv tool install specify-cli --from "git+https://github.com/github/spec-kit.git@${SPECKIT_VERSION}"`));
363
362
  }
364
363
  }
365
364
  }
@@ -369,14 +368,22 @@ async function main() {
369
368
  const spinner4c = ora(`Inicializando Spec Kit no projeto (--ai ${aiFlag})`).start();
370
369
  const specifyEnv = { ...process.env, PYTHONIOENCODING: "utf-8", PYTHONUTF8: "1" };
371
370
  let specInitOk = false;
371
+
372
+ // Precisa de "y" piped pois specify pede confirmação se dir não vazio
373
+ // Usar --script sh para evitar dependência de pwsh no Windows
372
374
  const initCmds = [
373
- `specify init --here --ai ${aiFlag}`,
374
- `specify init . --ai ${aiFlag}`,
375
- `specify init --here --ai ${aiFlag} --no-git`,
375
+ `echo y | specify init . --ai ${aiFlag} --script sh`,
376
+ `echo y | specify init . --ai ${aiFlag}`,
376
377
  ];
377
378
  for (const cmd of initCmds) {
378
379
  try {
379
- execSync(cmd, { stdio: "ignore", timeout: 30000, cwd: targetDir, env: specifyEnv });
380
+ execSync(cmd, {
381
+ stdio: "pipe",
382
+ timeout: 60000,
383
+ cwd: targetDir,
384
+ env: specifyEnv,
385
+ shell: true,
386
+ });
380
387
  specInitOk = true;
381
388
  break;
382
389
  } catch { /* try next */ }
@@ -386,7 +393,7 @@ async function main() {
386
393
  } else {
387
394
  spinner4c.warn("Inicialize manualmente no terminal:");
388
395
  console.log(chalk.dim(` cd ${targetDir}`));
389
- console.log(chalk.dim(` specify init --here --ai ${aiFlag}`));
396
+ console.log(chalk.dim(` specify init . --ai ${aiFlag} --script sh`));
390
397
  }
391
398
 
392
399
  // 4c. Copiar constitution.md do bundle para dentro do .specify/memory/