From 155f9591eabd089f2a7bf0b1822d4dd169669eed Mon Sep 17 00:00:00 2001 From: Hau Vo Date: Wed, 3 Sep 2025 00:16:26 +0700 Subject: [PATCH] feat: Add Auggie CLI (Augment Code) Integration (#520) * feat: add Augment Code IDE support with multi-location installation options - Add Augment Code to supported IDE list in installer CLI and interactive prompts - Configure multi-location setup for Augment Code commands: - User Commands: ~/.augment/commands/bmad/ (global, user-wide) - Workspace Commands: ./.augment/commands/bmad/ (project-specific, team-shared) - Update IDE configuration with proper location handling and tilde expansion - Add interactive prompt for users to select installation locations - Update documentation in bmad-kb.md to include Augment Code in supported IDEs - Implement setupAugmentCode method with location selection and file installation This enables BMAD Method integration with Augment Code's custom command system, allowing users to access BMad agents via /agent-name slash commands in both global and project-specific contexts. * Added options to choose the rule locations * Update instruction to match with namespace for commands * Update instruction to match with namespace for commands * Renamed Augment Code to Auggie CLI (Augment Code) --------- Co-authored-by: Hau Vo Co-authored-by: Brian --- bmad-core/data/bmad-kb.md | 1 + tools/installer/bin/bmad.js | 35 +++++++- tools/installer/config/install.config.yaml | 19 +++++ tools/installer/lib/ide-setup.js | 93 ++++++++++++++++++++++ tools/installer/lib/installer.js | 7 +- 5 files changed, 153 insertions(+), 2 deletions(-) diff --git a/bmad-core/data/bmad-kb.md b/bmad-core/data/bmad-kb.md index 04d3b5f9..47d5cb6c 100644 --- a/bmad-core/data/bmad-kb.md +++ b/bmad-core/data/bmad-kb.md @@ -102,6 +102,7 @@ npx bmad-method install - **Cline**: VS Code extension with AI features - **Roo Code**: Web-based IDE with agent support - **GitHub Copilot**: VS Code extension with AI peer programming assistant + - **Auggie CLI (Augment Code)**: AI-powered development environment **Note for VS Code Users**: BMAD-METHOD™ assumes when you mention "VS Code" that you're using it with an AI-powered extension like GitHub Copilot, Cline, or Roo. Standard VS Code without AI capabilities cannot run BMad agents. The installer includes built-in support for Cline and Roo. diff --git a/tools/installer/bin/bmad.js b/tools/installer/bin/bmad.js index fba56533..f121417b 100755 --- a/tools/installer/bin/bmad.js +++ b/tools/installer/bin/bmad.js @@ -49,7 +49,7 @@ program .option('-d, --directory ', 'Installation directory') .option( '-i, --ide ', - 'Configure for specific IDE(s) - can specify multiple (cursor, claude-code, windsurf, trae, roo, kilo, cline, gemini, qwen-code, github-copilot, codex, codex-web, other)', + 'Configure for specific IDE(s) - can specify multiple (cursor, claude-code, windsurf, trae, roo, kilo, cline, gemini, qwen-code, github-copilot, codex, codex-web, auggie-cli, other)', ) .option( '-e, --expansion-packs ', @@ -406,6 +406,7 @@ async function promptInstallation() { { name: 'Qwen Code', value: 'qwen-code' }, { name: 'Crush', value: 'crush' }, { name: 'Github Copilot', value: 'github-copilot' }, + { name: 'Auggie CLI (Augment Code)', value: 'auggie-cli' }, { name: 'Codex CLI', value: 'codex' }, { name: 'Codex Web', value: 'codex-web' }, ], @@ -476,6 +477,38 @@ async function promptInstallation() { answers.githubCopilotConfig = { configChoice }; } + // Configure Auggie CLI (Augment Code) immediately if selected + if (ides.includes('auggie-cli')) { + console.log(chalk.cyan('\n📍 Auggie CLI Location Configuration')); + console.log(chalk.dim('Choose where to install BMad agents for Auggie CLI access.\n')); + + const { selectedLocations } = await inquirer.prompt([ + { + type: 'checkbox', + name: 'selectedLocations', + message: 'Select Auggie CLI command locations:', + choices: [ + { + name: 'User Commands (Global): Available across all your projects (user-wide)', + value: 'user', + }, + { + name: 'Workspace Commands (Project): Stored in repository, shared with team', + value: 'workspace', + }, + ], + validate: (selected) => { + if (selected.length === 0) { + return 'Please select at least one location'; + } + return true; + }, + }, + ]); + + answers.augmentCodeConfig = { selectedLocations }; + } + // Ask for web bundles installation const { includeWebBundles } = await inquirer.prompt([ { diff --git a/tools/installer/config/install.config.yaml b/tools/installer/config/install.config.yaml index e929b722..0444813a 100644 --- a/tools/installer/config/install.config.yaml +++ b/tools/installer/config/install.config.yaml @@ -122,6 +122,25 @@ ide-configurations: # 3. Simply mention the agent in your prompt (e.g., "As *dev, ..."). # 4. The Qwen Code CLI will automatically have the context for that agent. + auggie-cli: + name: Auggie CLI (Augment Code) + format: multi-location + locations: + user: + name: User Commands (Global) + rule-dir: ~/.augment/commands/bmad/ + description: Available across all your projects (user-wide) + workspace: + name: Workspace Commands (Project) + rule-dir: ./.augment/commands/bmad/ + description: Stored in your repository and shared with your team + command-suffix: .md + instructions: | + # To use BMad agents in Auggie CLI (Augment Code): + # 1. Type /bmad:agent-name (e.g., "/bmad:dev", "/bmad:pm", "/bmad:architect") + # 2. The agent will adopt that persona for the conversation + # 3. Commands are available based on your selected location(s) + codex: name: Codex CLI format: project-memory diff --git a/tools/installer/lib/ide-setup.js b/tools/installer/lib/ide-setup.js index 2dd33302..a0ff58c7 100644 --- a/tools/installer/lib/ide-setup.js +++ b/tools/installer/lib/ide-setup.js @@ -74,6 +74,9 @@ class IdeSetup extends BaseIdeSetup { case 'qwen-code': { return this.setupQwenCode(installDir, selectedAgent); } + case 'auggie-cli': { + return this.setupAuggieCLI(installDir, selectedAgent, spinner, preConfiguredSettings); + } case 'codex': { return this.setupCodex(installDir, selectedAgent, { webEnabled: false }); } @@ -1611,6 +1614,96 @@ tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems console.log(chalk.dim('')); console.log(chalk.dim('You can modify these settings anytime in .vscode/settings.json')); } + + async setupAuggieCLI(installDir, selectedAgent, spinner = null, preConfiguredSettings = null) { + const os = require('node:os'); + const inquirer = require('inquirer'); + const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); + + // Get the IDE configuration to access location options + const ideConfig = await configLoader.getIdeConfiguration('auggie-cli'); + const locations = ideConfig.locations; + + // Use pre-configured settings if provided, otherwise prompt + let selectedLocations; + if (preConfiguredSettings && preConfiguredSettings.selectedLocations) { + selectedLocations = preConfiguredSettings.selectedLocations; + console.log( + chalk.dim( + `Using pre-configured Auggie CLI (Augment Code) locations: ${selectedLocations.join(', ')}`, + ), + ); + } else { + // Pause spinner during location selection to avoid UI conflicts + let spinnerWasActive = false; + if (spinner && spinner.isSpinning) { + spinner.stop(); + spinnerWasActive = true; + } + + // Clear any previous output and add spacing to avoid conflicts with loaders + console.log('\n'.repeat(2)); + console.log(chalk.blue('📍 Auggie CLI Location Configuration')); + console.log(chalk.dim('Choose where to install BMad agents for Auggie CLI access.')); + console.log(''); // Add extra spacing + + const response = await inquirer.prompt([ + { + type: 'checkbox', + name: 'selectedLocations', + message: 'Select Auggie CLI command locations:', + choices: Object.entries(locations).map(([key, location]) => ({ + name: `${location.name}: ${location.description}`, + value: key, + })), + validate: (selected) => { + if (selected.length === 0) { + return 'Please select at least one location'; + } + return true; + }, + }, + ]); + selectedLocations = response.selectedLocations; + + // Restart spinner if it was active before prompts + if (spinner && spinnerWasActive) { + spinner.start(); + } + } + + // Install to each selected location + for (const locationKey of selectedLocations) { + const location = locations[locationKey]; + let commandsDir = location['rule-dir']; + + // Handle tilde expansion for user directory + if (commandsDir.startsWith('~/')) { + commandsDir = path.join(os.homedir(), commandsDir.slice(2)); + } else if (commandsDir.startsWith('./')) { + commandsDir = path.join(installDir, commandsDir.slice(2)); + } + + await fileManager.ensureDirectory(commandsDir); + + for (const agentId of agents) { + // Find the agent file + const agentPath = await this.findAgentPath(agentId, installDir); + + if (agentPath) { + const agentContent = await fileManager.readFile(agentPath); + const mdPath = path.join(commandsDir, `${agentId}.md`); + await fileManager.writeFile(mdPath, agentContent); + console.log(chalk.green(`✓ Created command: ${agentId}.md in ${location.name}`)); + } + } + + console.log(chalk.green(`\n✓ Created Auggie CLI commands in ${commandsDir}`)); + console.log(chalk.dim(` Location: ${location.name} - ${location.description}`)); + } + + return true; + } } module.exports = new IdeSetup(); diff --git a/tools/installer/lib/installer.js b/tools/installer/lib/installer.js index e709b4cf..8b7e9d8d 100644 --- a/tools/installer/lib/installer.js +++ b/tools/installer/lib/installer.js @@ -408,7 +408,12 @@ class Installer { if (ides.length > 0) { for (const ide of ides) { spinner.text = `Setting up ${ide} integration...`; - const preConfiguredSettings = ide === 'github-copilot' ? config.githubCopilotConfig : null; + let preConfiguredSettings = null; + if (ide === 'github-copilot') { + preConfiguredSettings = config.githubCopilotConfig; + } else if (ide === 'auggie-cli') { + preConfiguredSettings = config.augmentCodeConfig; + } await ideSetup.setup(ide, installDir, config.agent, spinner, preConfiguredSettings); } }