BMAD-METHOD/tools/installer
Brian Madison 9799d10123 fix(installer): address second-round code-review criticals
writeGlobalUserCore now line-surgery upserts only the [core] keys it owns
into the existing file content — no read-parse-merge-emit round-trip. Hand
edits in shapes the minimal parseSimpleToml dropped (arrays, single-quoted
strings, dotted/quoted keys, \uXXXX escapes, custom sections) survive
byte-for-byte. Dead emitTomlSections helper removed.

writeModuleTomls emits core's shipped defaults under top-level [core], not
nested [modules.core] — matches where writeCentralConfig writes core deltas
and where resolve_config.py consumers read core.* from.

tomlString auto-infers TOML type from --set values: true/false → bool,
integer pattern → int, decimal pattern → float, otherwise quoted string.
Explicit-string escape hatch: --set k='"true"' writes "true" as a string.
Previously every --set value was wrapped in quotes, so --set bmm.workers=4
wrote "4" and downstream numeric comparisons broke.

upsertTomlKey's inline-comment detector now tracks double-quoted string
state via findInlineCommentStart, so a # inside a basic-string value
(legal per the TOML spec, contrary to the previous defending comment)
is no longer truncated. tomlHasKey and upsertTomlKey both use a new
isSectionHeader matcher that tolerates trailing inline comments on the
header line and walks every section occurrence — fixes mis-routing on
hand-edited files with [core]  # comment headers or duplicate sections.

Python test harnesses (test_resolve_config.py, test_resolve_customization_cascade.py)
now force BMAD_HOME to the synthetic isolation path unconditionally
instead of env.get(BMAD_HOME, default), which was a no-op when the
developer had BMAD_HOME set in their shell.

Adds 21 JS assertions covering the new behaviors directly: tomlString
type inference, # inside string values, inline-comment headers, and
writeGlobalUserCore round-trip preservation of hand-edited shapes.

Tests: 405 JS + 21 Python pass. Lint, markdownlint, prettier green.
2026-05-26 00:52:16 -05:00
..
commands feat(installer): add --set and --list-options for non-interactive config (#2354) 2026-04-28 20:15:57 -05:00
core fix(installer): address second-round code-review criticals 2026-05-26 00:52:16 -05:00
ide fix(installer): preserve stale installed modules during update (#2391) 2026-05-18 08:39:11 -05:00
modules fix(installer): address code-review findings on config refactor 2026-05-25 23:52:24 -05:00
README.md refactor(installer): restructure installer with clean separation of concerns (#2129) 2026-03-27 06:50:07 -06:00
bmad-cli.js fix(publish): advance @next dist-tag after stable release (#2320) 2026-04-26 10:30:41 -05:00
cli-utils.js chore(installer): remove 1,683 lines of dead code (#2247) 2026-04-10 20:24:50 -07:00
file-ops.js fix(installer): replace fs-extra with native node:fs to prevent file loss 2026-04-13 00:44:28 -05:00
fs-native.js fix(installer): add missing sync and async methods to fs-native wrapper 2026-04-13 09:59:41 -05:00
global-config.js fix(installer): address code-review findings on config refactor 2026-05-25 23:52:24 -05:00
install-messages.yaml feat(installer): overhaul branding, versioning, and skill cleanup (#2223) 2026-04-07 02:31:36 -05:00
list-options.js feat(installer): add --set and --list-options for non-interactive config (#2354) 2026-04-28 20:15:57 -05:00
message-loader.js fix(installer): replace fs-extra with native node:fs to prevent file loss 2026-04-13 00:44:28 -05:00
project-root.js fix(installer): route community installs through PluginResolver when marketplace.json ships (#2331) 2026-04-26 22:50:47 -05:00
prompts.js feat(prompts): add directory prompt with updated Clack runtime (#2387) 2026-05-16 18:30:25 -05:00
set-overrides.js fix(installer): address second-round code-review criticals 2026-05-26 00:52:16 -05:00
ui.js fix(installer): preserve stale installed modules during update (#2391) 2026-05-18 08:39:11 -05:00
yaml-format.js refactor(installer): restructure installer with clean separation of concerns (#2129) 2026-03-27 06:50:07 -06:00

README.md

BMad CLI Tool

Installing external repo BMad official modules

For external official modules to be discoverable during install, ensure an entry for the external repo is added to external-official-modules.yaml.

For community modules - this will be handled in a different way. This file is only for registration of modules under the bmad-code-org.

Post-Install Notes

Modules can display setup guidance to users after configuration is collected during npx bmad-method install. Notes are defined in the module's own module.yaml — no changes to the installer are needed.

Simple Format

Always displayed after the module is configured:

post-install-notes: |
  Thank you for choosing the XYZ Cool Module
  For Support about this Module call 555-1212  

Conditional Format

Display different messages based on a config question's answer:

post-install-notes:
  config_key_name:
    value1: |
      Instructions for value1...      
    value2: |
      Instructions for value2...      

Values without an entry (e.g., none) display nothing. Multiple config keys can each have their own conditional notes.

Example: TEA Module

The TEA module uses the conditional format keyed on tea_browser_automation:

post-install-notes:
  tea_browser_automation:
    cli: |
      Playwright CLI Setup:
        npm install -g @playwright/cli@latest
        playwright-cli install --skills      
    mcp: |
      Playwright MCP Setup (two servers):
        1. playwright    — npx @playwright/mcp@latest
        2. playwright-test — npx playwright run-test-mcp-server      
    auto: |
      Playwright CLI Setup:
        ...
      Playwright MCP Setup (two servers):
        ...      

When a user selects auto, they see both CLI and MCP instructions. When they select none, nothing is shown.