@jackwener/opencli 1.7.19 → 1.7.21

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 (88) hide show
  1. package/README.md +11 -9
  2. package/README.zh-CN.md +9 -10
  3. package/cli-manifest.json +239 -249
  4. package/clis/_shared/search-adapter.js +70 -0
  5. package/clis/boss/chatlist.js +96 -14
  6. package/clis/boss/chatlist.test.js +211 -0
  7. package/clis/boss/chatmsg.js +98 -24
  8. package/clis/boss/chatmsg.test.js +230 -0
  9. package/clis/boss/utils.js +240 -11
  10. package/clis/brave/search.js +80 -0
  11. package/clis/brave/search.test.js +76 -0
  12. package/clis/duckduckgo/search.js +131 -0
  13. package/clis/duckduckgo/search.test.js +128 -0
  14. package/clis/duckduckgo/suggest.js +45 -0
  15. package/clis/duckduckgo/suggest.test.js +66 -0
  16. package/clis/facebook/feed.js +301 -56
  17. package/clis/facebook/feed.test.js +169 -0
  18. package/clis/reddit/comment.js +0 -1
  19. package/clis/reddit/frontpage.js +0 -1
  20. package/clis/reddit/home.js +0 -1
  21. package/clis/reddit/popular.js +0 -1
  22. package/clis/reddit/read.js +0 -1
  23. package/clis/reddit/read.test.js +2 -2
  24. package/clis/reddit/save.js +0 -1
  25. package/clis/reddit/saved.js +0 -1
  26. package/clis/reddit/search.js +0 -1
  27. package/clis/reddit/subreddit-info.js +0 -1
  28. package/clis/reddit/subreddit.js +0 -1
  29. package/clis/reddit/subscribe.js +0 -1
  30. package/clis/reddit/upvote.js +0 -1
  31. package/clis/reddit/upvoted.js +0 -1
  32. package/clis/reddit/user-comments.js +0 -1
  33. package/clis/reddit/user-posts.js +0 -1
  34. package/clis/reddit/user.js +0 -1
  35. package/clis/reddit/whoami.js +0 -1
  36. package/clis/rednote/rednote.test.js +65 -0
  37. package/clis/rednote/search.js +11 -5
  38. package/clis/twitter/article.js +0 -1
  39. package/clis/twitter/bookmark-folder.js +5 -4
  40. package/clis/twitter/bookmark-folder.test.js +59 -1
  41. package/clis/twitter/bookmark-folders.js +0 -1
  42. package/clis/twitter/bookmarks.js +9 -4
  43. package/clis/twitter/bookmarks.test.js +205 -0
  44. package/clis/twitter/download.js +0 -1
  45. package/clis/twitter/followers.js +0 -1
  46. package/clis/twitter/following.js +0 -1
  47. package/clis/twitter/likes.js +0 -1
  48. package/clis/twitter/list-tweets.js +0 -1
  49. package/clis/twitter/lists.js +0 -1
  50. package/clis/twitter/notifications.js +0 -1
  51. package/clis/twitter/profile.js +0 -1
  52. package/clis/twitter/search.js +0 -1
  53. package/clis/twitter/thread.js +0 -1
  54. package/clis/twitter/timeline.js +0 -1
  55. package/clis/twitter/trending.js +0 -1
  56. package/clis/twitter/tweets.js +0 -1
  57. package/clis/xiaohongshu/search.js +34 -16
  58. package/clis/xiaohongshu/search.test.js +66 -11
  59. package/clis/yahoo/search.js +92 -0
  60. package/clis/yahoo/search.test.js +94 -0
  61. package/dist/src/browser/daemon-client.d.ts +1 -0
  62. package/dist/src/browser/daemon-client.js +3 -0
  63. package/dist/src/browser/daemon-client.test.js +20 -0
  64. package/dist/src/cli.js +8 -3
  65. package/dist/src/cli.test.js +1 -0
  66. package/dist/src/daemon-utils.d.ts +18 -0
  67. package/dist/src/daemon-utils.js +37 -0
  68. package/dist/src/daemon.d.ts +1 -1
  69. package/dist/src/daemon.js +44 -13
  70. package/dist/src/daemon.test.js +42 -1
  71. package/dist/src/electron-apps.js +0 -1
  72. package/dist/src/electron-apps.test.js +1 -0
  73. package/dist/src/external-clis.yaml +12 -3
  74. package/dist/src/external.d.ts +4 -0
  75. package/dist/src/external.js +3 -0
  76. package/dist/src/external.test.js +24 -1
  77. package/dist/src/help.d.ts +5 -1
  78. package/dist/src/help.js +4 -3
  79. package/dist/src/help.test.js +5 -1
  80. package/package.json +1 -1
  81. package/clis/notion/export.js +0 -32
  82. package/clis/notion/favorites.js +0 -85
  83. package/clis/notion/new.js +0 -35
  84. package/clis/notion/read.js +0 -31
  85. package/clis/notion/search.js +0 -47
  86. package/clis/notion/sidebar.js +0 -42
  87. package/clis/notion/status.js +0 -17
  88. package/clis/notion/write.js +0 -41
