Fix npx execution issue with bmad CLI

- Added wrapper script (bmad.js) at root to handle npx execution context
- Fixed module resolution in tools/installer/bin/bmad.js for both local and npx contexts
- Updated package.json bin paths to use the wrapper script
- Handles temporary npx directories properly using execSync

This fixes the issue where `npx github:bmadcode/BMAD-METHOD#v4-alpha bmad`
was dropping into a shell instead of executing the command.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Brian Madison
2025-06-13 09:01:52 -05:00
parent 8d788b6f49
commit 6e63bf2241
4 changed files with 69 additions and 8 deletions

View File

@@ -4,8 +4,8 @@
"description": "Breakthrough Method of Agile AI-driven Development",
"main": "tools/cli.js",
"bin": {
"bmad": "./tools/installer/bin/bmad.js",
"bmad-method": "./tools/installer/bin/bmad.js"
"bmad": "./bmad.js",
"bmad-method": "./bmad.js"
},
"scripts": {
"build": "node tools/cli.js build",