Skip to content

fix: support spaces in --user-name for non-interactive install#2088

Merged
alexeyv merged 4 commits intobmad-code-org:mainfrom
majiayu000:fix/issue-2066-user-name-spaces
Mar 24, 2026
Merged

fix: support spaces in --user-name for non-interactive install#2088
alexeyv merged 4 commits intobmad-code-org:mainfrom
majiayu000:fix/issue-2066-user-name-spaces

Conversation

@majiayu000
Copy link
Copy Markdown
Contributor

What

Replace execSync with execFileSync in the npx wrapper so CLI arguments containing spaces are preserved.

Why

Fixes #2066--user-name "CI Bot" was broken because args.join(' ') collapsed quoted arguments into separate tokens when passed through shell parsing.

How

  • Changed execSync (string command) to execFileSync (array arguments) in tools/bmad-npx-wrapper.js
  • execFileSync bypasses shell parsing, preserving argument boundaries exactly as passed

Testing

  • npm run test:install — all 227 tests pass
  • Verified execFileSync('node', [bmadCliPath, ...args], opts) preserves spaces in --user-name "CI Bot" by avoiding shell tokenization

Replace execSync with execFileSync in npx wrapper so that
argument values containing spaces (e.g. --user-name "CI Bot")
are passed as discrete array elements instead of being split
by the shell.

Fixes bmad-code-org#2066

Signed-off-by: majiayu000 <1835304752@qq.com>
@majiayu000 majiayu000 marked this pull request as ready for review March 21, 2026 12:13
@github-actions
Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 98e7033d-76bd-435b-ba18-8eb9fd6ec560

📥 Commits

Reviewing files that changed from the base of the PR and between ad9cb7a and 4d153c3.

📒 Files selected for processing (1)
  • tools/bmad-npx-wrapper.js

📝 Walkthrough

Walkthrough

Replaced synchronous shell-based subprocess invocation with direct executable invocation using an argument array, eliminating shell-style string interpolation to preserve arguments with spaces and special characters.

Changes

Cohort / File(s) Summary
NPX Wrapper Subprocess Invocation
tools/bmad-npx-wrapper.js
Changed from execSync with constructed command string to execFileSync with argument array, preventing shell parsing of arguments containing spaces (e.g., --user-name "CI Bot").

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • bmadcode
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and clearly describes the main change: fixing support for spaces in --user-name argument by replacing execSync with execFileSync.
Description check ✅ Passed The description is directly related to the changeset, explaining the what, why, how, and testing performed for the argument handling fix.
Linked Issues check ✅ Passed The pull request directly addresses issue #2066 by implementing the required fix: replacing execSync with execFileSync to preserve argument boundaries and support spaces in user names.
Out of Scope Changes check ✅ Passed All changes are in-scope: only tools/bmad-npx-wrapper.js was modified to replace execSync with execFileSync, directly addressing the issue requirement.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use your project's `biome` configuration to improve the quality of JS/TS/CSS/JSON code reviews.

Add a configuration file to your project to customize how CodeRabbit runs biome.

@alexeyv
Copy link
Copy Markdown
Collaborator

alexeyv commented Mar 21, 2026

thank you!

@alexeyv alexeyv merged commit 0c24547 into bmad-code-org:main Mar 24, 2026
5 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Apr 13, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Non-Interactive Installation Argument --user-name doesn't support spaces in user name

2 participants