Detect project type and run on localhost.
-
Detect project type
package.json→ Node.js,requirements.txt/pyproject.toml→ Python
-
Detect package manager (Node.js)
- Check lock files:
bun.lock/bun.lockb→ bun,pnpm-lock.yaml→ pnpm,yarn.lock→ yarn,package-lock.json→ npm - Else check
package.jsonpackageManagerfield, default npm
- Check lock files:
-
Install dependencies if needed
- Node.js: If no
node_modules, run<packageManager> install - Python: If missing packages, run
pip install -r requirements.txtorpip install -e .
- Node.js: If no
-
Run and detect URL
- Node.js: Check package.json scripts for
dev/start/serve, run<packageManager> run <script>in background withrequired_permissions: ["all"] - Python: Run
uvicorn,gunicorn,flask run, orpython app.pyin background - Poll output until URL appears (0.5s intervals, 10s max)
- Parse for: "http://localhost:PORT", "http://127.0.0.1:PORT", "Listening on port PORT"
- If detected port differs from default (3000/8000), kill process on default port:
lsof -ti:PORT | xargs kill -9 - Display URL as hyperlink, open in browser with
browser_navigate
- Node.js: Check package.json scripts for