Skip to content

Commit b509fb9

Browse files
authored
bump version to 6.0.0-alpha.21 and enhance stdin handling for Windows in CLI (#1200)
1 parent e0090e5 commit b509fb9

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/cli/bmad-cli.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@ const { program } = require('commander');
22
const path = require('node:path');
33
const fs = require('node:fs');
44

5+
// Fix for stdin issues when running through npm on Windows
6+
// Ensures keyboard interaction works properly with inquirer prompts
7+
if (process.stdin.isTTY) {
8+
try {
9+
process.stdin.resume();
10+
process.stdin.setEncoding('utf8');
11+
12+
// On Windows, explicitly reference the stdin stream to ensure it's properly initialized
13+
if (process.platform === 'win32') {
14+
process.stdin.on('error', () => {
15+
// Ignore stdin errors - they can occur when the terminal is closing
16+
});
17+
}
18+
} catch {
19+
// Silently ignore - some environments may not support these operations
20+
}
21+
}
22+
523
// Load package.json from root for version info
624
const packageJson = require('../../package.json');
725

tools/cli/commands/install.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const chalk = require('chalk');
22
const path = require('node:path');
3+
const inquirer = require('inquirer');
34
const { Installer } = require('../installers/lib/core/installer');
45
const { UI } = require('../lib/ui');
56

@@ -65,18 +66,13 @@ module.exports = {
6566
console.log(chalk.dim(' • ElevenLabs AI (150+ premium voices)'));
6667
console.log(chalk.dim(' • Piper TTS (50+ free voices)\n'));
6768

68-
const readline = require('node:readline');
69-
const rl = readline.createInterface({
70-
input: process.stdin,
71-
output: process.stdout,
72-
});
73-
74-
await new Promise((resolve) => {
75-
rl.question(chalk.green('Press Enter to start AgentVibes installer...'), () => {
76-
rl.close();
77-
resolve();
78-
});
79-
});
69+
await inquirer.prompt([
70+
{
71+
type: 'input',
72+
name: 'continue',
73+
message: chalk.green('Press Enter to start AgentVibes installer...'),
74+
},
75+
]);
8076

8177
console.log('');
8278

0 commit comments

Comments
 (0)