diff --git a/README.md b/README.md index 436260f..5f5e203 100644 --- a/README.md +++ b/README.md @@ -43,17 +43,7 @@ A CLI tool that turns **any website** into a command-line interface. **47 comman OpenCLI needs a way to communicate with your browser. We highly recommend configuring **both** of the following methods for maximum reliability. -### Connection Method A: Chrome 144+ Auto-Discovery (Recommended) - -No extensions needed. Just enable Chrome's built-in remote debugging: - -1. Open `chrome://inspect#remote-debugging` in Chrome -2. Check **"Allow remote debugging for this browser instance"** -3. Set `OPENCLI_USE_CDP=1` before running opencli - -*You can also manually specify an endpoint via `OPENCLI_CDP_ENDPOINT` env var.* - -### Connection Method B: Playwright MCP Bridge Extension +### Connection Method A: Playwright MCP Bridge Extension (Primary) 1. Install **[Playwright MCP Bridge](https://chromewebstore.google.com/detail/playwright-mcp-bridge/mmlmfjhmonkocbjadbfplnigmagldckm)** extension in Chrome. 2. Obtain your token from the extension settings page. @@ -82,6 +72,16 @@ And, so that `opencli` commands can use it directly in the terminal, export it i export PLAYWRIGHT_MCP_EXTENSION_TOKEN="" ``` +### Connection Method B: Chrome 144+ Auto-Discovery (Fallback) + +No extensions needed. Just enable Chrome's built-in remote debugging: + +1. Open `chrome://inspect#remote-debugging` in Chrome +2. Check **"Allow remote debugging for this browser instance"** +3. Set `OPENCLI_USE_CDP=1` before running opencli + +*You can also manually specify an endpoint via `OPENCLI_CDP_ENDPOINT` env var.* + ## Quick Start ### Install via npm (recommended) diff --git a/README.zh-CN.md b/README.zh-CN.md index 8f7fd3d..7a82bb9 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -43,17 +43,7 @@ OpenCLI 通过 Chrome 浏览器 + [Playwright MCP Bridge](https://github.com/nic 为了让 OpenCLI 能够联通你的浏览器,你需要配置连接方式。**强烈建议以下两种方式都配置上**,互为后备: -### 连接方式 A:Chrome 144+ CDP 自动发现(推荐) - -无需安装任何扩展。只需开启 Chrome 内置的远程调试: - -1. 在 Chrome 中打开 `chrome://inspect#remote-debugging` -2. 勾选 **"允许对此浏览器实例进行远程调试" (Allow remote debugging for this browser instance)** -3. 运行时设置环境变量 `OPENCLI_USE_CDP=1` - -*也可通过 `OPENCLI_CDP_ENDPOINT` 环境变量手动指定 CDP endpoint 地址。* - -### 连接方式 B:Playwright MCP Bridge 扩展 +### 连接方式 A:Playwright MCP Bridge 扩展(首选) 1. 安装 **[Playwright MCP Bridge](https://chromewebstore.google.com/detail/playwright-mcp-bridge/mmlmfjhmonkocbjadbfplnigmagldckm)** 扩展 2. 在插件设置页获取你的 Extension Token。 @@ -82,6 +72,16 @@ OpenCLI 通过 Chrome 浏览器 + [Playwright MCP Bridge](https://github.com/nic export PLAYWRIGHT_MCP_EXTENSION_TOKEN="<你的-token>" ``` +### 连接方式 B:Chrome 144+ CDP 自动发现(备选) + +无需安装任何扩展。只需开启 Chrome 内置的远程调试: + +1. 在 Chrome 中打开 `chrome://inspect#remote-debugging` +2. 勾选 **"允许对此浏览器实例进行远程调试" (Allow remote debugging for this browser instance)** +3. 运行时设置环境变量 `OPENCLI_USE_CDP=1` + +*也可通过 `OPENCLI_CDP_ENDPOINT` 环境变量手动指定 CDP endpoint 地址。* + ## 快速开始 ### npm 全局安装(推荐)