package/README.md CHANGED
@@ -14,17 +14,17 @@ OpenCLI gives you one surface for three different kinds of automation:
14
14
  - **Let AI Agents operate any website** — install the `opencli-adapter-author` skill in your AI agent (Claude Code, Cursor, etc.), and it can navigate, click, type/fill, extract, and inspect any page through your logged-in browser via `opencli browser` primitives.
15
15
  - **Write new adapters** end-to-end with `opencli browser` + the `opencli-adapter-author` skill, which guides from first recon through field decoding, code, and `opencli browser verify`.
16
16
 
17
- It also works as a **CLI hub** for local tools such as `gh`, `docker`, `tg-cli`, `discord-cli`, `wx-cli`, and other binaries you register yourself, plus **desktop app adapters** for Electron apps like Cursor, Codex, Antigravity, ChatGPT, and Notion.
17
+ It also works as a **CLI hub** for local tools such as `gh`, `docker`, `tg`, `discord`, `wx`, `ntn` (Notion), and other binaries you register yourself, plus **desktop app adapters** for Electron apps like Cursor, Codex, Antigravity, and ChatGPT.
18
18
 
19
19
  ## Highlights
20
20
 
21
- - **Desktop App Control** — Drive Electron apps (Cursor, Codex, ChatGPT, Notion, etc.) directly from the terminal via CDP.
21
+ - **Desktop App Control** — Drive Electron apps (Cursor, Codex, ChatGPT, 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/fill, 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
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`.
25
25
  - **Account-safe** — Reuses Chrome/Chromium logged-in state; your credentials never leave the browser.
26
26
  - **AI Agent ready** — One skill takes you from site recon through API discovery, field decoding, adapter writing, and verification.
27
- - **CLI Hub** — Discover, auto-install, and passthrough commands to any external CLI (gh, docker, obsidian, tg-cli, discord-cli, wx-cli, etc).
27
+ - **CLI Hub** — Discover, auto-install, and passthrough commands to any external CLI (gh, docker, obsidian, tg, discord, wx, etc).
28
28
  - **Zero LLM cost** — No tokens consumed at runtime. Run 10,000 times and pay nothing.
29
29
  - **Deterministic** — Same command, same output schema, every time. Pipeable, scriptable, CI-friendly.
30
30
 
@@ -181,7 +181,7 @@ When the site you need is not yet covered, use the `opencli-adapter-author` skil
181
181
 
182
182
  OpenCLI is not only for websites. It can also:
183
183
 
184
- - expose local binaries like `gh`, `docker`, `obsidian`, `tg-cli`, `discord-cli`, `wx-cli`, or custom tools through `opencli <tool> ...`
184
+ - expose local binaries like `gh`, `docker`, `obsidian`, `tg`, `discord`, `wx`, or custom tools through `opencli <tool> ...`
185
185
  - control Electron desktop apps through dedicated adapters and CDP-backed integrations
186
186
 
187
187
  ## Prerequisites
@@ -283,19 +283,20 @@ To load the source Browser Bridge extension:
283
283
 
284
284
  ## CLI Hub
285
285
 
286
- 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).
286
+ OpenCLI acts as a universal hub for your existing command-line tools — unified discovery, pure passthrough execution, and auto-install when a safe package-manager command is configured.
287
287
 
288
288
  | External CLI | Description | Example |
289
289
  |--------------|-------------|---------|
290
290
  | **gh** | GitHub CLI | `opencli gh pr list --limit 5` |
291
291
  | **obsidian** | Obsidian vault management | `opencli obsidian search query="AI"` |
292
292
  | **docker** | Docker | `opencli docker ps` |
293
+ | **ntn** | Notion CLI — official Notion API CLI for pages, databases, blocks, search, comments | `opencli ntn pages list` |
293
294
  | **lark-cli** | Lark/Feishu — messages, docs, calendar, tasks, 200+ commands | `opencli lark-cli calendar +agenda` |
294
295
  | **dws** | DingTalk — cross-platform CLI for DingTalk's full suite, designed for humans and AI agents | `opencli dws msg send --to user "hello"` |
295
296
  | **wecom-cli** | WeCom/企业微信 — CLI for WeCom open platform, for humans and AI agents | `opencli wecom-cli msg send --to user "hello"` |
296
- | **tg-cli** | Telegram — local-first sync, search, and export via MTProto for AI agents | `opencli tg search "AI news" -f json` |
297
- | **discord-cli** | Discord — local-first sync, search, and export via SQLite for AI agents | `opencli discord recent --channel general` |
298
- | **wx-cli** | WeChat — query local WeChat data: sessions, messages, search, contacts, export | `opencli wx search "OpenCLI"` |
297
+ | **tg(tg-cli)** | Telegram — local-first sync, search, and export via MTProto for AI agents | `opencli tg search "AI news" -f json` |
298
+ | **discord(discord-cli)** | Discord — local-first sync, search, and export via SQLite for AI agents | `opencli discord recent --channel general` |
299
+ | **wx(wx-cli)** | WeChat — query local WeChat data: sessions, messages, search, contacts, export | `opencli wx search "OpenCLI"` |
299
300
  | **vercel** | Vercel — deploy projects, manage domains, env vars, logs | `opencli vercel deploy --prod` |
300
301
 
301
302
  **Register your own** — add any local CLI so AI agents can discover it via `opencli list`:
@@ -304,6 +305,8 @@ OpenCLI acts as a universal hub for your existing command-line tools — unified
304
305
  opencli external register mycli
305
306
  ```
306
307
 
308
+ **Manual install** — some external CLIs use official shell-script installers rather than shell-free package-manager commands. For `ntn`, install from <https://ntn.dev> first, then run `opencli ntn ...`.
309
+
307
310
  ### Desktop App Adapters
308
311
 
309
312
  Control Electron desktop apps directly from the terminal. Each adapter has its own detailed documentation:
@@ -315,7 +318,6 @@ Control Electron desktop apps directly from the terminal. Each adapter has its o
315
318
  | **Antigravity** | Control Antigravity Ultra from terminal | [Doc](./docs/adapters/desktop/antigravity.md) |
316
319
  | **ChatGPT App** | Automate ChatGPT macOS desktop app | [Doc](./docs/adapters/desktop/chatgpt-app.md) |
317
320
  | **ChatWise** | Multi-LLM client (GPT-4, Claude, Gemini) | [Doc](./docs/adapters/desktop/chatwise.md) |
318
- | **Notion** | Search, read, write Notion pages | [Doc](./docs/adapters/desktop/notion.md) |
319
321
  | **Discord** | Discord Desktop — messages, channels, servers | [Doc](./docs/adapters/desktop/discord.md) |
320
322
  | **Doubao** | Control Doubao AI desktop app via CDP | [Doc](./docs/adapters/desktop/doubao-app.md) |
321
323
 
package/README.zh-CN.md CHANGED
@@ -14,16 +14,16 @@ OpenCLI 可以用同一套 CLI 做三类事情:
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
 
17
- 除了网站能力,OpenCLI 还是一个 **CLI 枢纽**:你可以把 `gh`、`docker`、`tg-cli`、`discord-cli`、`wx-cli` 等本地工具统一注册到 `opencli` 下,也可以通过桌面端适配器控制 Cursor、Codex、Antigravity、ChatGPT、Notion 等 Electron 应用。
17
+ 除了网站能力,OpenCLI 还是一个 **CLI 枢纽**:你可以把 `gh`、`docker`、`tg`、`discord`、`wx`、`ntn`(Notion)等本地工具统一注册到 `opencli` 下,也可以通过桌面端适配器控制 Cursor、Codex、Antigravity、ChatGPT 等 Electron 应用。
18
18
 
19
19
  ## 亮点
20
20
 
21
- - **桌面应用控制** — 通过 CDP 直接在终端驱动 Electron 应用(Cursor、Codex、ChatGPT、Notion 等)。
21
+ - **桌面应用控制** — 通过 CDP 直接在终端驱动 Electron 应用(Cursor、Codex、ChatGPT 等)。
22
22
  - **AI Agent 浏览器自动化** — 安装 `opencli-adapter-author` skill,你的 AI Agent 就能操作任意网站:导航、点击、输入/填充、提取、截图——全部通过你的已登录 Chrome 会话完成。
23
23
  - **网站 → CLI** — 把任何网站变成确定性 CLI:100+ 站点能力已注册,或用 `opencli-adapter-author` skill + `opencli browser verify` 自己写。
24
24
  - **账号安全** — 复用 Chrome/Chromium 登录态,凭证永远不会离开浏览器。
25
25
  - **面向 AI Agent** — 一个 skill 带你走完站点侦察、API 发现、字段解码、适配器编写、验证的全流程。
26
- - **CLI 枢纽** — 统一发现、自动安装、纯透传任何外部 CLI(gh、docker、obsidian、tg-cli、discord-cli、wx-cli 等)。
26
+ - **CLI 枢纽** — 统一发现、自动安装、纯透传任何外部 CLI(gh、docker、obsidian、tg、discord、wx 等)。
27
27
  - **零 LLM 成本** — 运行时不消耗模型 token,跑 10,000 次也不花一分钱。
28
28
  - **确定性输出** — 相同命令,相同输出结构,每次一致。可管道、可脚本、CI 友好。
29
29
 
@@ -165,7 +165,7 @@ Agent 在内部自动处理所有 `opencli browser` 命令——你只需用自
165
165
 
166
166
  OpenCLI 不只是网站 CLI,还可以:
167
167
 
168
- - 统一代理本地二进制工具,例如 `gh`、`docker`、`obsidian`、`tg-cli`、`discord-cli`、`wx-cli`
168
+ - 统一代理本地二进制工具,例如 `gh`、`docker`、`obsidian`、`tg`、`discord`、`wx`
169
169
  - 通过专门适配器和 CDP 集成控制 Electron 桌面应用
170
170
 
171
171
  ## 前置要求
@@ -241,7 +241,6 @@ npm link
241
241
  | **chatwise** | `status` `new` `send` `read` `ask` `model` `history` `export` `screenshot` | 桌面端 |
242
242
  | **doubao** | `status` `new` `send` `read` `ask` `history` `detail` `meeting-summary` `meeting-transcript` | 浏览器 |
243
243
  | **doubao-app** | `status` `new` `send` `read` `ask` `screenshot` `dump` | 桌面端 |
244
- | **notion** | `status` `search` `read` `new` `write` `sidebar` `favorites` `export` | 桌面端 |
245
244
  | **discord-app** | `status` `send` `read` `channels` `servers` `search` `members` | 桌面端 |
246
245
  | **v2ex** | `hot` `latest` `topic` `node` `user` `member` `replies` `nodes` `daily` `me` `notifications` | 公开 / 浏览器 |
247
246
  | **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `comments` `watchlist` `earnings-date` `fund-holdings` `fund-snapshot` | 浏览器 |
@@ -333,17 +332,18 @@ OpenCLI 也可以作为你现有命令行工具的统一入口,负责发现、
333
332
  | **gh** | GitHub CLI | `opencli gh pr list --limit 5` |
334
333
  | **obsidian** | Obsidian 仓库管理 | `opencli obsidian search query="AI"` |
335
334
  | **docker** | Docker 命令行工具 | `opencli docker ps` |
335
+ | **ntn** | Notion CLI — 基于官方 Notion API 的页面、数据库、块、搜索、评论命令 | `opencli ntn pages list` |
336
336
  | **lark-cli** | 飞书 CLI — 消息、文档、日历、任务,200+ 命令 | `opencli lark-cli calendar +agenda` |
337
337
  | **dws** | 钉钉 CLI — 钉钉全套产品能力的跨平台命令行工具,支持人类和 AI Agent 使用 | `opencli dws msg send --to user "hello"` |
338
338
  | **wecom-cli** | 企业微信 CLI — 企业微信开放平台命令行工具,支持人类和 AI Agent 使用 | `opencli wecom-cli msg send --to user "hello"` |
339
- | **tg-cli** | Telegram CLI — 基于 MTProto 的本地优先同步、搜索、导出,面向 AI Agent | `opencli tg search "AI news" -f json` |
340
- | **discord-cli** | Discord CLI — 基于 SQLite 的本地优先同步、搜索、导出,面向 AI Agent | `opencli discord recent --channel general` |
341
- | **wx-cli** | 微信本地数据 CLI — 会话、聊天记录、搜索、联系人、导出 | `opencli wx search "OpenCLI"` |
339
+ | **tg(tg-cli)** | Telegram CLI — 基于 MTProto 的本地优先同步、搜索、导出,面向 AI Agent | `opencli tg search "AI news" -f json` |
340
+ | **discord(discord-cli)** | Discord CLI — 基于 SQLite 的本地优先同步、搜索、导出,面向 AI Agent | `opencli discord recent --channel general` |
341
+ | **wx(wx-cli)** | 微信本地数据 CLI — 会话、聊天记录、搜索、联系人、导出 | `opencli wx search "OpenCLI"` |
342
342
  | **vercel** | Vercel — 部署项目、管理域名、环境变量、日志 | `opencli vercel deploy --prod` |
343
343
 
344
344
  **零配置透传**:OpenCLI 会把你的输入原样转发给底层二进制,保留原生 stdout / stderr 行为。
345
345
 
346
- **自动安装**:如果你运行 `opencli gh ...` 时系统中还没有 `gh`,OpenCLI 会优先尝试通过系统包管理器安装,然后自动重试命令。
346
+ **自动安装**:如果某个外部 CLI 配置了安全的包管理器安装命令,OpenCLI 会优先尝试安装后再执行;`ntn` 的官方安装方式是 shell 脚本,请先按 <https://ntn.dev> 手动安装。
347
347
 
348
348
  **注册自定义本地 CLI**:
349
349
 
@@ -362,7 +362,6 @@ opencli register mycli
362
362
  | **Antigravity** | 在终端直接控制 Antigravity Ultra | [Doc](./docs/adapters/desktop/antigravity.md) |
363
363
  | **ChatGPT App** | 自动化操作 ChatGPT macOS 桌面客户端 | [Doc](./docs/adapters/desktop/chatgpt-app.md) |
364
364
  | **ChatWise** | 多 LLM 客户端(GPT-4、Claude、Gemini) | [Doc](./docs/adapters/desktop/chatwise.md) |
365
- | **Notion** | 搜索、读取、写入 Notion 页面 | [Doc](./docs/adapters/desktop/notion.md) |
366
365
  | **Discord** | Discord 桌面版 — 消息、频道、服务器 | [Doc](./docs/adapters/desktop/discord.md) |
367
366
  | **Doubao** | 通过 CDP 控制豆包桌面应用 | [Doc](./docs/adapters/desktop/doubao-app.md) |
368
367