feat: add non-interactive installation support#1520
feat: add non-interactive installation support#1520bmadcode merged 4 commits intobmad-code-org:mainfrom
Conversation
676595e to
ce8a43a
Compare
📝 WalkthroughWalkthroughThis change adds non-interactive installation support to BMAD's CLI, introducing command-line flags for automated workflows. Updates include new documentation, expanded CLI options, and modified prompt logic to respect provided configuration values and skip interactive prompts when options are supplied. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ce8a43a to
29c26f5
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@tools/cli/lib/ui.js`:
- Around line 753-761: The code assumes os.userInfo() always succeeds when
computing defaultUsername; wrap the os.userInfo() call in a safe fallback: first
try calling os.userInfo() in a try/catch (or guard with typeof), fall back to
process.env.USER || process.env.USERNAME || 'User' if it throws or is undefined,
then compute defaultUsername by capitalizing the first character of that safe
username and assign it to configCollector.collectedConfig.core.user_name; ensure
the console message and existing keys (existingConfig,
configCollector.collectedConfig.core, defaultUsername) remain unchanged
otherwise.
- Around line 317-325: Wrap the module.yaml reading and parsing in a try/catch
to avoid crashes: around the logic that builds moduleYamlPath, reads moduleYaml
with fs.readFile and calls yaml.parse to produce moduleMeta, catch any errors
and log a graceful warning (using console.log/chalk.yellow) that includes the
customPath and the error message, then continue the loop instead of throwing;
ensure you reference moduleYamlPath, moduleYaml, yaml.parse and moduleMeta when
locating where to add the try/catch.
🧹 Nitpick comments (2)
tools/cli/lib/ui.js (2)
296-340: Code duplication: custom content parsing logic appears twice.The custom content parsing logic (splitting paths, validating, reading module.yaml, building config) is nearly identical here and in lines 407-448 for the new installation flow. Consider extracting this into a helper method to reduce duplication and ensure consistent behavior.
♻️ Suggested helper extraction
+ /** + * Parse custom content paths from command-line option + * `@param` {string} customContentOption - Comma-separated paths + * `@returns` {Object} Custom content config with paths and module IDs + */ + async parseCustomContentPaths(customContentOption) { + const paths = customContentOption + .split(',') + .map((p) => p.trim()) + .filter(Boolean); + console.log(chalk.cyan('Using custom content from command-line:'), chalk.bold(paths.join(', '))); + + const customPaths = []; + const selectedModuleIds = []; + + for (const customPath of paths) { + const expandedPath = this.expandUserPath(customPath); + const validation = this.validateCustomContentPathSync(expandedPath); + if (validation !== true) { + console.log(chalk.yellow(`⚠️ Skipping invalid custom content path: ${customPath} - ${validation}`)); + continue; + } + + try { + const moduleYamlPath = path.join(expandedPath, 'module.yaml'); + const moduleYaml = await fs.readFile(moduleYamlPath, 'utf-8'); + const yaml = require('yaml'); + const moduleMeta = yaml.parse(moduleYaml); + + if (!moduleMeta.code) { + console.log(chalk.yellow(`⚠️ Skipping custom content path: ${customPath} - module.yaml missing 'code' field`)); + continue; + } + + customPaths.push(expandedPath); + selectedModuleIds.push(moduleMeta.code); + } catch (error) { + console.log(chalk.yellow(`⚠️ Skipping custom content path: ${customPath} - ${error.message}`)); + } + } + + return { customPaths, selectedModuleIds }; + }
573-585: Consider validating tool IDs from command-line.When tools are provided via
--tools, invalid IDs are silently accepted. Per the documentation, the system should "warn about invalid tool IDs (but won't fail)". Adding validation here would improve user feedback.🔧 Optional validation
} else { selectedIdes = options.tools .split(',') .map((t) => t.trim()) .filter(Boolean); + + // Validate tool IDs and warn about invalid ones + const allValidTools = [...preferredIdes, ...otherIdes].map((ide) => ide.value); + const invalidTools = selectedIdes.filter((t) => !allValidTools.includes(t)); + if (invalidTools.length > 0) { + console.log(chalk.yellow(`⚠️ Unknown tool ID(s): ${invalidTools.join(', ')} (will be skipped)`)); + selectedIdes = selectedIdes.filter((t) => allValidTools.includes(t)); + } + console.log(chalk.cyan('Using tools from command-line:'), chalk.bold(selectedIdes.join(', '))); }
Add command-line flags to support non-interactive installation for CI/CD pipelines and automated deployments: - --directory: Installation directory - --modules: Comma-separated module IDs - --tools: Tool/IDE IDs (use "none" to skip) - --custom-content: Custom module paths - --action: Action type for existing installations - --user-name, --communication-language, --document-output-language, --output-folder: Core config - -y, --yes: Accept all defaults When flags are provided, prompts are skipped. Missing values gracefully fall back to interactive prompts.
29c26f5 to
c18944f
Compare
|
can you update this against the latest, would love to get this in - there is a conflict @wladimiiir |
Integrated non-interactive tool selection support with the new autocompleteMultiselect UI from main. Co-Authored-By: AiderDesk <https://github.com/hotovo/aider-desk>
- Fix validation checks using truthy instead of !== true - Add skipPrompts flag to skip module config prompts with --yes - Add getDefaultModules() for automatic module selection with --yes - Fix IDE selection to use array check instead of length check Co-Authored-By: AiderDesk <https://github.com/hotovo/aider-desk>
|
@bmadcode |
|
Thank you @wladimiiir this is a great add for the final release! Will run some more testing on it also |
* feat: add non-interactive installation support Add command-line flags to support non-interactive installation for CI/CD pipelines and automated deployments: - --directory: Installation directory - --modules: Comma-separated module IDs - --tools: Tool/IDE IDs (use "none" to skip) - --custom-content: Custom module paths - --action: Action type for existing installations - --user-name, --communication-language, --document-output-language, --output-folder: Core config - -y, --yes: Accept all defaults When flags are provided, prompts are skipped. Missing values gracefully fall back to interactive prompts. * fix: complete non-interactive installation support - Fix validation checks using truthy instead of !== true - Add skipPrompts flag to skip module config prompts with --yes - Add getDefaultModules() for automatic module selection with --yes - Fix IDE selection to use array check instead of length check Co-Authored-By: AiderDesk <https://github.com/hotovo/aider-desk> --------- Co-authored-by: Brian <bmadcode@gmail.com>
Summary
--tools noneto explicitly skip tool configurationNew CLI Options
--directory <path>--modules <modules>--tools <tools>--custom-content <paths>--action <type>--user-name <name>--communication-language <lang>--document-output-language <lang>--output-folder <path>-y, --yesExample Usage
Test plan
--tools none--yesflag🤖 Generated by AiderDesk