Skip to content

feat: 新增独立 browser 命令组以支持 CDP 启动与双后端运行 #144

@duo121

Description

@duo121

Summary

Add an additive opencli browser command group for browser backend selection, CDP browser launch, and command forwarding, without modifying existing command surfaces.

Why

From an AI-native CLI perspective, browser access should be a runtime capability that can be selected explicitly, instead of being hard-wired to one integration path.

This matters for two reasons:

  1. Existing browser commands can be reused against a Chrome DevTools Protocol endpoint.
  2. The change can stay non-invasive: no breaking changes to opencli <site> <command>.

Proposed Commands

  • opencli browser launch
    • launch a Chrome/Chromium instance with a CDP debugging port
    • support optional --user-data-dir
    • default to an isolated profile when not provided
  • opencli browser doctor
    • diagnose extension or cdp backend connectivity
  • opencli browser run -- <existing command>
    • forward an existing opencli command through a selected browser backend

Design Principles

  • additive only: do not rewrite existing commands
  • preserve the current execution architecture
  • make backend choice explicit via runtime flags
  • keep the old plugin/extension path working

Example

opencli browser launch --port 9222
opencli browser doctor --backend cdp --cdp-endpoint http://127.0.0.1:9222 --live
opencli browser run --backend cdp --cdp-endpoint http://127.0.0.1:9222 -- zhihu search --keyword AI

Notes

This is intentionally a separate command group so the maintainer can evaluate whether and how these capabilities should be merged into the main command surface later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions