@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.
Files changed (93) hide show
  1. package/README.md +16 -16
  2. package/README.zh-CN.md +28 -15
  3. package/cli-manifest.json +547 -10
  4. package/clis/bilibili/favorite.js +18 -13
  5. package/clis/binance/depth.js +3 -4
  6. package/clis/boss/utils.js +2 -3
  7. package/clis/chatgpt-app/ax.js +6 -3
  8. package/clis/douban/search.js +1 -0
  9. package/clis/douban/search.test.js +11 -0
  10. package/clis/douban/subject.js +20 -93
  11. package/clis/douban/subject.test.js +11 -0
  12. package/clis/douban/utils.js +250 -8
  13. package/clis/douban/utils.test.js +179 -4
  14. package/clis/doubao/utils.js +319 -130
  15. package/clis/doubao/utils.test.js +241 -2
  16. package/clis/eastmoney/hot-rank.js +50 -0
  17. package/clis/eastmoney/hot-rank.test.js +59 -0
  18. package/clis/grok/image.test.ts +107 -0
  19. package/clis/grok/image.ts +356 -0
  20. package/clis/tdx/hot-rank.js +47 -0
  21. package/clis/tdx/hot-rank.test.js +59 -0
  22. package/clis/ths/hot-rank.js +49 -0
  23. package/clis/ths/hot-rank.test.js +64 -0
  24. package/clis/twitter/bookmarks.js +2 -1
  25. package/clis/uiverse/_shared.js +368 -0
  26. package/clis/uiverse/_shared.test.js +55 -0
  27. package/clis/uiverse/code.js +47 -0
  28. package/clis/uiverse/preview.js +71 -0
  29. package/clis/xiaohongshu/comments.js +2 -2
  30. package/clis/xiaohongshu/comments.test.js +46 -25
  31. package/clis/xiaohongshu/download.js +6 -7
  32. package/clis/xiaohongshu/download.test.js +17 -5
  33. package/clis/xiaohongshu/note-helpers.js +46 -12
  34. package/clis/xiaohongshu/note.js +3 -5
  35. package/clis/xiaohongshu/note.test.js +52 -25
  36. package/clis/xiaoyuzhou/auth.js +303 -0
  37. package/clis/xiaoyuzhou/auth.test.js +124 -0
  38. package/clis/xiaoyuzhou/download.js +49 -0
  39. package/clis/xiaoyuzhou/download.test.js +125 -0
  40. package/clis/xiaoyuzhou/transcript.js +76 -0
  41. package/clis/xiaoyuzhou/transcript.test.js +195 -0
  42. package/clis/youtube/feed.js +120 -0
  43. package/clis/youtube/history.js +118 -0
  44. package/clis/youtube/like.js +62 -0
  45. package/clis/youtube/playlist.js +97 -0
  46. package/clis/youtube/subscribe.js +71 -0
  47. package/clis/youtube/subscriptions.js +57 -0
  48. package/clis/youtube/unlike.js +62 -0
  49. package/clis/youtube/unsubscribe.js +71 -0
  50. package/clis/youtube/utils.js +122 -0
  51. package/clis/youtube/utils.test.js +32 -1
  52. package/clis/youtube/watch-later.js +76 -0
  53. package/dist/src/browser/base-page.js +25 -5
  54. package/dist/src/browser/bridge.d.ts +2 -0
  55. package/dist/src/browser/bridge.js +51 -14
  56. package/dist/src/browser/cdp.js +1 -0
  57. package/dist/src/browser/daemon-client.d.ts +1 -0
  58. package/dist/src/browser/dom-snapshot.js +13 -1
  59. package/dist/src/browser/page.d.ts +4 -1
  60. package/dist/src/browser/page.js +48 -8
  61. package/dist/src/browser/page.test.js +61 -1
  62. package/dist/src/browser/target-errors.d.ts +23 -0
  63. package/dist/src/browser/target-errors.js +29 -0
  64. package/dist/src/browser/target-errors.test.d.ts +1 -0
  65. package/dist/src/browser/target-errors.test.js +61 -0
  66. package/dist/src/browser/target-resolver.d.ts +57 -0
  67. package/dist/src/browser/target-resolver.js +298 -0
  68. package/dist/src/browser/target-resolver.test.d.ts +1 -0
  69. package/dist/src/browser/target-resolver.test.js +43 -0
  70. package/dist/src/browser.test.js +38 -1
  71. package/dist/src/cli.js +45 -37
  72. package/dist/src/commands/daemon.d.ts +4 -2
  73. package/dist/src/commands/daemon.js +22 -2
  74. package/dist/src/commands/daemon.test.js +65 -2
  75. package/dist/src/daemon.js +2 -0
  76. package/dist/src/doctor.d.ts +1 -0
  77. package/dist/src/doctor.js +32 -9
  78. package/dist/src/doctor.test.js +28 -12
  79. package/dist/src/external-clis.yaml +2 -2
  80. package/dist/src/logger.d.ts +2 -2
  81. package/dist/src/logger.js +3 -3
  82. package/dist/src/output.js +1 -5
  83. package/dist/src/output.test.js +0 -21
  84. package/dist/src/pipeline/steps/transform.js +1 -1
  85. package/dist/src/pipeline/template.d.ts +1 -0
  86. package/dist/src/pipeline/template.js +11 -3
  87. package/dist/src/pipeline/template.test.js +3 -0
  88. package/dist/src/pipeline/transform.test.js +14 -0
  89. package/dist/src/plugin.d.ts +7 -1
  90. package/dist/src/plugin.js +23 -1
  91. package/dist/src/plugin.test.js +15 -1
  92. package/dist/src/types.d.ts +1 -1
  93. 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
- - **CLI All Electron** — CLI-ify apps like Antigravity Ultra! Now AI can control itself natively.
26
- - **Browser Automation** — `browser` gives AI agents direct browser control: click, type, extract, screenshot — any interaction, fully scriptable.
27
- - **Website → CLI** — Turn any website into a deterministic CLI: 87+ pre-built adapters, or crystallize your own with `opencli record`.
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
- - **External CLI Hub** — Discover, auto-install, and passthrough commands to any external CLI (gh, obsidian, docker, etc). Zero setup.
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 abc123 --output ./xhs
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
- ## 为什么是 OpenCLI
19
+ ## 亮点
20
20
 
21
- - **同一个心智模型**:网站、浏览器自动化、Electron 应用、本地 CLI 都走同一个入口。
22
- - **复用真实会话**:浏览器命令直接使用你已经登录的 Chrome/Chromium,而不是重新造一套认证。
23
- - **输出稳定**:适配器命令返回固定结构,适合 shell、脚本、CI AI Agent 工具调用。
24
- - **面向 AI Agent**:`browser` 负责实时操作,`explore` 负责探索接口,`synthesize` 负责生成适配器,`cascade` 负责探测认证路径。
25
- - **运行成本低**:已有命令运行时不消耗模型 token。
26
- - **天然可扩展**:既能用内置能力,也能注册本地 CLI,或直接往 `clis/` `.js` 适配器。
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 abc123 --output ./xhs
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
  ## 输出格式