@jackwener/opencli 1.7.8 → 1.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -14
- package/README.zh-CN.md +30 -10
- package/cli-manifest.json +646 -30
- package/clis/36kr/news.js +1 -1
- package/clis/apple-podcasts/commands.test.js +4 -4
- package/clis/apple-podcasts/episodes.js +1 -1
- package/clis/apple-podcasts/search.js +1 -1
- package/clis/apple-podcasts/top.js +1 -1
- package/clis/arxiv/paper.js +1 -1
- package/clis/arxiv/search.js +1 -1
- package/clis/band/mentions.js +3 -3
- package/clis/bbc/news.js +1 -1
- package/clis/bilibili/subtitle.js +2 -2
- package/clis/bloomberg/businessweek.js +1 -1
- package/clis/bloomberg/economics.js +1 -1
- package/clis/bloomberg/industries.js +1 -1
- package/clis/bloomberg/main.js +1 -1
- package/clis/bloomberg/markets.js +1 -1
- package/clis/bloomberg/opinions.js +1 -1
- package/clis/bloomberg/politics.js +1 -1
- package/clis/bloomberg/tech.js +1 -1
- package/clis/boss/search.js +49 -8
- package/clis/boss/search.test.js +78 -0
- package/clis/boss/send.js +3 -3
- package/clis/chatgpt/image.js +37 -8
- package/clis/chatgpt/image.test.js +92 -0
- package/clis/chatgpt/utils.js +39 -6
- package/clis/chatgpt/utils.test.js +63 -0
- package/clis/chatgpt-app/ask.js +1 -1
- package/clis/chatgpt-app/ax.js +4 -2
- package/clis/chatgpt-app/ax.test.js +12 -0
- package/clis/chatgpt-app/model.js +1 -1
- package/clis/chatgpt-app/new.js +1 -1
- package/clis/chatgpt-app/read.js +1 -1
- package/clis/chatgpt-app/send.js +1 -1
- package/clis/chatgpt-app/status.js +1 -1
- package/clis/chatwise/ask.js +2 -2
- package/clis/chatwise/model.js +2 -2
- package/clis/chatwise/send.js +2 -2
- package/clis/claude/ask.js +128 -0
- package/clis/claude/ask.test.js +338 -0
- package/clis/claude/commands.test.js +118 -0
- package/clis/claude/detail.js +29 -0
- package/clis/claude/history.js +31 -0
- package/clis/claude/new.js +21 -0
- package/clis/claude/read.js +24 -0
- package/clis/claude/send.js +41 -0
- package/clis/claude/status.js +24 -0
- package/clis/claude/utils.js +440 -0
- package/clis/claude/utils.test.js +148 -0
- package/clis/codex/ask.js +2 -2
- package/clis/codex/send.js +2 -2
- package/clis/ctrip/search.js +1 -1
- package/clis/ctrip/search.test.js +4 -4
- package/clis/cursor/ask.js +2 -2
- package/clis/cursor/composer.js +2 -2
- package/clis/cursor/send.js +2 -2
- package/clis/deepseek/ask.js +17 -4
- package/clis/deepseek/ask.test.js +46 -0
- package/clis/deepseek/utils.js +55 -16
- package/clis/deepseek/utils.test.js +124 -5
- package/clis/doubao/utils.js +53 -11
- package/clis/doubao/utils.test.js +22 -2
- package/clis/eastmoney/announcement.js +1 -1
- package/clis/eastmoney/convertible.js +1 -1
- package/clis/eastmoney/etf.js +1 -1
- package/clis/eastmoney/holders.js +1 -1
- package/clis/eastmoney/index-board.js +1 -1
- package/clis/eastmoney/kline.js +1 -1
- package/clis/eastmoney/kuaixun.js +1 -1
- package/clis/eastmoney/longhu.js +1 -1
- package/clis/eastmoney/money-flow.js +1 -1
- package/clis/eastmoney/northbound.js +1 -1
- package/clis/eastmoney/quote.js +1 -1
- package/clis/eastmoney/rank.js +1 -1
- package/clis/eastmoney/sectors.js +1 -1
- package/clis/facebook/marketplace-inbox.js +83 -0
- package/clis/facebook/marketplace-listings.js +83 -0
- package/clis/facebook/marketplace.test.js +91 -0
- package/clis/google/news.js +1 -1
- package/clis/google/suggest.js +1 -1
- package/clis/google/trends.js +1 -1
- package/clis/google-scholar/cite.js +74 -0
- package/clis/google-scholar/cite.test.js +47 -0
- package/clis/google-scholar/profile.js +92 -0
- package/clis/google-scholar/profile.test.js +49 -0
- package/clis/google-scholar/search.js +1 -1
- package/clis/google-scholar/search.test.js +15 -0
- package/clis/hf/top.js +1 -1
- package/clis/instagram/collection-create.js +57 -0
- package/clis/instagram/saved.js +21 -7
- package/clis/jd/item.js +679 -47
- package/clis/jd/item.test.js +318 -7
- package/clis/jd/item.test.ts +517 -0
- package/clis/lesswrong/comments.js +1 -1
- package/clis/lesswrong/curated.js +1 -1
- package/clis/lesswrong/frontpage.js +1 -1
- package/clis/lesswrong/new.js +1 -1
- package/clis/lesswrong/read.js +1 -1
- package/clis/lesswrong/sequences.js +1 -1
- package/clis/lesswrong/shortform.js +1 -1
- package/clis/lesswrong/tag.js +1 -1
- package/clis/lesswrong/tags.js +1 -1
- package/clis/lesswrong/top-month.js +1 -1
- package/clis/lesswrong/top-week.js +1 -1
- package/clis/lesswrong/top-year.js +1 -1
- package/clis/lesswrong/top.js +1 -1
- package/clis/lesswrong/user-posts.js +1 -1
- package/clis/lesswrong/user.js +1 -1
- package/clis/paperreview/commands.test.js +6 -6
- package/clis/paperreview/feedback.js +1 -1
- package/clis/paperreview/review.js +1 -1
- package/clis/paperreview/submit.js +1 -1
- package/clis/producthunt/posts.js +1 -1
- package/clis/producthunt/today.js +1 -1
- package/clis/sinablog/search.js +1 -1
- package/clis/sinafinance/news.js +1 -1
- package/clis/sinafinance/stock.js +1 -1
- package/clis/sinafinance/stock.test.js +2 -2
- package/clis/spotify/spotify.js +6 -6
- package/clis/substack/search.js +1 -1
- package/clis/toutiao/articles.js +5 -6
- package/clis/toutiao/articles.test.js +22 -15
- package/clis/twitter/followers.js +2 -2
- package/clis/twitter/following.js +224 -73
- package/clis/twitter/following.test.js +277 -0
- package/clis/twitter/post.js +184 -47
- package/clis/twitter/post.test.js +114 -34
- package/clis/uiverse/_shared.js +63 -4
- package/clis/uiverse/_shared.test.js +7 -0
- package/clis/uiverse/code.js +1 -0
- package/clis/uiverse/navigation.test.js +12 -0
- package/clis/uiverse/preview.js +1 -0
- package/clis/web/read.js +319 -81
- package/clis/web/read.test.js +221 -5
- package/clis/weibo/favorites.js +169 -0
- package/clis/weibo/favorites.test.js +114 -0
- package/clis/weibo/publish.js +282 -0
- package/clis/weibo/publish.test.js +183 -0
- package/clis/weread/ranking.js +1 -1
- package/clis/weread/search-regression.test.js +8 -8
- package/clis/weread/search.js +1 -1
- package/clis/wikipedia/random.js +1 -1
- package/clis/wikipedia/search.js +1 -1
- package/clis/wikipedia/summary.js +1 -1
- package/clis/wikipedia/trending.js +1 -1
- package/clis/xianyu/chat.js +3 -3
- package/clis/xianyu/item.js +2 -2
- package/clis/xianyu/item.test.js +3 -3
- package/clis/xiaohongshu/search.js +17 -2
- package/clis/xiaohongshu/search.test.js +37 -1
- package/clis/xiaoyuzhou/download.js +1 -1
- package/clis/xiaoyuzhou/download.test.js +3 -3
- package/clis/xiaoyuzhou/episode.js +1 -1
- package/clis/xiaoyuzhou/podcast-episodes.js +1 -1
- package/clis/xiaoyuzhou/podcast-episodes.test.js +2 -2
- package/clis/xiaoyuzhou/podcast.js +1 -1
- package/clis/xiaoyuzhou/transcript.js +1 -1
- package/clis/xiaoyuzhou/transcript.test.js +5 -5
- package/clis/yollomi/models.js +1 -1
- package/clis/youtube/channel.js +24 -1
- package/clis/youtube/channel.test.js +59 -0
- package/clis/zhihu/answer.js +21 -162
- package/clis/zhihu/answer.test.js +26 -53
- package/clis/zhihu/collection.js +197 -0
- package/clis/zhihu/collection.test.js +290 -0
- package/clis/zhihu/collections.js +127 -0
- package/clis/zhihu/collections.test.js +182 -0
- package/clis/zhihu/comment.js +24 -305
- package/clis/zhihu/comment.test.js +31 -35
- package/clis/zhihu/favorite.js +44 -182
- package/clis/zhihu/favorite.test.js +30 -167
- package/clis/zhihu/follow.js +25 -56
- package/clis/zhihu/follow.test.js +20 -23
- package/clis/zhihu/like.js +22 -67
- package/clis/zhihu/like.test.js +19 -42
- package/clis/zhihu/search.js +3 -2
- package/clis/zhihu/write-shared.js +8 -1
- package/clis/zhihu/write-shared.test.js +1 -0
- package/clis/zlibrary/commands.test.js +75 -0
- package/clis/zlibrary/info.js +47 -0
- package/clis/zlibrary/search.js +46 -0
- package/clis/zlibrary/utils.js +136 -0
- package/dist/src/adapter-source.d.ts +11 -0
- package/dist/src/adapter-source.js +24 -0
- package/dist/src/adapter-source.test.js +29 -0
- package/dist/src/browser/base-page.d.ts +3 -1
- package/dist/src/browser/base-page.js +76 -1
- package/dist/src/browser/base-page.test.d.ts +1 -0
- package/dist/src/browser/base-page.test.js +74 -0
- package/dist/src/browser/bridge.d.ts +1 -2
- package/dist/src/browser/bridge.js +40 -41
- package/dist/src/browser/cdp.d.ts +1 -0
- package/dist/src/browser/cdp.js +3 -3
- package/dist/src/browser/daemon-client.d.ts +38 -4
- package/dist/src/browser/daemon-client.js +24 -7
- package/dist/src/browser/daemon-client.test.js +49 -0
- package/dist/src/browser/daemon-lifecycle.d.ts +23 -0
- package/dist/src/browser/daemon-lifecycle.js +67 -0
- package/dist/src/browser/daemon-version.d.ts +4 -0
- package/dist/src/browser/daemon-version.js +12 -0
- package/dist/src/browser/errors.js +3 -0
- package/dist/src/browser/errors.test.js +3 -0
- package/dist/src/browser/network-cache.d.ts +1 -0
- package/dist/src/browser/page.d.ts +3 -1
- package/dist/src/browser/page.js +10 -2
- package/dist/src/browser/profile.d.ts +14 -0
- package/dist/src/browser/profile.js +85 -0
- package/dist/src/build-manifest.d.ts +2 -0
- package/dist/src/build-manifest.js +13 -3
- package/dist/src/build-manifest.test.js +20 -2
- package/dist/src/cli.d.ts +6 -0
- package/dist/src/cli.js +477 -35
- package/dist/src/cli.test.js +303 -2
- package/dist/src/commanderAdapter.js +17 -9
- package/dist/src/commanderAdapter.test.js +67 -2
- package/dist/src/commands/daemon.d.ts +2 -0
- package/dist/src/commands/daemon.js +42 -1
- package/dist/src/commands/daemon.test.js +103 -2
- package/dist/src/completion-shared.js +1 -2
- package/dist/src/completion.test.js +3 -2
- package/dist/src/daemon.js +125 -41
- package/dist/src/doctor.d.ts +5 -6
- package/dist/src/doctor.js +77 -19
- package/dist/src/doctor.test.js +117 -0
- package/dist/src/engine.test.js +6 -5
- package/dist/src/errors.d.ts +14 -8
- package/dist/src/errors.js +36 -30
- package/dist/src/errors.test.js +5 -5
- package/dist/src/execution.d.ts +4 -0
- package/dist/src/execution.js +173 -25
- package/dist/src/execution.test.js +171 -1
- package/dist/src/main.js +10 -0
- package/dist/src/observation/artifact.d.ts +16 -0
- package/dist/src/observation/artifact.js +260 -0
- package/dist/src/observation/artifact.test.d.ts +1 -0
- package/dist/src/observation/artifact.test.js +121 -0
- package/dist/src/observation/events.d.ts +89 -0
- package/dist/src/observation/events.js +1 -0
- package/dist/src/observation/index.d.ts +7 -0
- package/dist/src/observation/index.js +7 -0
- package/dist/src/observation/manager.d.ts +9 -0
- package/dist/src/observation/manager.js +27 -0
- package/dist/src/observation/manager.test.d.ts +1 -0
- package/dist/src/observation/manager.test.js +13 -0
- package/dist/src/observation/redaction.d.ts +11 -0
- package/dist/src/observation/redaction.js +81 -0
- package/dist/src/observation/redaction.test.d.ts +1 -0
- package/dist/src/observation/redaction.test.js +32 -0
- package/dist/src/observation/retention.d.ts +32 -0
- package/dist/src/observation/retention.js +160 -0
- package/dist/src/observation/retention.test.d.ts +1 -0
- package/dist/src/observation/retention.test.js +118 -0
- package/dist/src/observation/ring-buffer.d.ts +22 -0
- package/dist/src/observation/ring-buffer.js +45 -0
- package/dist/src/observation/ring-buffer.test.d.ts +1 -0
- package/dist/src/observation/ring-buffer.test.js +22 -0
- package/dist/src/observation/session.d.ts +25 -0
- package/dist/src/observation/session.js +50 -0
- package/dist/src/pipeline/executor.test.js +1 -0
- package/dist/src/pipeline/steps/download.test.js +1 -0
- package/dist/src/pipeline/steps/fetch.js +1 -21
- package/dist/src/pipeline/steps/fetch.test.js +6 -12
- package/dist/src/plugin-scaffold.js +1 -1
- package/dist/src/plugin-scaffold.test.js +1 -1
- package/dist/src/registry.d.ts +40 -9
- package/dist/src/registry.js +3 -1
- package/dist/src/runtime-detect.d.ts +10 -0
- package/dist/src/runtime-detect.js +19 -0
- package/dist/src/runtime-detect.test.js +12 -1
- package/dist/src/runtime.d.ts +2 -0
- package/dist/src/runtime.js +1 -0
- package/dist/src/types.d.ts +22 -0
- package/dist/src/update-check.d.ts +31 -1
- package/dist/src/update-check.js +62 -16
- package/dist/src/update-check.test.js +86 -1
- package/package.json +1 -1
- package/dist/src/diagnostic.d.ts +0 -63
- package/dist/src/diagnostic.js +0 -292
- package/dist/src/diagnostic.test.js +0 -302
- /package/dist/src/{diagnostic.test.d.ts → adapter-source.test.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -20,7 +20,8 @@ It also works as a **CLI hub** for local tools such as `gh`, `docker`, and other
|
|
|
20
20
|
|
|
21
21
|
- **Desktop App Control** — Drive Electron apps (Cursor, Codex, ChatGPT, Notion, etc.) directly from the terminal via CDP.
|
|
22
22
|
- **Browser Automation for AI Agents** — Install the `opencli-adapter-author` skill, and your AI agent can operate any website: navigate, click, type, extract, screenshot — all through your logged-in Chrome session.
|
|
23
|
-
- **
|
|
23
|
+
- **Multi-profile Browser Bridge** — Install the extension in each Chrome profile you want to use, then route commands with `--profile`, `OPENCLI_PROFILE`, or `opencli profile use`.
|
|
24
|
+
- **Website → CLI** — Turn any website into a deterministic CLI: 100+ site surfaces are already registered, or write your own with the `opencli-adapter-author` skill + `opencli browser verify`.
|
|
24
25
|
- **Account-safe** — Reuses Chrome/Chromium logged-in state; your credentials never leave the browser.
|
|
25
26
|
- **AI Agent ready** — One skill takes you from site recon through API discovery, field decoding, adapter writing, and verification.
|
|
26
27
|
- **CLI Hub** — Discover, auto-install, and passthrough commands to any external CLI (gh, docker, obsidian, etc).
|
|
@@ -33,7 +34,10 @@ It also works as a **CLI hub** for local tools such as `gh`, `docker`, and other
|
|
|
33
34
|
|
|
34
35
|
### 1. Install OpenCLI
|
|
35
36
|
|
|
37
|
+
OpenCLI requires **Node.js >= 21**.
|
|
38
|
+
|
|
36
39
|
```bash
|
|
40
|
+
node --version
|
|
37
41
|
npm install -g @jackwener/opencli
|
|
38
42
|
```
|
|
39
43
|
|
|
@@ -41,6 +45,10 @@ npm install -g @jackwener/opencli
|
|
|
41
45
|
|
|
42
46
|
OpenCLI connects to Chrome/Chromium through a lightweight Browser Bridge extension plus a small local daemon. The daemon auto-starts when needed.
|
|
43
47
|
|
|
48
|
+
**Option A — Chrome Web Store (recommended):**
|
|
49
|
+
Install **OpenCLI** from the [Chrome Web Store](https://chromewebstore.google.com/detail/opencli/ildkmabpimmkaediidaifkhjpohdnifk).
|
|
50
|
+
|
|
51
|
+
**Option B — Manual install:**
|
|
44
52
|
1. Download the latest `opencli-extension-v{version}.zip` from the GitHub [Releases page](https://github.com/jackwener/opencli/releases).
|
|
45
53
|
2. Unzip it, open `chrome://extensions`, and enable **Developer mode**.
|
|
46
54
|
3. Click **Load unpacked** and select the unzipped folder.
|
|
@@ -51,7 +59,20 @@ OpenCLI connects to Chrome/Chromium through a lightweight Browser Bridge extensi
|
|
|
51
59
|
opencli doctor
|
|
52
60
|
```
|
|
53
61
|
|
|
54
|
-
### 4.
|
|
62
|
+
### 4. Optional: name your Chrome profile
|
|
63
|
+
|
|
64
|
+
Each Chrome profile runs its own OpenCLI extension instance. If you use multiple Chrome profiles, list the connected profiles and assign local aliases:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
opencli profile list
|
|
68
|
+
opencli profile rename <contextId> work
|
|
69
|
+
opencli profile use work
|
|
70
|
+
opencli --profile work browser state
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
With only one connected profile, OpenCLI uses it automatically. With multiple connected profiles and no default, OpenCLI asks you to choose instead of guessing.
|
|
74
|
+
|
|
75
|
+
### 5. Run your first commands
|
|
55
76
|
|
|
56
77
|
```bash
|
|
57
78
|
opencli list
|
|
@@ -65,9 +86,21 @@ Use OpenCLI directly when you want a reliable command instead of a live browser
|
|
|
65
86
|
|
|
66
87
|
- `opencli list` shows every registered command.
|
|
67
88
|
- `opencli <site> <command>` runs a built-in or generated adapter.
|
|
68
|
-
- `opencli register mycli` exposes a local CLI through the same discovery surface.
|
|
89
|
+
- `opencli external register mycli` exposes a local CLI through the same discovery surface.
|
|
69
90
|
- `opencli doctor` helps diagnose browser connectivity.
|
|
70
91
|
|
|
92
|
+
## Extending OpenCLI
|
|
93
|
+
|
|
94
|
+
If you want to add your own commands, start with the [Extending OpenCLI guide](./docs/guide/extending-opencli.md). README keeps this short; the guide covers the directory layout, source-control model, and install commands.
|
|
95
|
+
|
|
96
|
+
| Need | Recommended path |
|
|
97
|
+
|------|------------------|
|
|
98
|
+
| Keep personal website commands in your own Git repo | `opencli plugin create` + `opencli plugin install file://...` |
|
|
99
|
+
| Quickly draft a private local adapter | `opencli browser init <site>/<command>` in `~/.opencli/clis/` |
|
|
100
|
+
| Modify an official adapter locally | `opencli adapter eject/status/reset` |
|
|
101
|
+
| Publish or install third-party commands | `opencli plugin install github:user/repo` |
|
|
102
|
+
| Wrap an existing local binary | `opencli external register <name>` |
|
|
103
|
+
|
|
71
104
|
## For AI Agents
|
|
72
105
|
|
|
73
106
|
OpenCLI's browser commands are designed to be used by AI Agents — not run manually. Install skills into your AI agent (Claude Code, Cursor, etc.), and the agent operates websites on your behalf using your logged-in Chrome session.
|
|
@@ -153,7 +186,8 @@ OpenCLI is not only for websites. It can also:
|
|
|
153
186
|
|
|
154
187
|
## Prerequisites
|
|
155
188
|
|
|
156
|
-
- **Node.js**: >= 21.0.0 (
|
|
189
|
+
- **Node.js**: >= 21.0.0 (required for the standard npm install path)
|
|
190
|
+
- **Bun**: >= 1.0 (optional alternative runtime)
|
|
157
191
|
- **Chrome or Chromium** running and logged into the target site for browser-backed commands
|
|
158
192
|
|
|
159
193
|
> **Important**: Browser-backed commands reuse your Chrome/Chromium login session. If you get empty data or permission-like failures, first confirm the site is already open and authenticated in Chrome/Chromium.
|
|
@@ -163,17 +197,17 @@ OpenCLI is not only for websites. It can also:
|
|
|
163
197
|
| Variable | Default | Description |
|
|
164
198
|
|----------|---------|-------------|
|
|
165
199
|
| `OPENCLI_DAEMON_PORT` | `19825` | HTTP port for the daemon-extension bridge |
|
|
166
|
-
| `
|
|
167
|
-
| `
|
|
200
|
+
| `OPENCLI_PROFILE` | — | Browser Bridge profile alias/contextId to use when multiple Chrome profiles are connected |
|
|
201
|
+
| `OPENCLI_WINDOW_FOCUSED` | `false` | Set to `1` to open the automation container in the foreground (useful for debugging). The `--focus` flag sets this. |
|
|
202
|
+
| `OPENCLI_LIVE` | `false` | Set to `1` to keep the automation lease open after an adapter command finishes (useful for inspection). The `--live` flag sets this. |
|
|
168
203
|
| `OPENCLI_BROWSER_CONNECT_TIMEOUT` | `30` | Seconds to wait for browser connection |
|
|
169
204
|
| `OPENCLI_BROWSER_COMMAND_TIMEOUT` | `60` | Seconds to wait for a single browser command |
|
|
170
205
|
| `OPENCLI_CDP_ENDPOINT` | — | Chrome DevTools Protocol endpoint for remote browser or Electron apps |
|
|
171
206
|
| `OPENCLI_CDP_TARGET` | — | Filter CDP targets by URL substring (e.g. `detail.1688.com`) |
|
|
172
207
|
| `OPENCLI_VERBOSE` | `false` | Enable verbose logging (`-v` flag also works) |
|
|
173
|
-
| `OPENCLI_DIAGNOSTIC` | `false` | Set to `1` to capture structured diagnostic context on failures |
|
|
174
208
|
| `DEBUG_SNAPSHOT` | — | Set to `1` for DOM snapshot debug output |
|
|
175
209
|
|
|
176
|
-
`--focus` works for both `opencli browser *` and browser-backed adapter commands. `--live` is mainly for adapter commands: browser subcommands already keep the automation
|
|
210
|
+
`--focus` works for both `opencli browser *` and browser-backed adapter commands. `--live` is mainly for adapter commands: browser subcommands already keep the automation lease open until you run `opencli browser close` or the idle timeout expires.
|
|
177
211
|
|
|
178
212
|
## Update
|
|
179
213
|
|
|
@@ -226,6 +260,7 @@ To load the source Browser Bridge extension:
|
|
|
226
260
|
| **1688** | `search` `item` `assets` `download` `store` |
|
|
227
261
|
| **gitee** | `trending` `search` `user` |
|
|
228
262
|
| **gemini** | `new` `ask` `image` `deep-research` `deep-research-result` |
|
|
263
|
+
| **claude** | `ask` `send` `new` `status` `read` `history` `detail` |
|
|
229
264
|
| **yuanbao** | `new` `ask` |
|
|
230
265
|
| **notebooklm** | `status` `list` `open` `current` `get` `history` `summary` `note-list` `notes-get` `source-list` `source-get` `source-fulltext` `source-guide` |
|
|
231
266
|
| **spotify** | `auth` `status` `play` `pause` `next` `prev` `volume` `search` `queue` `shuffle` `repeat` |
|
|
@@ -234,7 +269,7 @@ To load the source Browser Bridge extension:
|
|
|
234
269
|
| **quark** | `ls` `mkdir` `mv` `rename` `rm` `save` `share-tree` |
|
|
235
270
|
| **uiverse** | `code` `preview` |
|
|
236
271
|
| **baidu-scholar** | `search` |
|
|
237
|
-
| **google-scholar** | `search` |
|
|
272
|
+
| **google-scholar** | `search` `cite` `profile` |
|
|
238
273
|
| **gov-law** | `search` `recent` |
|
|
239
274
|
| **gov-policy** | `search` `recent` |
|
|
240
275
|
| **nowcoder** | `hot` `trending` `topics` `recommend` `creators` `companies` `jobs` `search` `suggest` `experience` `referral` `salary` `papers` `practice` `notifications` `detail` |
|
|
@@ -242,7 +277,7 @@ To load the source Browser Bridge extension:
|
|
|
242
277
|
| **hackernews** | `top` `new` `best` `ask` `show` `jobs` `search` `user` |
|
|
243
278
|
| **xiaoyuzhou** | `auth*` `podcast*` `podcast-episodes*` `episode*` `download*` `transcript*` |
|
|
244
279
|
|
|
245
|
-
|
|
280
|
+
100+ site surfaces in total — **[→ see all supported sites & commands](./docs/adapters/index.md)**
|
|
246
281
|
|
|
247
282
|
`*` `opencli xiaoyuzhou podcast`, `podcast-episodes`, `episode`, `download`, and `transcript` require local Xiaoyuzhou credentials in `~/.opencli/xiaoyuzhou.json`.
|
|
248
283
|
|
|
@@ -263,7 +298,7 @@ OpenCLI acts as a universal hub for your existing command-line tools — unified
|
|
|
263
298
|
**Register your own** — add any local CLI so AI agents can discover it via `opencli list`:
|
|
264
299
|
|
|
265
300
|
```bash
|
|
266
|
-
opencli register mycli
|
|
301
|
+
opencli external register mycli
|
|
267
302
|
```
|
|
268
303
|
|
|
269
304
|
### Desktop App Adapters
|
|
@@ -375,7 +410,7 @@ Before writing any adapter code, read the [`opencli-adapter-author` skill](./ski
|
|
|
375
410
|
- Decode response fields, design columns, scaffold with `opencli browser init`.
|
|
376
411
|
- Verify with `opencli browser verify <site>/<name>` before shipping.
|
|
377
412
|
|
|
378
|
-
|
|
413
|
+
For long-lived personal commands that should live in your own Git repo, use a local plugin instead; see [Extending OpenCLI](./docs/guide/extending-opencli.md). Quick private adapters can still live at `~/.opencli/clis/<site>/<name>.js`. Site knowledge (endpoints, field maps, fixtures) accumulates in `~/.opencli/sites/<site>/` so the next adapter for the same site starts from context instead of zero.
|
|
379
414
|
|
|
380
415
|
## Testing
|
|
381
416
|
|
|
@@ -383,10 +418,10 @@ See **[TESTING.md](./TESTING.md)** for how to run and write tests.
|
|
|
383
418
|
|
|
384
419
|
## Troubleshooting
|
|
385
420
|
|
|
386
|
-
- **"Extension not connected"** — Ensure the Browser Bridge extension is installed and **enabled** in `chrome://extensions
|
|
421
|
+
- **"Extension not connected"** — Ensure the Browser Bridge extension is installed from the [Chrome Web Store](https://chromewebstore.google.com/detail/opencli/ildkmabpimmkaediidaifkhjpohdnifk) and **enabled** in `chrome://extensions`.
|
|
387
422
|
- **"attach failed: Cannot access a chrome-extension:// URL"** — Another extension may be interfering. Try disabling other extensions temporarily.
|
|
388
423
|
- **Empty data or 'Unauthorized' error** — Your Chrome/Chromium login session may have expired. Navigate to the target site and log in again.
|
|
389
|
-
- **Node API errors** —
|
|
424
|
+
- **Node API errors / missing `fetch` / startup crash on old Node** — OpenCLI requires **Node.js >= 21**. Run `node --version`, upgrade Node if needed, then retry.
|
|
390
425
|
- **Daemon issues** — Check status: `curl localhost:19825/status` · View logs: `curl localhost:19825/logs`
|
|
391
426
|
|
|
392
427
|
## Star History
|
package/README.zh-CN.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
OpenCLI 可以用同一套 CLI 做三类事情:
|
|
12
12
|
|
|
13
|
-
- **直接使用现成适配器**:B站、知乎、小红书、Twitter/X、Reddit、HackerNews 等 [
|
|
13
|
+
- **直接使用现成适配器**:B站、知乎、小红书、Twitter/X、Reddit、HackerNews 等 [100+ 站点](#内置命令) 开箱即用。
|
|
14
14
|
- **让 AI Agent 操作任意网站**:在你的 AI Agent(Claude Code、Cursor 等)中安装 `opencli-adapter-author` skill,Agent 就能用你的已登录浏览器导航、点击、输入、提取任意网页内容。
|
|
15
15
|
- **把新网站写成 CLI**:用 `opencli browser` 原语 + `opencli-adapter-author` skill,从站点侦察、API 发现、字段解码到 `opencli browser verify` 一条龙。
|
|
16
16
|
|
|
@@ -20,7 +20,7 @@ OpenCLI 可以用同一套 CLI 做三类事情:
|
|
|
20
20
|
|
|
21
21
|
- **桌面应用控制** — 通过 CDP 直接在终端驱动 Electron 应用(Cursor、Codex、ChatGPT、Notion 等)。
|
|
22
22
|
- **AI Agent 浏览器自动化** — 安装 `opencli-adapter-author` skill,你的 AI Agent 就能操作任意网站:导航、点击、输入、提取、截图——全部通过你的已登录 Chrome 会话完成。
|
|
23
|
-
- **网站 → CLI** — 把任何网站变成确定性 CLI:
|
|
23
|
+
- **网站 → CLI** — 把任何网站变成确定性 CLI:100+ 站点能力已注册,或用 `opencli-adapter-author` skill + `opencli browser verify` 自己写。
|
|
24
24
|
- **账号安全** — 复用 Chrome/Chromium 登录态,凭证永远不会离开浏览器。
|
|
25
25
|
- **面向 AI Agent** — 一个 skill 带你走完站点侦察、API 发现、字段解码、适配器编写、验证的全流程。
|
|
26
26
|
- **CLI 枢纽** — 统一发现、自动安装、纯透传任何外部 CLI(gh、docker、obsidian 等)。
|
|
@@ -31,7 +31,10 @@ OpenCLI 可以用同一套 CLI 做三类事情:
|
|
|
31
31
|
|
|
32
32
|
### 1. 安装 OpenCLI
|
|
33
33
|
|
|
34
|
+
OpenCLI 要求 **Node.js >= 21**。
|
|
35
|
+
|
|
34
36
|
```bash
|
|
37
|
+
node --version
|
|
35
38
|
npm install -g @jackwener/opencli
|
|
36
39
|
```
|
|
37
40
|
|
|
@@ -39,6 +42,10 @@ npm install -g @jackwener/opencli
|
|
|
39
42
|
|
|
40
43
|
OpenCLI 通过轻量 Browser Bridge 扩展和本地微型 daemon 与 Chrome/Chromium 通信。daemon 会按需自动启动。
|
|
41
44
|
|
|
45
|
+
**方式 A — Chrome Web Store(推荐):**
|
|
46
|
+
在 [Chrome Web Store](https://chromewebstore.google.com/detail/opencli/ildkmabpimmkaediidaifkhjpohdnifk) 安装 **OpenCLI** 扩展。
|
|
47
|
+
|
|
48
|
+
**方式 B — 手动安装:**
|
|
42
49
|
1. 到 GitHub [Releases 页面](https://github.com/jackwener/opencli/releases) 下载最新的 `opencli-extension-v{version}.zip`。
|
|
43
50
|
2. 解压后打开 `chrome://extensions`,启用 **开发者模式**。
|
|
44
51
|
3. 点击 **加载已解压的扩展程序**,选择解压后的目录。
|
|
@@ -63,9 +70,21 @@ opencli bilibili hot --limit 5
|
|
|
63
70
|
|
|
64
71
|
- `opencli list` 查看当前所有命令
|
|
65
72
|
- `opencli <site> <command>` 调用内置或生成好的适配器
|
|
66
|
-
- `opencli register mycli` 把本地 CLI 接入同一发现入口
|
|
73
|
+
- `opencli external register mycli` 把本地 CLI 接入同一发现入口
|
|
67
74
|
- `opencli doctor` 处理浏览器连通性问题
|
|
68
75
|
|
|
76
|
+
## 扩展 OpenCLI
|
|
77
|
+
|
|
78
|
+
如果你想新增自己的命令,先看 [扩展 OpenCLI](./docs/zh/guide/extending-opencli.md)。README 只保留入口;目录结构、源码管理方式和安装命令放在文档里。
|
|
79
|
+
|
|
80
|
+
| 需求 | 推荐路径 |
|
|
81
|
+
|------|----------|
|
|
82
|
+
| 把个人网站命令放在自己的 Git repo | `opencli plugin create` + `opencli plugin install file://...` |
|
|
83
|
+
| 快速写一个本机私人 adapter | `opencli browser init <site>/<command>`,放在 `~/.opencli/clis/` |
|
|
84
|
+
| 本地修改官方 adapter | `opencli adapter eject/status/reset` |
|
|
85
|
+
| 发布或安装第三方命令 | `opencli plugin install github:user/repo` |
|
|
86
|
+
| 包装已有本机 binary | `opencli external register <name>` |
|
|
87
|
+
|
|
69
88
|
## 给 AI Agent
|
|
70
89
|
|
|
71
90
|
OpenCLI 的 browser 命令是给 AI Agent 用的——不是手动执行的。把 skill 安装到你的 AI Agent(Claude Code、Cursor 等)中,Agent 就能用你的已登录 Chrome 会话替你操作网站。
|
|
@@ -151,7 +170,8 @@ OpenCLI 不只是网站 CLI,还可以:
|
|
|
151
170
|
|
|
152
171
|
## 前置要求
|
|
153
172
|
|
|
154
|
-
- **Node.js**: >= 21.0.0
|
|
173
|
+
- **Node.js**: >= 21.0.0(标准 npm 安装路径要求)
|
|
174
|
+
- **Bun**: >= 1.0(可选替代运行时)
|
|
155
175
|
- 浏览器型命令需要 Chrome 或 Chromium 处于运行中,并已登录目标网站
|
|
156
176
|
|
|
157
177
|
> **重要**:浏览器型命令直接复用你的 Chrome/Chromium 登录态。如果拿到空数据或出现权限类失败,先确认目标站点已经在浏览器里打开并完成登录。
|
|
@@ -168,7 +188,6 @@ OpenCLI 不只是网站 CLI,还可以:
|
|
|
168
188
|
| `OPENCLI_CDP_ENDPOINT` | — | Chrome DevTools Protocol 端点,用于远程浏览器或 Electron 应用 |
|
|
169
189
|
| `OPENCLI_CDP_TARGET` | — | 按 URL 子串过滤 CDP target(如 `detail.1688.com`) |
|
|
170
190
|
| `OPENCLI_VERBOSE` | `false` | 启用详细日志(`-v` 也可以) |
|
|
171
|
-
| `OPENCLI_DIAGNOSTIC` | `false` | 设为 `1` 时在失败时输出结构化诊断上下文 |
|
|
172
191
|
| `DEBUG_SNAPSHOT` | — | 设为 `1` 输出 DOM 快照调试信息 |
|
|
173
192
|
|
|
174
193
|
`--focus` 同时适用于 `opencli browser *` 和浏览器型 adapter 命令。`--live` 主要是给 adapter 命令用的:`browser` 子命令本来就会一直保留 automation window,直到你手动执行 `opencli browser close` 或等空闲超时。
|
|
@@ -235,7 +254,7 @@ npm link
|
|
|
235
254
|
| **uiverse** | `code` `preview` | 浏览器 |
|
|
236
255
|
| **apple-podcasts** | `search` `episodes` `top` | 公开 |
|
|
237
256
|
| **baidu-scholar** | `search` | 公开 |
|
|
238
|
-
| **google-scholar** | `search` | 公开 |
|
|
257
|
+
| **google-scholar** | `search` `cite` `profile` | 公开 |
|
|
239
258
|
| **gov-law** | `search` `recent` | 公开 |
|
|
240
259
|
| **gov-policy** | `search` `recent` | 公开 |
|
|
241
260
|
| **nowcoder** | `hot` `trending` `topics` `recommend` `creators` `companies` `jobs` `search` `suggest` `experience` `referral` `salary` `papers` `practice` `notifications` `detail` | 公开 / 浏览器 |
|
|
@@ -281,6 +300,7 @@ npm link
|
|
|
281
300
|
| **1688** | `search` `item` `assets` `download` `store` | 浏览器 |
|
|
282
301
|
| **gitee** | `trending` `search` `user` | 公开 / 浏览器 |
|
|
283
302
|
| **gemini** | `new` `ask` `image` `deep-research` `deep-research-result` | 浏览器 |
|
|
303
|
+
| **claude** | `ask` `send` `new` `status` `read` `history` `detail` | 浏览器 |
|
|
284
304
|
| **spotify** | `auth` `status` `play` `pause` `next` `prev` `volume` `search` `queue` `shuffle` `repeat` | OAuth API |
|
|
285
305
|
| **notebooklm** | `status` `list` `open` `current` `get` `history` `summary` `note-list` `notes-get` `source-list` `source-get` `source-fulltext` `source-guide` | 浏览器 |
|
|
286
306
|
| **36kr** | `news` `hot` `search` `article` | 公开 / 浏览器 |
|
|
@@ -298,7 +318,7 @@ npm link
|
|
|
298
318
|
| **douyin** | `videos` `publish` `drafts` `draft` `delete` `stats` `profile` `update` `hashtag` `location` `activities` `collections` | 浏览器 |
|
|
299
319
|
| **yuanbao** | `new` `ask` | 浏览器 |
|
|
300
320
|
|
|
301
|
-
|
|
321
|
+
100+ 站点能力 — **[→ 查看完整命令列表](./docs/adapters/index.md)**
|
|
302
322
|
|
|
303
323
|
`*` `opencli xiaoyuzhou podcast`、`podcast-episodes`、`episode`、`download`、`transcript` 需要本地小宇宙凭证:`~/.opencli/xiaoyuzhou.json`。
|
|
304
324
|
|
|
@@ -493,13 +513,13 @@ opencli plugin uninstall my-tool # 卸载
|
|
|
493
513
|
## 常见问题排查
|
|
494
514
|
|
|
495
515
|
- **"Extension not connected" 报错**
|
|
496
|
-
-
|
|
516
|
+
- 确保你已从 [Chrome Web Store](https://chromewebstore.google.com/detail/opencli/ildkmabpimmkaediidaifkhjpohdnifk) 安装 OpenCLI 扩展,且在 `chrome://extensions` 中**已启用**。
|
|
497
517
|
- **"attach failed: Cannot access a chrome-extension:// URL" 报错**
|
|
498
518
|
- 其他 Chrome/Chromium 扩展(如 youmind、New Tab Override 或 AI 助手类扩展)可能产生冲突。请尝试**暂时禁用其他扩展**后重试。
|
|
499
519
|
- **返回空数据,或者报错 "Unauthorized"**
|
|
500
520
|
- Chrome/Chromium 里的登录态可能已经过期。请打开当前页面,在新标签页重新手工登录或刷新该页面。
|
|
501
|
-
- **Node API 错误
|
|
502
|
-
-
|
|
521
|
+
- **Node API 错误 / 缺少 `fetch` / 旧 Node 启动即崩**
|
|
522
|
+
- OpenCLI 要求 **Node.js >= 21**。先执行 `node --version`,如果版本过低先升级,再重试命令。
|
|
503
523
|
- **Daemon 问题**
|
|
504
524
|
- 检查 daemon 状态:`curl localhost:19825/status`
|
|
505
525
|
- 查看扩展日志:`curl localhost:19825/logs`
|