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 <hauvo@Haus-Mac-mini.local>
Co-authored-by: Brian <bmadcode@gmail.com>
This commit is contained in:
Hau Vo
2025-09-03 00:16:26 +07:00
committed by GitHub
parent 6919049eae
commit 155f9591ea
5 changed files with 153 additions and 2 deletions

View File

@@ -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();

View File

@@ -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);
}
}