Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ OpenCLI is not only for websites. It can also:

| Variable | Default | Description |
|----------|---------|-------------|
| `OPENCLI_DAEMON_PORT` | `19825` | HTTP port for the daemon-extension bridge |
| `OPENCLI_DAEMON_PORT` | `19825` | HTTP port for the daemon-extension bridge (Change in extension popup to match) |
| `OPENCLI_WINDOW_FOCUSED` | `false` | Set to `1` to open automation windows in the foreground (useful for debugging). The `--focus` flag sets this. |
| `OPENCLI_LIVE` | `false` | Set to `1` to keep the automation window open after an adapter command finishes (useful for inspection). The `--live` flag sets this. |
| `OPENCLI_BROWSER_CONNECT_TIMEOUT` | `30` | Seconds to wait for browser connection |
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ OpenCLI 不只是网站 CLI,还可以:

| 变量 | 默认值 | 说明 |
|------|--------|------|
| `OPENCLI_DAEMON_PORT` | `19825` | daemon-extension 通信端口 |
| `OPENCLI_DAEMON_PORT` | `19825` | daemon-extension 通信端口 (修改后需在扩展弹窗中同步设置) |
| `OPENCLI_WINDOW_FOCUSED` | `false` | 设为 `1` 时 automation 窗口在前台打开(适合调试)。`--focus` 标志会设置此变量 |
| `OPENCLI_LIVE` | `false` | 设为 `1` 时 adapter 命令执行完后保留 automation 窗口不关闭(适合检查页面)。`--live` 标志会设置此变量 |
| `OPENCLI_BROWSER_CONNECT_TIMEOUT` | `30` | 浏览器连接超时(秒) |
Expand Down
6 changes: 6 additions & 0 deletions docs/guide/browser-bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ Key rules:

The daemon manages the WebSocket connection between your CLI commands and the Chrome extension. The extension executes JavaScript in the context of web pages, with access to the logged-in session.

## Changing the Daemon Port

If you need to run multiple `opencli` profiles simultaneously or avoid port conflicts, you can change the default `19825` port:
1. Export the `OPENCLI_DAEMON_PORT` environment variable before running CLI commands (e.g., `export OPENCLI_DAEMON_PORT=19826`).
2. Open the Chrome Extension popup, enter the matching port, and click **Save**. The extension will immediately reconnect.

## Daemon Lifecycle

The daemon auto-starts on first browser command and stays alive persistently.
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ OPENCLI_CDP_TARGET=detail.1688.com opencli 1688 item 841141931191 -f json
### Daemon issues

```bash
# View extension logs
# View extension logs (Replace 19825 if using a custom OPENCLI_DAEMON_PORT)
curl localhost:19825/logs

# Stop the daemon
Expand Down
Loading
Loading