feat: add command-level CDP overrides / 增加命令级 CDP 覆盖#406
feat: add command-level CDP overrides / 增加命令级 CDP 覆盖#406coolxll wants to merge 1 commit intojackwener:mainfrom
Conversation
|
Useful feature — per-command CDP overrides solve a real pain point for multi-app workflows. One major concern plus a few smaller items: CriticalConflicts with your PR #408 Both PRs define the same exports ( Suggestion: consolidate both PRs into one, with a unified Warnings
No URL validation on Option registration repeated 5 times — identical Non-browser commands also wrapped — |
Summary / 摘要
This PR adds command-level CDP overrides so browser-backed commands can target different Chrome/Electron sessions without mutating global shell state.
这个 PR 为浏览器相关命令增加了命令级 CDP 覆盖参数,使不同的 Chrome / Electron 会话可以按命令单独指定,而不需要反复切换全局环境变量。
Why / 背景与原因
Today
openclimainly relies on global environment variables such asOPENCLI_CDP_ENDPOINTandOPENCLI_CDP_TARGET.That works for single-app usage, but it becomes awkward when switching between multiple Electron apps, multiple Chrome instances, or multiple debugging ports.
目前
opencli主要依赖全局环境变量,例如OPENCLI_CDP_ENDPOINT和OPENCLI_CDP_TARGET。这种方式在单应用场景下可用,但一旦需要在多个 Electron 应用、多个 Chrome 实例、或者多个调试端口之间切换,就会很不方便。
Typical problems:
antigravity serveare harder to route cleanly典型问题包括:
antigravity serve这种长运行命令也不容易干净地指定目标Changes / 修改内容
add
--cdp-endpointand--cdp-targetto browser-backed dynamic commandsadd the same command-level overrides to built-in browser commands such as
explore,generate,record, andcascadeadd command-level overrides to
opencli antigravity serveadd runtime helpers to apply and restore CDP env overrides safely during command execution
update Antigravity docs and skill docs to document per-command usage
add unit tests for runtime override behavior and Commander integration
为浏览器相关的动态命令增加
--cdp-endpoint和--cdp-target为
explore、generate、record、cascade等内建浏览器命令增加同样的命令级覆盖能力为
opencli antigravity serve增加命令级覆盖能力增加运行时 helper,在命令执行期间安全地设置并恢复 CDP 环境变量
更新 Antigravity 文档与技能说明,补充按命令传参的用法
增加对应单元测试,覆盖运行时覆盖逻辑和 Commander 接入行为
Example / 示例
This makes multi-app workflows much easier without breaking existing env-based usage.
这样可以在不破坏现有环境变量用法的前提下,显著改善多应用场景下的使用体验。
Verification / 验证
npm testnpm run typecheck