feat(cli): add setup and dev commands for cross-platform frontend…#292
Conversation
|
Thanks @digger-yu — the cross-platform 1. 🔴 Blocker — the branch is reverting a critical fix. The diff deletes the Robinhood OAuth handling in 2. 🔴 3. 🟡 4. 🟡 No tests for Fix 1–3 (1 is the must) and I'll re-review. Thanks for tackling the cross-platform gap! 🙏 |
Add ``vibe-trading setup`` and ``vibe-trading dev`` to fix the cross-platform frontend build / dev workflow. The Windows npx tsc footgun (npm pulls the abandoned ``tsc@2.0.4`` package from the registry) is solved by always invoking tsc via ``npm exec --package=typescript tsc -b`` on Windows. POSIX uses the standard ``npm run build`` since npm prepends ``./node_modules/.bin`` to PATH for local scripts. ``dev`` launches the backend from ``AGENT_DIR`` (so ``python -m cli._legacy serve`` resolves the in-repo ``cli`` package) and the Vite dev server with the port from ``vite.config.ts`` (5899, not the 5173 we used to hardcode). Both children receive SIGINT/SIGTERM and are force-killed after a 5 s grace period. On Windows, ``subprocess.Popen`` does not consult ``PATHEXT``, so the npm path is taken from ``shutil.which`` (which returns the ``.cmd`` form) and used directly — without this, ``Popen(["npm", ...])`` raises ``FileNotFoundError`` even when ``which`` succeeds. argparse subparsers are registered in ``_legacy.py``; typer commands ``setup`` / ``dev`` are registered in ``main.py``'s ``_build_typer_app()``. ``init`` behavior is unchanged. Tests: ``agent/tests/test_cli_setup_dev.py`` covers platform-aware build commands, the node/npm-missing path, the dev 5899-vs-5173 regression, and the AGENT_DIR-cwd regression. The existing ``cmd_live_authorize`` flow (OAuth handshake) is untouched. Signed-off-by: digger yu <digger-yu@outlook.com>
|
@warren618 Re-requesting review on the current diff. |
|
Thanks for the update and for re-requesting review. We’ve seen the current diff and will re-review as soon as we can, especially around the rebase against the Robinhood OAuth fixes, the backend startup path, frontend port output, and tests for the new CLI commands. |
|
Merged in This gives users a much cleaner path for local frontend/backend startup without the Windows |
… workflow
Summary
feat(cli): add
setupanddevcommands for cross-platform frontend…Why
Files changed:
Changes
Test Plan
pytest --ignore=agent/tests/e2e_backtest --tb=short -q)Checklist
src/agent/,src/session/,src/providers/) without prior discussion