From 9962f3ca0d9cddf6410e72f354fb1dbd89e500fa Mon Sep 17 00:00:00 2001 From: Brian Madison Date: Mon, 27 Apr 2026 22:53:50 -0500 Subject: [PATCH] fix(installer): close --tools "" bypass and drop hardcoded tool count - Replace truthy `if (options.tools)` guard with `!== undefined` in both upgrade and fresh-install branches. Empty string now reaches _parseToolsFlag and produces the specific "passed empty" error instead of falling through to a generic message (fresh-install) or being silently ignored (existing-install). - Drop the hardcoded "42 supported tools" count from the prereqs in install-bmad.md so the doc doesn't drift as platform-codes.yaml changes. Addresses augment / coderabbit review on #2346. --- docs/how-to/install-bmad.md | 2 +- tools/installer/ui.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/how-to/install-bmad.md b/docs/how-to/install-bmad.md index b88f06279..6651143d6 100644 --- a/docs/how-to/install-bmad.md +++ b/docs/how-to/install-bmad.md @@ -18,7 +18,7 @@ Use `npx bmad-method install` to set up BMad in your project. One command handle - **Node.js** 20+ (the installer requires it) - **Git** (for cloning external modules) -- **An AI tool** such as Claude Code or Cursor (run `npx bmad-method install --list-tools` to see all 42 supported tools) +- **An AI tool** such as Claude Code or Cursor (run `npx bmad-method install --list-tools` to see all supported tools) ::: diff --git a/tools/installer/ui.js b/tools/installer/ui.js index 904fe7e51..1200c37ea 100644 --- a/tools/installer/ui.js +++ b/tools/installer/ui.js @@ -469,7 +469,9 @@ class UI { const allTools = [...preferredIdes, ...otherIdes]; // Non-interactive: handle --tools and --yes flags before interactive prompt - if (options.tools) { + // Use !== undefined so an explicit --tools "" falls through to _parseToolsFlag and + // gets a specific "passed empty" error instead of being silently ignored. + if (options.tools !== undefined) { const selectedIdes = this._parseToolsFlag(options.tools, allKnownValues); await prompts.log.info(`Using tools from command-line: ${selectedIdes.join(', ')}`); await this.displaySelectedTools(selectedIdes, preferredIdes, allTools); @@ -546,8 +548,9 @@ class UI { let selectedIdes = []; - // Check if tools are provided via command-line - if (options.tools) { + // Check if tools are provided via command-line. + // Use !== undefined so an explicit --tools "" still hits _parseToolsFlag's empty-value error. + if (options.tools !== undefined) { selectedIdes = this._parseToolsFlag(options.tools, allKnownValues); await prompts.log.info(`Using tools from command-line: ${selectedIdes.join(', ')}`); await this.displaySelectedTools(selectedIdes, preferredIdes, allTools);