diff --git a/tools/cli/commands/install.js b/tools/cli/commands/install.js index 76bbde0b..9b403478 100644 --- a/tools/cli/commands/install.js +++ b/tools/cli/commands/install.js @@ -84,6 +84,9 @@ module.exports = { // Run AgentVibes installer const { execSync } = require('node:child_process'); + const fs = require('node:fs'); + const path = require('node:path'); + try { // Clear ALL npm config env vars to prevent inheritance issues // when BMAD is invoked with --prefix flag @@ -92,7 +95,12 @@ module.exports = { Object.entries(process.env).filter(([key]) => !key.startsWith('npm_config_') && !key.startsWith('npm_package_')), ); - execSync('npx agentvibes@latest install', { + // Check if this is first-time AgentVibes installation + const agentvibesDir = path.join(result.projectDir, '.agentvibes'); + const isFirstTime = !fs.existsSync(agentvibesDir); + const installCmd = isFirstTime ? 'npx agentvibes@latest install --with-audio' : 'npx agentvibes@latest install'; + + execSync(installCmd, { cwd: result.projectDir, stdio: 'inherit', shell: true,