fix(cli): forward --port and --host to daemon auto-spawn#149
Open
MrAdonis wants to merge 1 commit intoepiral:mainfrom
Open
fix(cli): forward --port and --host to daemon auto-spawn#149MrAdonis wants to merge 1 commit intoepiral:mainfrom
MrAdonis wants to merge 1 commit intoepiral:mainfrom
Conversation
When ensureDaemon() spawns a new daemon process, CLI flags --port and --host were not forwarded. This meant `bb-browser --port 9222 tab list` would spawn a daemon targeting the default CDP port (19825) instead of the user-specified port. Changes: - daemon-manager: add setDaemonSpawnOptions() to configure --cdp-port and --host args for detached daemon spawn - index: parse --host flag, call setDaemonSpawnOptions() in main() before any command dispatch - help: document --host option
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ensureDaemon()spawns a new daemon process, CLI flags--portand--hostwere silently dropped — the daemon always started with the default CDP port (19825)bb-browser --port 9222 tab listwould fail with "Daemon did not start in time" if Chrome was on port 9222setDaemonSpawnOptions()in daemon-manager to forward--cdp-portand--hostto the detached daemon process--hostflag parsing in CLI (was only accepted by daemon.js directly)Reproduction
Changes
packages/cli/src/daemon-manager.ts: module-level spawn config + forward args inensureDaemon()packages/cli/src/index.ts: parse--hostflag, callsetDaemonSpawnOptions()before command dispatch, update help textTest plan
bb-browser --port <custom> tab listauto-spawns daemon on correct CDP portbb-browser --port <custom> --host 127.0.0.1 snapshotworks on macOS (IPv6 workaround)--port, default behavior unchanged (daemon targets 19825)bb-browser daemon --cdp-port <custom> --host 127.0.0.1foreground mode still works