- Fix manifest reading to use manifest.yaml instead of manifest.csv - Show previously configured IDEs as selected by default in UI - Skip configuration prompts for already configured IDEs during updates - Properly collect IDE configurations during full reinstall - Handle installation cancellation without throwing errors
62 lines
2.1 KiB
JavaScript
62 lines
2.1 KiB
JavaScript
const chalk = require('chalk');
|
|
const path = require('node:path');
|
|
const { Installer } = require('../installers/lib/core/installer');
|
|
const { UI } = require('../lib/ui');
|
|
|
|
const installer = new Installer();
|
|
const ui = new UI();
|
|
|
|
module.exports = {
|
|
command: 'install',
|
|
description: 'Install BMAD Core agents and tools',
|
|
options: [],
|
|
action: async () => {
|
|
try {
|
|
const config = await ui.promptInstall();
|
|
|
|
// Handle agent compilation separately
|
|
if (config.actionType === 'compile') {
|
|
const result = await installer.compileAgents(config);
|
|
console.log(chalk.green('\n✨ Agent compilation complete!'));
|
|
console.log(chalk.cyan(`Rebuilt ${result.agentCount} agents and ${result.taskCount} tasks`));
|
|
process.exit(0);
|
|
return;
|
|
}
|
|
|
|
// Regular install/update flow
|
|
const result = await installer.install(config);
|
|
|
|
// Check if installation was cancelled
|
|
if (result && result.cancelled) {
|
|
process.exit(0);
|
|
return;
|
|
}
|
|
|
|
// Check if installation succeeded
|
|
if (result && result.success) {
|
|
console.log(chalk.green('\n✨ Installation complete!'));
|
|
console.log(
|
|
chalk.cyan('BMAD Core and Selected Modules have been installed to:'),
|
|
chalk.bold(result.path || path.resolve(config.directory, 'bmad')),
|
|
);
|
|
console.log(chalk.yellow('\nThank you for helping test the early release version of the new BMad Core and BMad Method!'));
|
|
console.log(chalk.cyan('Check docs/alpha-release-notes.md in this repository for important information.'));
|
|
process.exit(0);
|
|
}
|
|
} catch (error) {
|
|
// Check if error has a complete formatted message
|
|
if (error.fullMessage) {
|
|
console.error(error.fullMessage);
|
|
if (error.stack) {
|
|
console.error('\n' + chalk.dim(error.stack));
|
|
}
|
|
} else {
|
|
// Generic error handling for all other errors
|
|
console.error(chalk.red('Installation failed:'), error.message);
|
|
console.error(chalk.dim(error.stack));
|
|
}
|
|
process.exit(1);
|
|
}
|
|
},
|
|
};
|