@jackwener/opencli 1.7.3 → 1.7.4
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 +16 -16
- package/README.zh-CN.md +28 -15
- package/cli-manifest.json +547 -10
- package/clis/bilibili/favorite.js +18 -13
- package/clis/binance/depth.js +3 -4
- package/clis/boss/utils.js +2 -3
- package/clis/chatgpt-app/ax.js +6 -3
- package/clis/douban/search.js +1 -0
- package/clis/douban/search.test.js +11 -0
- package/clis/douban/subject.js +20 -93
- package/clis/douban/subject.test.js +11 -0
- package/clis/douban/utils.js +250 -8
- package/clis/douban/utils.test.js +179 -4
- package/clis/doubao/utils.js +319 -130
- package/clis/doubao/utils.test.js +241 -2
- package/clis/eastmoney/hot-rank.js +50 -0
- package/clis/eastmoney/hot-rank.test.js +59 -0
- package/clis/grok/image.test.ts +107 -0
- package/clis/grok/image.ts +356 -0
- package/clis/tdx/hot-rank.js +47 -0
- package/clis/tdx/hot-rank.test.js +59 -0
- package/clis/ths/hot-rank.js +49 -0
- package/clis/ths/hot-rank.test.js +64 -0
- package/clis/twitter/bookmarks.js +2 -1
- package/clis/uiverse/_shared.js +368 -0
- package/clis/uiverse/_shared.test.js +55 -0
- package/clis/uiverse/code.js +47 -0
- package/clis/uiverse/preview.js +71 -0
- package/clis/xiaohongshu/comments.js +2 -2
- package/clis/xiaohongshu/comments.test.js +46 -25
- package/clis/xiaohongshu/download.js +6 -7
- package/clis/xiaohongshu/download.test.js +17 -5
- package/clis/xiaohongshu/note-helpers.js +46 -12
- package/clis/xiaohongshu/note.js +3 -5
- package/clis/xiaohongshu/note.test.js +52 -25
- package/clis/xiaoyuzhou/auth.js +303 -0
- package/clis/xiaoyuzhou/auth.test.js +124 -0
- package/clis/xiaoyuzhou/download.js +49 -0
- package/clis/xiaoyuzhou/download.test.js +125 -0
- package/clis/xiaoyuzhou/transcript.js +76 -0
- package/clis/xiaoyuzhou/transcript.test.js +195 -0
- package/clis/youtube/feed.js +120 -0
- package/clis/youtube/history.js +118 -0
- package/clis/youtube/like.js +62 -0
- package/clis/youtube/playlist.js +97 -0
- package/clis/youtube/subscribe.js +71 -0
- package/clis/youtube/subscriptions.js +57 -0
- package/clis/youtube/unlike.js +62 -0
- package/clis/youtube/unsubscribe.js +71 -0
- package/clis/youtube/utils.js +122 -0
- package/clis/youtube/utils.test.js +32 -1
- package/clis/youtube/watch-later.js +76 -0
- package/dist/src/browser/base-page.js +25 -5
- package/dist/src/browser/bridge.d.ts +2 -0
- package/dist/src/browser/bridge.js +51 -14
- package/dist/src/browser/cdp.js +1 -0
- package/dist/src/browser/daemon-client.d.ts +1 -0
- package/dist/src/browser/dom-snapshot.js +13 -1
- package/dist/src/browser/page.d.ts +4 -1
- package/dist/src/browser/page.js +48 -8
- package/dist/src/browser/page.test.js +61 -1
- package/dist/src/browser/target-errors.d.ts +23 -0
- package/dist/src/browser/target-errors.js +29 -0
- package/dist/src/browser/target-errors.test.d.ts +1 -0
- package/dist/src/browser/target-errors.test.js +61 -0
- package/dist/src/browser/target-resolver.d.ts +57 -0
- package/dist/src/browser/target-resolver.js +298 -0
- package/dist/src/browser/target-resolver.test.d.ts +1 -0
- package/dist/src/browser/target-resolver.test.js +43 -0
- package/dist/src/browser.test.js +38 -1
- package/dist/src/cli.js +45 -37
- package/dist/src/commands/daemon.d.ts +4 -2
- package/dist/src/commands/daemon.js +22 -2
- package/dist/src/commands/daemon.test.js +65 -2
- package/dist/src/daemon.js +2 -0
- package/dist/src/doctor.d.ts +1 -0
- package/dist/src/doctor.js +32 -9
- package/dist/src/doctor.test.js +28 -12
- package/dist/src/external-clis.yaml +2 -2
- package/dist/src/logger.d.ts +2 -2
- package/dist/src/logger.js +3 -3
- package/dist/src/output.js +1 -5
- package/dist/src/output.test.js +0 -21
- package/dist/src/pipeline/steps/transform.js +1 -1
- package/dist/src/pipeline/template.d.ts +1 -0
- package/dist/src/pipeline/template.js +11 -3
- package/dist/src/pipeline/template.test.js +3 -0
- package/dist/src/pipeline/transform.test.js +14 -0
- package/dist/src/plugin.d.ts +7 -1
- package/dist/src/plugin.js +23 -1
- package/dist/src/plugin.test.js +15 -1
- package/dist/src/types.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,24 +16,16 @@ OpenCLI gives you one surface for three different kinds of automation:
|
|
|
16
16
|
|
|
17
17
|
It also works as a **CLI hub** for local tools such as `gh`, `docker`, and other binaries you register yourself, plus **desktop app adapters** for Electron apps like Cursor, Codex, Antigravity, ChatGPT, and Notion.
|
|
18
18
|
|
|
19
|
-
## Why OpenCLI
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
19
|
## Highlights
|
|
24
20
|
|
|
25
|
-
- **
|
|
26
|
-
- **Browser Automation** — `browser` gives AI agents direct browser control: click, type, extract, screenshot —
|
|
27
|
-
- **Website → CLI** — Turn any website into a deterministic CLI: 87+ pre-built adapters, or
|
|
21
|
+
- **Desktop App Control** — Drive Electron apps (Cursor, Codex, ChatGPT, Notion, etc.) directly from the terminal via CDP.
|
|
22
|
+
- **Browser Automation** — `browser` gives AI agents direct browser control: click, type, extract, screenshot — fully scriptable.
|
|
23
|
+
- **Website → CLI** — Turn any website into a deterministic CLI: 87+ pre-built adapters, or generate your own with `opencli generate`.
|
|
28
24
|
- **Account-safe** — Reuses Chrome/Chromium logged-in state; your credentials never leave the browser.
|
|
29
|
-
- **Anti-detection built-in** — Patches `navigator.webdriver`, stubs `window.chrome`, fakes plugin lists, cleans ChromeDriver/Playwright globals, and strips CDP frames from Error stack traces. Extensive anti-fingerprinting and risk-control evasion measures baked in at every layer.
|
|
30
25
|
- **AI Agent ready** — `explore` discovers APIs, `synthesize` generates adapters, `cascade` finds auth strategies, `browser` controls the browser directly.
|
|
31
|
-
- **
|
|
32
|
-
- **Self-healing setup** — `opencli doctor` diagnoses and auto-starts the daemon, extension, and live browser connectivity.
|
|
33
|
-
- **Dynamic Loader** — Simply drop `.js` adapters into the `clis/` folder for auto-registration.
|
|
26
|
+
- **CLI Hub** — Discover, auto-install, and passthrough commands to any external CLI (gh, docker, obsidian, etc).
|
|
34
27
|
- **Zero LLM cost** — No tokens consumed at runtime. Run 10,000 times and pay nothing.
|
|
35
28
|
- **Deterministic** — Same command, same output schema, every time. Pipeable, scriptable, CI-friendly.
|
|
36
|
-
- **Broad coverage** — 87+ sites across global and Chinese platforms (Bilibili, Zhihu, Xiaohongshu, Reddit, HackerNews, and more), plus desktop Electron apps via CDP.
|
|
37
29
|
|
|
38
30
|
---
|
|
39
31
|
|
|
@@ -49,7 +41,7 @@ npm install -g @jackwener/opencli
|
|
|
49
41
|
|
|
50
42
|
OpenCLI connects to Chrome/Chromium through a lightweight Browser Bridge extension plus a small local daemon. The daemon auto-starts when needed.
|
|
51
43
|
|
|
52
|
-
1. Download the latest `opencli-extension.zip` from the GitHub [Releases page](https://github.com/jackwener/opencli/releases).
|
|
44
|
+
1. Download the latest `opencli-extension-v{version}.zip` from the GitHub [Releases page](https://github.com/jackwener/opencli/releases).
|
|
53
45
|
2. Unzip it, open `chrome://extensions`, and enable **Developer mode**.
|
|
54
46
|
3. Click **Load unpacked** and select the unzipped folder.
|
|
55
47
|
|
|
@@ -154,8 +146,6 @@ OpenCLI is not only for websites. It can also:
|
|
|
154
146
|
| `OPENCLI_CDP_TARGET` | — | Filter CDP targets by URL substring (e.g. `detail.1688.com`) |
|
|
155
147
|
| `OPENCLI_VERBOSE` | `false` | Enable verbose logging (`-v` flag also works) |
|
|
156
148
|
| `OPENCLI_DIAGNOSTIC` | `false` | Set to `1` to capture structured diagnostic context on failures |
|
|
157
|
-
| `OUTPUT` | — | Override output format: `json`, `yaml`, or `table` |
|
|
158
|
-
| `DEBUG` | — | Set to `opencli` for internal debug logging |
|
|
159
149
|
| `DEBUG_SNAPSHOT` | — | Set to `1` for DOM snapshot debug output |
|
|
160
150
|
|
|
161
151
|
## Update
|
|
@@ -214,9 +204,13 @@ To load the source Browser Bridge extension:
|
|
|
214
204
|
| **xianyu** | `search` `item` `chat` |
|
|
215
205
|
| **xiaoe** | `courses` `detail` `catalog` `play-url` `content` |
|
|
216
206
|
| **quark** | `ls` `mkdir` `mv` `rename` `rm` `save` `share-tree` |
|
|
207
|
+
| **uiverse** | `code` `preview` |
|
|
208
|
+
| **xiaoyuzhou** | `podcast` `podcast-episodes` `episode` `download` `transcript*` |
|
|
217
209
|
|
|
218
210
|
87+ adapters in total — **[→ see all supported sites & commands](./docs/adapters/index.md)**
|
|
219
211
|
|
|
212
|
+
`*` `opencli xiaoyuzhou transcript` requires local Xiaoyuzhou credentials in `~/.opencli/xiaoyuzhou.json`.
|
|
213
|
+
|
|
220
214
|
## CLI Hub
|
|
221
215
|
|
|
222
216
|
OpenCLI acts as a universal hub for your existing command-line tools — unified discovery, pure passthrough execution, and auto-install (if a tool isn't installed, OpenCLI runs `brew install <tool>` automatically before re-running the command).
|
|
@@ -266,18 +260,24 @@ OpenCLI supports downloading images, videos, and articles from supported platfor
|
|
|
266
260
|
| **douban** | Images | Poster / still image lists |
|
|
267
261
|
| **pixiv** | Images | Original-quality illustrations, multi-page |
|
|
268
262
|
| **1688** | Images, Videos | Downloads page-visible product media from item pages |
|
|
263
|
+
| **xiaoyuzhou** | Audio, Transcript | Downloads episode audio from public pages and transcript JSON/text with local credentials |
|
|
269
264
|
| **zhihu** | Articles (Markdown) | Exports with optional image download |
|
|
270
265
|
| **weixin** | Articles (Markdown) | WeChat Official Account articles |
|
|
271
266
|
|
|
272
267
|
For video downloads, install `yt-dlp` first: `brew install yt-dlp`
|
|
273
268
|
|
|
274
269
|
```bash
|
|
275
|
-
opencli xiaohongshu download
|
|
270
|
+
opencli xiaohongshu download "https://www.xiaohongshu.com/search_result/<id>?xsec_token=..." --output ./xhs
|
|
271
|
+
opencli xiaohongshu download "https://xhslink.com/..." --output ./xhs
|
|
276
272
|
opencli bilibili download BV1xxx --output ./bilibili
|
|
277
273
|
opencli twitter download elonmusk --limit 20 --output ./twitter
|
|
278
274
|
opencli 1688 download 841141931191 --output ./1688-downloads
|
|
275
|
+
opencli xiaoyuzhou download 69b3b675772ac2295bfc01d0 --output ./xiaoyuzhou
|
|
276
|
+
opencli xiaoyuzhou transcript 69dd0c98e2c8be31551f6a33 --output ./xiaoyuzhou-transcripts
|
|
279
277
|
```
|
|
280
278
|
|
|
279
|
+
`opencli xiaoyuzhou transcript` requires local Xiaoyuzhou credentials in `~/.opencli/xiaoyuzhou.json`.
|
|
280
|
+
|
|
281
281
|
## Output Formats
|
|
282
282
|
|
|
283
283
|
All built-in commands support `--format` / `-f` with `table` (default), `json`, `yaml`, `md`, and `csv`.
|
package/README.zh-CN.md
CHANGED
|
@@ -16,14 +16,16 @@ OpenCLI 可以用同一套 CLI 做三类事情:
|
|
|
16
16
|
|
|
17
17
|
除了网站能力,OpenCLI 还是一个 **CLI 枢纽**:你可以把 `gh`、`docker` 等本地工具统一注册到 `opencli` 下,也可以通过桌面端适配器控制 Cursor、Codex、Antigravity、ChatGPT、Notion 等 Electron 应用。
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## 亮点
|
|
20
20
|
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
21
|
+
- **桌面应用控制** — 通过 CDP 直接在终端驱动 Electron 应用(Cursor、Codex、ChatGPT、Notion 等)。
|
|
22
|
+
- **浏览器自动化** — `browser` 让 AI Agent 直接控制浏览器:点击、输入、提取、截图,完全可编程。
|
|
23
|
+
- **网站 → CLI** — 把任何网站变成确定性 CLI:87+ 内置适配器,或用 `opencli generate` 生成新的。
|
|
24
|
+
- **账号安全** — 复用 Chrome/Chromium 登录态,凭证永远不会离开浏览器。
|
|
25
|
+
- **面向 AI Agent** — `explore` 发现 API,`synthesize` 生成适配器,`cascade` 探测认证策略,`browser` 直接控制浏览器。
|
|
26
|
+
- **CLI 枢纽** — 统一发现、自动安装、纯透传任何外部 CLI(gh、docker、obsidian 等)。
|
|
27
|
+
- **零 LLM 成本** — 运行时不消耗模型 token,跑 10,000 次也不花一分钱。
|
|
28
|
+
- **确定性输出** — 相同命令,相同输出结构,每次一致。可管道、可脚本、CI 友好。
|
|
27
29
|
|
|
28
30
|
## 快速开始
|
|
29
31
|
|
|
@@ -37,7 +39,7 @@ npm install -g @jackwener/opencli
|
|
|
37
39
|
|
|
38
40
|
OpenCLI 通过轻量 Browser Bridge 扩展和本地微型 daemon 与 Chrome/Chromium 通信。daemon 会按需自动启动。
|
|
39
41
|
|
|
40
|
-
1. 到 GitHub [Releases 页面](https://github.com/jackwener/opencli/releases) 下载最新的 `opencli-extension.zip`。
|
|
42
|
+
1. 到 GitHub [Releases 页面](https://github.com/jackwener/opencli/releases) 下载最新的 `opencli-extension-v{version}.zip`。
|
|
41
43
|
2. 解压后打开 `chrome://extensions`,启用 **开发者模式**。
|
|
42
44
|
3. 点击 **加载已解压的扩展程序**,选择解压后的目录。
|
|
43
45
|
|
|
@@ -142,8 +144,6 @@ OpenCLI 不只是网站 CLI,还可以:
|
|
|
142
144
|
| `OPENCLI_CDP_TARGET` | — | 按 URL 子串过滤 CDP target(如 `detail.1688.com`) |
|
|
143
145
|
| `OPENCLI_VERBOSE` | `false` | 启用详细日志(`-v` 也可以) |
|
|
144
146
|
| `OPENCLI_DIAGNOSTIC` | `false` | 设为 `1` 时在失败时输出结构化诊断上下文 |
|
|
145
|
-
| `OUTPUT` | — | 覆盖输出格式:`json`、`yaml` 或 `table` |
|
|
146
|
-
| `DEBUG` | — | 设为 `opencli` 开启内部调试日志 |
|
|
147
147
|
| `DEBUG_SNAPSHOT` | — | 设为 `1` 输出 DOM 快照调试信息 |
|
|
148
148
|
|
|
149
149
|
## 更新
|
|
@@ -187,7 +187,7 @@ npm link
|
|
|
187
187
|
|
|
188
188
|
| 站点 | 命令 | 模式 |
|
|
189
189
|
|------|------|------|
|
|
190
|
-
| **twitter** | `trending` `search` `timeline` `lists` `bookmarks` `profile` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` `block` `unblock` `hide-reply` | 浏览器 |
|
|
190
|
+
| **twitter** | `trending` `search` `timeline` `lists` `bookmarks` `profile` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `likes` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` `block` `unblock` `hide-reply` | 浏览器 |
|
|
191
191
|
| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` | 浏览器 |
|
|
192
192
|
| **tieba** | `hot` `posts` `search` `read` | 浏览器 |
|
|
193
193
|
| **hupu** | `hot` `search` `detail` `mentions` `reply` `like` `unlike` | 浏览器 |
|
|
@@ -206,11 +206,12 @@ npm link
|
|
|
206
206
|
| **xiaohongshu** | `search` `notifications` `feed` `user` `download` `publish` `creator-notes` `creator-note-detail` `creator-notes-summary` `creator-profile` `creator-stats` | 浏览器 |
|
|
207
207
|
| **xiaoe** | `courses` `detail` `catalog` `play-url` `content` | 浏览器 |
|
|
208
208
|
| **quark** | `ls` `mkdir` `mv` `rename` `rm` `save` `share-tree` | 浏览器 |
|
|
209
|
+
| **uiverse** | `code` `preview` | 浏览器 |
|
|
209
210
|
| **apple-podcasts** | `search` `episodes` `top` | 公开 |
|
|
210
|
-
| **xiaoyuzhou** | `podcast` `podcast-episodes` `episode` | 公开 |
|
|
211
|
+
| **xiaoyuzhou** | `podcast` `podcast-episodes` `episode` `download` `transcript*` | 公开 |
|
|
211
212
|
| **zhihu** | `hot` `search` `question` `download` `follow` `like` `favorite` `comment` `answer` | 浏览器 |
|
|
212
213
|
| **weixin** | `download` | 浏览器 |
|
|
213
|
-
| **youtube** | `search` `video` `transcript` | 浏览器 |
|
|
214
|
+
| **youtube** | `search` `video` `transcript` `comments` `channel` `playlist` `feed` `history` `watch-later` `subscriptions` `like` `unlike` `subscribe` `unsubscribe` | 浏览器 |
|
|
214
215
|
| **boss** | `search` `detail` `recommend` `joblist` `greet` `batchgreet` `send` `chatlist` `chatmsg` `invite` `mark` `exchange` `resume` `stats` | 浏览器 |
|
|
215
216
|
| **coupang** | `search` `add-to-cart` | 浏览器 |
|
|
216
217
|
| **bbc** | `news` | 公共 API |
|
|
@@ -232,7 +233,7 @@ npm link
|
|
|
232
233
|
| **sinafinance** | `news` | 🌐 公开 |
|
|
233
234
|
| **barchart** | `quote` `options` `greeks` `flow` | 浏览器 |
|
|
234
235
|
| **chaoxing** | `assignments` `exams` | 浏览器 |
|
|
235
|
-
| **grok** | `ask` | 浏览器 |
|
|
236
|
+
| **grok** | `ask` `image` | 浏览器 |
|
|
236
237
|
| **hf** | `top` | 公开 |
|
|
237
238
|
| **jike** | `feed` `search` `create` `like` `comment` `repost` `notifications` `post` `topic` `user` | 浏览器 |
|
|
238
239
|
| **jimeng** | `generate` `history` | 浏览器 |
|
|
@@ -267,6 +268,8 @@ npm link
|
|
|
267
268
|
|
|
268
269
|
87+ 适配器 — **[→ 查看完整命令列表](./docs/adapters/index.md)**
|
|
269
270
|
|
|
271
|
+
`*` `opencli xiaoyuzhou transcript` 需要本地小宇宙凭证:`~/.opencli/xiaoyuzhou.json`。
|
|
272
|
+
|
|
270
273
|
### 外部 CLI 枢纽
|
|
271
274
|
|
|
272
275
|
OpenCLI 也可以作为你现有命令行工具的统一入口,负责发现、自动安装和纯透传执行。
|
|
@@ -319,6 +322,7 @@ OpenCLI 支持从各平台下载图片、视频和文章。
|
|
|
319
322
|
| **Twitter/X** | 图片、视频 | 从用户媒体页或单条推文下载 |
|
|
320
323
|
| **Pixiv** | 图片 | 下载原始画质插画,支持多页作品 |
|
|
321
324
|
| **1688** | 图片、视频 | 下载商品页中可见的商品素材 |
|
|
325
|
+
| **小宇宙** | 音频、转录 | 从公开单集数据下载音频,并使用本地凭证下载转录 JSON / 文本 |
|
|
322
326
|
| **知乎** | 文章(Markdown) | 导出文章,可选下载图片到本地 |
|
|
323
327
|
| **微信公众号** | 文章(Markdown) | 导出微信公众号文章为 Markdown |
|
|
324
328
|
| **豆瓣** | 图片 | 下载电影条目的海报 / 剧照图片 |
|
|
@@ -338,7 +342,8 @@ brew install yt-dlp
|
|
|
338
342
|
|
|
339
343
|
```bash
|
|
340
344
|
# 下载小红书笔记中的图片/视频
|
|
341
|
-
opencli xiaohongshu download
|
|
345
|
+
opencli xiaohongshu download "https://www.xiaohongshu.com/search_result/<id>?xsec_token=..." --output ./xhs
|
|
346
|
+
opencli xiaohongshu download "https://xhslink.com/..." --output ./xhs
|
|
342
347
|
|
|
343
348
|
# 下载B站视频(需要 yt-dlp)
|
|
344
349
|
opencli bilibili download BV1xxx --output ./bilibili
|
|
@@ -356,6 +361,12 @@ opencli douban download 30382501 --output ./douban
|
|
|
356
361
|
# 下载 1688 商品页中的图片 / 视频素材
|
|
357
362
|
opencli 1688 download 841141931191 --output ./1688-downloads
|
|
358
363
|
|
|
364
|
+
# 下载小宇宙单集音频
|
|
365
|
+
opencli xiaoyuzhou download 69b3b675772ac2295bfc01d0 --output ./xiaoyuzhou
|
|
366
|
+
|
|
367
|
+
# 下载小宇宙单集转录
|
|
368
|
+
opencli xiaoyuzhou transcript 69dd0c98e2c8be31551f6a33 --output ./xiaoyuzhou-transcripts
|
|
369
|
+
|
|
359
370
|
# 导出知乎文章为 Markdown
|
|
360
371
|
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu
|
|
361
372
|
|
|
@@ -366,6 +377,8 @@ opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --download-images
|
|
|
366
377
|
opencli weixin download --url "https://mp.weixin.qq.com/s/xxx" --output ./weixin
|
|
367
378
|
```
|
|
368
379
|
|
|
380
|
+
`opencli xiaoyuzhou transcript` 需要本地小宇宙凭证:`~/.opencli/xiaoyuzhou.json`。
|
|
381
|
+
|
|
369
382
|
|
|
370
383
|
|
|
371
384
|
## 输出格式
|