@jackwener/opencli 1.7.21 → 1.8.0

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 (238) hide show
  1. package/README.md +31 -148
  2. package/README.zh-CN.md +38 -211
  3. package/cli-manifest.json +6423 -4260
  4. package/clis/12306/me.js +73 -0
  5. package/clis/12306/orders.js +96 -0
  6. package/clis/12306/passengers.js +90 -0
  7. package/clis/12306/price.js +166 -0
  8. package/clis/12306/stations.js +66 -0
  9. package/clis/12306/train.js +91 -0
  10. package/clis/12306/trains.js +119 -0
  11. package/clis/12306/utils.js +272 -0
  12. package/clis/12306/utils.test.js +331 -0
  13. package/clis/36kr/article.js +6 -3
  14. package/clis/36kr/article.test.js +46 -0
  15. package/clis/apple-podcasts/commands.test.js +20 -0
  16. package/clis/apple-podcasts/search.js +2 -2
  17. package/clis/barchart/greeks.js +144 -56
  18. package/clis/barchart/greeks.test.js +138 -0
  19. package/clis/bilibili/summary.js +167 -0
  20. package/clis/bilibili/summary.test.js +210 -0
  21. package/clis/booking/booking.test.js +356 -0
  22. package/clis/booking/search.js +351 -0
  23. package/clis/boss/utils.js +17 -1
  24. package/clis/boss/utils.test.js +34 -0
  25. package/clis/chatgpt/envelope.test.js +108 -0
  26. package/clis/chatgpt/image.js +2 -2
  27. package/clis/chatgpt/image.test.js +6 -0
  28. package/clis/chatgpt/utils.js +148 -41
  29. package/clis/chatgpt/utils.test.js +92 -2
  30. package/clis/douyin/_shared/browser-fetch.js +44 -20
  31. package/clis/douyin/_shared/browser-fetch.test.js +22 -1
  32. package/clis/douyin/_shared/evaluate-result.js +16 -0
  33. package/clis/douyin/_shared/tos-upload.js +105 -69
  34. package/clis/douyin/_shared/vod-upload.js +212 -0
  35. package/clis/douyin/_shared/vod-upload.test.js +38 -0
  36. package/clis/douyin/delete.js +137 -4
  37. package/clis/douyin/delete.test.js +90 -1
  38. package/clis/douyin/publish-upload-id.test.js +170 -0
  39. package/clis/douyin/publish.js +88 -42
  40. package/clis/douyin/user-videos.js +9 -2
  41. package/clis/douyin/user-videos.test.js +43 -0
  42. package/clis/flomo/memos.js +228 -0
  43. package/clis/flomo/memos.test.js +144 -0
  44. package/clis/gitee/search.js +2 -2
  45. package/clis/gitee/search.test.js +65 -0
  46. package/clis/jike/post.js +27 -17
  47. package/clis/jike/read.test.js +86 -0
  48. package/clis/jike/topic.js +32 -19
  49. package/clis/jike/user.js +33 -20
  50. package/clis/lesswrong/comments.js +1 -1
  51. package/clis/lesswrong/curated.js +1 -1
  52. package/clis/lesswrong/frontpage.js +1 -1
  53. package/clis/lesswrong/frontpage.test.js +37 -0
  54. package/clis/lesswrong/new.js +1 -1
  55. package/clis/lesswrong/read.js +1 -1
  56. package/clis/lesswrong/sequences.js +1 -1
  57. package/clis/lesswrong/shortform.js +1 -1
  58. package/clis/lesswrong/tag.js +1 -1
  59. package/clis/lesswrong/top-month.js +1 -1
  60. package/clis/lesswrong/top-week.js +1 -1
  61. package/clis/lesswrong/top-year.js +1 -1
  62. package/clis/lesswrong/top.js +1 -1
  63. package/clis/linkedin/connect.js +401 -0
  64. package/clis/linkedin/connect.test.js +213 -0
  65. package/clis/linkedin/inbox.js +234 -0
  66. package/clis/linkedin/inbox.test.js +152 -0
  67. package/clis/linkedin/people-search.js +262 -0
  68. package/clis/linkedin/people-search.test.js +216 -0
  69. package/clis/linkedin/safe-send.js +357 -0
  70. package/clis/linkedin/safe-send.test.js +204 -0
  71. package/clis/linkedin/salesnav-inbox.js +210 -0
  72. package/clis/linkedin/salesnav-inbox.test.js +113 -0
  73. package/clis/linkedin/salesnav-message.js +360 -0
  74. package/clis/linkedin/salesnav-message.test.js +172 -0
  75. package/clis/linkedin/salesnav-search.js +186 -0
  76. package/clis/linkedin/salesnav-search.test.js +76 -0
  77. package/clis/linkedin/salesnav-thread.js +212 -0
  78. package/clis/linkedin/salesnav-thread.test.js +79 -0
  79. package/clis/linkedin/sent-invitations.js +92 -0
  80. package/clis/linkedin/sent-invitations.test.js +62 -0
  81. package/clis/linkedin/thread-snapshot.js +214 -0
  82. package/clis/linkedin/thread-snapshot.test.js +89 -0
  83. package/clis/linkedin-learning/course.js +138 -0
  84. package/clis/linkedin-learning/course.test.js +114 -0
  85. package/clis/linkedin-learning/search.js +155 -0
  86. package/clis/linkedin-learning/search.test.js +144 -0
  87. package/clis/linkedin-learning/trending.js +133 -0
  88. package/clis/linkedin-learning/trending.test.js +123 -0
  89. package/clis/powerchina/search.js +3 -3
  90. package/clis/powerchina/search.test.js +27 -1
  91. package/clis/reddit/extract-media.test.js +149 -0
  92. package/clis/reddit/frontpage.js +47 -9
  93. package/clis/reddit/frontpage.test.js +34 -0
  94. package/clis/reddit/home.js +31 -1
  95. package/clis/reddit/home.test.js +46 -3
  96. package/clis/reddit/hot.js +32 -1
  97. package/clis/reddit/hot.test.js +15 -1
  98. package/clis/reddit/popular.js +39 -1
  99. package/clis/reddit/popular.test.js +26 -0
  100. package/clis/reddit/saved.js +1 -1
  101. package/clis/reddit/search.js +38 -1
  102. package/clis/reddit/search.test.js +26 -0
  103. package/clis/reddit/subreddit.js +52 -7
  104. package/clis/reddit/subreddit.test.js +31 -0
  105. package/clis/reddit/subscribed.js +165 -0
  106. package/clis/reddit/subscribed.test.js +168 -0
  107. package/clis/reddit/upvoted.js +1 -1
  108. package/clis/suno/commands.test.js +188 -0
  109. package/clis/suno/download.js +140 -0
  110. package/clis/suno/download.test.js +151 -0
  111. package/clis/suno/generate.js +226 -0
  112. package/clis/suno/generate.test.js +243 -0
  113. package/clis/suno/list.js +79 -0
  114. package/clis/suno/status.js +62 -0
  115. package/clis/suno/utils.js +540 -0
  116. package/clis/suno/utils.test.js +223 -0
  117. package/clis/twitter/device-follow.js +193 -0
  118. package/clis/twitter/device-follow.test.js +287 -0
  119. package/clis/twitter/download.js +443 -73
  120. package/clis/twitter/download.test.js +457 -0
  121. package/clis/twitter/list-create.js +155 -0
  122. package/clis/twitter/list-create.test.js +169 -0
  123. package/clis/twitter/list-remove.js +12 -5
  124. package/clis/twitter/list-remove.test.js +74 -0
  125. package/clis/twitter/list-tweets.js +6 -2
  126. package/clis/twitter/list-tweets.test.js +41 -1
  127. package/clis/twitter/lists.js +31 -4
  128. package/clis/twitter/lists.test.js +152 -16
  129. package/clis/twitter/search.js +6 -2
  130. package/clis/twitter/search.test.js +6 -0
  131. package/clis/twitter/shared.js +144 -0
  132. package/clis/twitter/shared.test.js +429 -1
  133. package/clis/twitter/thread.js +10 -2
  134. package/clis/twitter/thread.test.js +58 -0
  135. package/clis/twitter/timeline.js +6 -2
  136. package/clis/twitter/timeline.test.js +2 -0
  137. package/clis/twitter/tweets.js +3 -2
  138. package/clis/twitter/tweets.test.js +1 -1
  139. package/clis/weibo/comments.js +3 -4
  140. package/clis/weibo/delete.js +172 -0
  141. package/clis/weibo/delete.test.js +94 -0
  142. package/clis/weibo/envelope.test.js +85 -0
  143. package/clis/weibo/favorites.js +4 -4
  144. package/clis/weibo/feed.js +3 -5
  145. package/clis/weibo/hot.js +3 -4
  146. package/clis/weibo/me.js +3 -5
  147. package/clis/weibo/post.js +3 -4
  148. package/clis/weibo/publish.js +37 -14
  149. package/clis/weibo/publish.test.js +14 -5
  150. package/clis/weibo/search.js +4 -3
  151. package/clis/weibo/user-posts.js +234 -0
  152. package/clis/weibo/user-posts.test.js +92 -0
  153. package/clis/weibo/user.js +3 -4
  154. package/clis/weibo/utils.js +34 -5
  155. package/clis/weibo/utils.test.js +36 -0
  156. package/clis/weread/search-regression.test.js +18 -11
  157. package/clis/weread/search.js +15 -7
  158. package/clis/weread-official/book.js +135 -0
  159. package/clis/weread-official/commands.test.js +385 -0
  160. package/clis/weread-official/discover.js +107 -0
  161. package/clis/weread-official/list-apis.js +95 -0
  162. package/clis/weread-official/notes.js +171 -0
  163. package/clis/weread-official/readdata.js +158 -0
  164. package/clis/weread-official/review.js +93 -0
  165. package/clis/weread-official/search.js +106 -0
  166. package/clis/weread-official/shelf.js +97 -0
  167. package/clis/weread-official/utils.js +293 -0
  168. package/clis/weread-official/utils.test.js +242 -0
  169. package/clis/wikipedia/trending.js +7 -3
  170. package/clis/wikipedia/trending.test.js +57 -0
  171. package/clis/xianyu/chat.js +24 -109
  172. package/clis/xianyu/chat.test.js +5 -0
  173. package/clis/xianyu/im.js +322 -0
  174. package/clis/xianyu/im.test.js +253 -0
  175. package/clis/xianyu/inbox.js +96 -0
  176. package/clis/xianyu/messages.js +91 -0
  177. package/clis/xianyu/reply.js +82 -0
  178. package/clis/xiaohongshu/creator-note-detail.js +2 -1
  179. package/clis/xiaohongshu/creator-note-detail.test.js +11 -0
  180. package/clis/xiaohongshu/creator-notes-summary.js +2 -1
  181. package/clis/xiaohongshu/creator-notes-summary.test.js +7 -0
  182. package/clis/xiaohongshu/creator-notes.js +2 -1
  183. package/clis/xiaohongshu/creator-notes.test.js +12 -0
  184. package/clis/xiaohongshu/creator-stats.js +2 -1
  185. package/clis/xiaohongshu/creator-stats.test.js +24 -0
  186. package/clis/xiaohongshu/delete-note.js +260 -0
  187. package/clis/xiaohongshu/delete-note.test.js +172 -0
  188. package/clis/xiaohongshu/publish.js +48 -8
  189. package/clis/xiaohongshu/publish.test.js +65 -10
  190. package/clis/xiaohongshu/user-helpers.test.js +41 -0
  191. package/clis/xiaohongshu/user.js +27 -4
  192. package/clis/xiaoyuzhou/download.js +1 -1
  193. package/clis/xiaoyuzhou/transcript.js +1 -1
  194. package/clis/youdao/note.js +258 -0
  195. package/clis/youdao/note.test.js +99 -0
  196. package/clis/youtube/transcript.js +397 -24
  197. package/clis/youtube/transcript.test.js +196 -6
  198. package/clis/zhihu/answer-comments.js +299 -0
  199. package/clis/zhihu/answer-comments.test.js +287 -0
  200. package/clis/zhihu/answer-detail.js +12 -0
  201. package/clis/zhihu/answer-detail.test.js +8 -0
  202. package/clis/zhihu/collection.js +15 -2
  203. package/clis/zhihu/collection.test.js +46 -0
  204. package/clis/zhihu/download.js +1 -1
  205. package/clis/zhihu/question.js +42 -9
  206. package/clis/zhihu/question.test.js +111 -9
  207. package/clis/zhihu/search.js +206 -43
  208. package/clis/zhihu/search.test.js +198 -0
  209. package/dist/src/browser/errors.js +4 -2
  210. package/dist/src/browser/errors.test.js +6 -0
  211. package/dist/src/browser/page.js +30 -4
  212. package/dist/src/browser/page.test.js +42 -0
  213. package/dist/src/browser/utils.d.ts +1 -1
  214. package/dist/src/cli-argv-preprocess.d.ts +26 -0
  215. package/dist/src/cli-argv-preprocess.js +138 -0
  216. package/dist/src/cli-argv-preprocess.test.js +79 -0
  217. package/dist/src/cli.js +1 -1
  218. package/dist/src/convention-audit.js +15 -8
  219. package/dist/src/convention-audit.test.js +21 -0
  220. package/dist/src/download/media-download.js +15 -2
  221. package/dist/src/download/media-download.test.d.ts +1 -0
  222. package/dist/src/download/media-download.test.js +110 -0
  223. package/dist/src/electron-apps.js +1 -1
  224. package/dist/src/electron-apps.test.js +7 -2
  225. package/dist/src/errors.d.ts +17 -0
  226. package/dist/src/errors.js +22 -0
  227. package/dist/src/external-clis.yaml +20 -0
  228. package/dist/src/external.d.ts +6 -1
  229. package/dist/src/external.test.js +19 -0
  230. package/dist/src/main.js +14 -2
  231. package/dist/src/utils.d.ts +43 -0
  232. package/dist/src/utils.js +97 -0
  233. package/dist/src/utils.test.d.ts +1 -0
  234. package/dist/src/utils.test.js +155 -0
  235. package/package.json +8 -2
  236. package/scripts/silent-column-drop-baseline.json +0 -52
  237. package/scripts/typed-error-lint-baseline.json +28 -380
  238. package/clis/slock/_utils.js +0 -12
package/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # OpenCLI
2
2
 
3
- > **Turn websites, browser sessions, Electron apps, and local tools into deterministic interfaces for humans and AI agents.**
4
- > Reuse your logged-in browser, automate live workflows, and crystallize repeated actions into reusable CLI commands.
3
+ > **Convert any website into a CLI & run Browser Use on your logged-in Chrome.**
4
+ > Turn websites, browser sessions, Electron apps, and local tools into deterministic interfaces for humans and AI agents.
5
+ > Or run Browser Use against any page — navigate, fill forms, click, extract, automate.
5
6
 
6
7
  [![中文文档](https://img.shields.io/badge/docs-%E4%B8%AD%E6%96%87-0F766E?style=flat-square)](./README.zh-CN.md)
7
8
  [![npm](https://img.shields.io/npm/v/@jackwener/opencli?style=flat-square)](https://www.npmjs.com/package/@jackwener/opencli)
@@ -11,24 +12,10 @@
11
12
  OpenCLI gives you one surface for three different kinds of automation:
12
13
 
13
14
  - **Use built-in adapters** for sites like Bilibili, Zhihu, Xiaohongshu, Reddit, HackerNews, Twitter/X, and [many more](#built-in-commands).
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
+ - **Let AI Agents operate any website** — install the `opencli-browser` 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
16
  - **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
17
 
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
-
19
- ## Highlights
20
-
21
- - **Desktop App Control** — Drive Electron apps (Cursor, Codex, ChatGPT, etc.) directly from the terminal via CDP.
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
- - **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`.
25
- - **Account-safe** — Reuses Chrome/Chromium logged-in state; your credentials never leave the browser.
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, discord, wx, etc).
28
- - **Zero LLM cost** — No tokens consumed at runtime. Run 10,000 times and pay nothing.
29
- - **Deterministic** — Same command, same output schema, every time. Pipeable, scriptable, CI-friendly.
30
-
31
- ---
18
+ It also works as a **CLI hub** for local tools such as `gh`, `docker`, `longbridge`, `tg`, `discord`, `wx`, `ntn` (Notion), and other binaries you register yourself, plus **desktop app adapters** for Electron apps like Cursor, Codex, Antigravity, and ChatGPT.
32
19
 
33
20
  ## Quick Start
34
21
 
@@ -105,7 +92,7 @@ If you want to add your own commands, start with the [Extending OpenCLI guide](.
105
92
 
106
93
  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.
107
94
 
108
- ### Install skills
95
+ ### Install skills (also refreshes existing installs)
109
96
 
110
97
  ```bash
111
98
  npx skills add jackwener/opencli
@@ -118,22 +105,20 @@ npx skills add jackwener/opencli --skill opencli-adapter-author
118
105
  npx skills add jackwener/opencli --skill opencli-autofix
119
106
  npx skills add jackwener/opencli --skill opencli-browser
120
107
  npx skills add jackwener/opencli --skill opencli-usage
121
- npx skills add jackwener/opencli --skill smart-search
122
108
  ```
123
109
 
124
110
  ### Which skill to use
125
111
 
126
112
  | Skill | When to use | Example prompt to your AI agent |
127
113
  |-------|------------|-------------------------------|
128
- | **opencli-adapter-author** | Operate a site in real time, or write a reusable adapter for a new site | "Help me check my Xiaohongshu notifications" / "Write an adapter for douyin trending" / "Make a command that grabs the top posts from this page" |
114
+ | **opencli-adapter-author** | Write a reusable adapter for a new site or add a command to an existing site | "Write an adapter for douyin trending" / "Make a command that grabs the top posts from this page" |
129
115
  | **opencli-autofix** | Repair a broken adapter when a built-in command fails | "`opencli zhihu hot` is returning empty — fix it" |
130
- | **opencli-browser** | Browser automation reference for AI agents | "Use browser commands to scrape this page" |
116
+ | **opencli-browser** | Drive a real Chrome page ad-hoc — navigate, fill forms, click, extract | "Help me check my Xiaohongshu notifications" / "Help me fill out this form" / "Use browser commands to scrape this page" |
131
117
  | **opencli-usage** | Quick reference for all OpenCLI commands and sites | "What commands does OpenCLI have for Twitter?" |
132
- | **smart-search** | Search across existing OpenCLI capabilities | "Find me a Bilibili trending adapter" |
133
118
 
134
119
  ### How it works
135
120
 
136
- Once `opencli-adapter-author` is installed, your AI agent can:
121
+ Once `opencli-browser` is installed, your AI agent can:
137
122
 
138
123
  1. **Navigate** to any URL using your logged-in browser
139
124
  2. **Read** page content via structured DOM snapshots (not screenshots)
@@ -144,45 +129,25 @@ Once `opencli-adapter-author` is installed, your AI agent can:
144
129
  The agent handles all the `opencli browser` commands internally — you just describe what you want done in natural language.
145
130
 
146
131
  **Skill references:**
147
- - [`skills/opencli-adapter-author/SKILL.md`](./skills/opencli-adapter-author/SKILL.md) — browser operation + adapter authoring, end-to-end
132
+ - [`skills/opencli-browser/SKILL.md`](./skills/opencli-browser/SKILL.md) — drive Chrome ad-hoc (navigate, fill forms, click, extract)
133
+ - [`skills/opencli-adapter-author/SKILL.md`](./skills/opencli-adapter-author/SKILL.md) — write a new adapter end-to-end
148
134
  - [`skills/opencli-autofix/SKILL.md`](./skills/opencli-autofix/SKILL.md) — repair broken adapters
149
- - [`skills/opencli-browser/SKILL.md`](./skills/opencli-browser/SKILL.md) — browser automation reference
150
135
  - [`skills/opencli-usage/SKILL.md`](./skills/opencli-usage/SKILL.md) — command and site reference
151
- - [`skills/smart-search/SKILL.md`](./skills/smart-search/SKILL.md) — capability search
152
136
 
153
137
  Available browser commands include `open`, `state`, `click`, `type`, `fill`, `select`, `keys`, `wait`, `get`, `find`, `extract`, `frames`, `screenshot`, `scroll`, `back`, `eval`, `network`, `tab list`, `tab new`, `tab select`, `tab close`, `init`, `verify`, and `close`.
154
138
 
155
139
  `opencli browser` commands require a `<session>` positional immediately after `browser`. `opencli browser work open <url>` and `opencli browser work tab new [url]` both return a target ID. Use `opencli browser work tab list` to inspect target IDs, then pass `--tab <targetId>` to route a command to a specific tab. `tab new` creates a new tab without changing the default browser target; only `tab select <targetId>` promotes that tab to the default target for later untargeted commands in the same session.
156
140
 
157
- ## Core Concepts
158
-
159
- ### `browser`: AI Agent browser control
160
-
161
- `opencli browser` commands are the low-level primitives that AI Agents use to operate websites. You don't run these manually — instead, install the `opencli-adapter-author` skill into your AI agent, describe what you want in natural language, and the agent handles the browser operations.
162
-
163
- For example, tell your agent: *"Help me check my Xiaohongshu notifications"* — the agent will use `opencli browser <session> open`, `state`, `click`, etc. under the hood.
164
-
165
- ### Built-in adapters: stable commands
166
-
167
- Use site-specific commands such as `opencli hackernews top` or `opencli reddit hot` when the capability already exists. These are deterministic and work without browser — ideal for both humans and AI agents.
168
-
169
- ### Writing a new adapter
170
-
171
- When the site you need is not yet covered, use the `opencli-adapter-author` skill. It takes the agent end-to-end:
172
-
173
- 1. Recon the site and classify its pattern (SPA / SSR / JSONP / Token / Streaming).
174
- 2. Discover the right endpoint — network inspection, initial state, bundle search, token trace, or interceptor fallback.
175
- 3. Decide the auth strategy — `PUBLIC` / `COOKIE` / `INTERCEPT` / `UI` / `LOCAL`.
176
- 4. Decode response fields and design output columns.
177
- 5. `opencli browser recon analyze <url>` for one-shot recon, then `opencli browser recon init <site>/<name>` → write adapter → `opencli browser recon verify <site>/<name>`.
178
- 6. Persist site knowledge to `~/.opencli/sites/<site>/` so the next adapter for the same site is faster.
179
-
180
- ### CLI Hub and desktop adapters
141
+ ## Writing a new adapter
181
142
 
182
- OpenCLI is not only for websites. It can also:
143
+ When the site you need is not yet covered, use the `opencli-adapter-author` skill end-to-end:
183
144
 
184
- - expose local binaries like `gh`, `docker`, `obsidian`, `tg`, `discord`, `wx`, or custom tools through `opencli <tool> ...`
185
- - control Electron desktop apps through dedicated adapters and CDP-backed integrations
145
+ 1. **Recon** the site and pick a pattern (SPA / SSR / JSONP / Token / Streaming).
146
+ 2. **Discover** the right endpoint network inspection, initial state, bundle search, token trace, or interceptor fallback.
147
+ 3. **Pick auth** — `PUBLIC` / `COOKIE` / `INTERCEPT` / `UI` / `LOCAL`.
148
+ 4. **Decode** response fields and design output columns.
149
+ 5. `opencli browser recon analyze <url>` → `opencli browser recon init <site>/<name>` → write adapter → `opencli browser recon verify <site>/<name>`.
150
+ 6. Site knowledge persists to `~/.opencli/sites/<site>/` so the next adapter for the same site starts from context.
186
151
 
187
152
  ## Prerequisites
188
153
 
@@ -208,25 +173,6 @@ OpenCLI is not only for websites. It can also:
208
173
 
209
174
  `opencli browser *` requires an explicit `<session>` positional, uses a foreground browser window by default, and keeps that session's tab lease until `opencli browser <session> close` or idle cleanup. Browser-backed adapters use a background adapter window and release one-shot tab leases by default. Interactive adapters can declare `siteSession: 'persistent'` to keep a stable site tab for continuity; pass `--site-session ephemeral` for a one-shot tab.
210
175
 
211
- ## Update
212
-
213
- ```bash
214
- npm install -g @jackwener/opencli@latest
215
-
216
- # If you use the packaged OpenCLI skills, refresh them too
217
- npx skills add jackwener/opencli
218
- ```
219
-
220
- Or refresh only the skills you actually use:
221
-
222
- ```bash
223
- npx skills add jackwener/opencli --skill opencli-adapter-author
224
- npx skills add jackwener/opencli --skill opencli-autofix
225
- npx skills add jackwener/opencli --skill opencli-browser
226
- npx skills add jackwener/opencli --skill opencli-usage
227
- npx skills add jackwener/opencli --skill smart-search
228
- ```
229
-
230
176
  ## For Developers
231
177
 
232
178
  Install from source:
@@ -249,79 +195,28 @@ To load the source Browser Bridge extension:
249
195
  | Site | Commands |
250
196
  |------|----------|
251
197
  | **xiaohongshu** | `search` `note` `comments` `feed` `user` `download` `publish` `notifications` `creator-notes` `creator-notes-summary` `creator-note-detail` `creator-profile` `creator-stats` |
252
- | **rednote** | `search` `note` `comments` `user` `download` `feed` `notifications` |
253
- | **bilibili** | `hot` `search` `history` `feed` `ranking` `download` `comments` `dynamic` `favorite` `following` `me` `subtitle` `video` `user-videos` |
254
- | **tieba** | `hot` `posts` `search` `read` |
255
- | **hupu** | `hot` `search` `detail` `mentions` `reply` `like` `unlike` |
256
- | **twitter** | `trending` `search` `timeline` `tweets` `lists` `list-tweets` `list-add` `list-remove` `bookmarks` `post` `download` `profile` `article` `like` `likes` `notifications` `reply` `reply-dm` `thread` `follow` `unfollow` `followers` `following` `block` `unblock` `bookmark` `unbookmark` `delete` `hide-reply` `accept` |
257
- | **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `upvoted` `save` `saved` `comment` `subscribe` |
198
+ | **bilibili** | `hot` `search` `history` `feed` `ranking` `download` `comments` `dynamic` `favorite` `following` `me` `subtitle` `summary` `video` `user-videos` |
258
199
  | **zhihu** | `hot` `search` `question` `download` `follow` `like` `favorite` `comment` `answer` |
259
- | **amazon** | `bestsellers` `search` `product` `offer` `discussion` `movers-shakers` `new-releases` `rankings` |
260
- | **1688** | `search` `item` `assets` `download` `store` |
261
- | **gitee** | `trending` `search` `user` |
262
- | **gemini** | `new` `ask` `image` `deep-research` `deep-research-result` |
200
+ | **hackernews** | `top` `new` `best` `ask` `show` `jobs` `search` `user` |
201
+ | **linkedin** | `connect` `inbox` `safe-send` `search` `sent-invitations` `thread-snapshot` `timeline` `salesnav-search` `salesnav-inbox` `salesnav-message` `salesnav-thread` |
202
+ | **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `upvoted` `save` `saved` `comment` `subscribe` |
203
+ | **twitter** | `trending` `search` `timeline` `tweets` `lists` `list-tweets` `list-add` `list-remove` `bookmarks` `post` `download` `profile` `article` `like` `likes` `notifications` `reply` `reply-dm` `thread` `follow` `unfollow` `followers` `following` `block` `unblock` `bookmark` `unbookmark` `delete` `hide-reply` `accept` |
263
204
  | **claude** | `ask` `send` `new` `status` `read` `history` `detail` |
264
- | **yuanbao** | `new` `ask` |
205
+ | **gemini** | `new` `ask` `image` `deep-research` `deep-research-result` |
265
206
  | **notebooklm** | `status` `list` `open` `current` `get` `history` `summary` `note-list` `notes-get` `source-list` `source-get` `source-fulltext` `source-guide` |
266
- | **spotify** | `auth` `status` `play` `pause` `next` `prev` `volume` `search` `queue` `shuffle` `repeat` |
267
- | **xianyu** | `search` `item` `chat` `publish` |
268
- | **xiaoe** | `courses` `detail` `catalog` `play-url` `content` |
269
- | **quark** | `ls` `mkdir` `mv` `rename` `rm` `save` `share-tree` |
270
- | **uiverse** | `code` `preview` |
271
- | **baidu-scholar** | `search` |
272
- | **google-scholar** | `search` `cite` `profile` |
273
- | **gov-law** | `search` `recent` |
274
- | **gov-policy** | `search` `recent` |
275
- | **nowcoder** | `hot` `trending` `topics` `recommend` `creators` `companies` `jobs` `search` `suggest` `experience` `referral` `salary` `papers` `practice` `notifications` `detail` |
276
- | **wanfang** | `search` |
277
- | **hackernews** | `top` `new` `best` `ask` `show` `jobs` `search` `user` |
278
- | **xiaoyuzhou** | `auth*` `podcast*` `podcast-episodes*` `episode*` `download*` `transcript*` |
279
-
280
- 100+ site surfaces in total — **[→ see all supported sites & commands](./docs/adapters/index.md)**
207
+ | **amazon** | `bestsellers` `search` `product` `offer` `discussion` `movers-shakers` `new-releases` `rankings` |
281
208
 
282
- `*` `opencli xiaoyuzhou podcast`, `podcast-episodes`, `episode`, `download`, and `transcript` require local Xiaoyuzhou credentials in `~/.opencli/xiaoyuzhou.json`.
209
+ Curated highlights **[→ see all 100+ supported sites & commands](./docs/adapters/index.md)** (douyin / weibo / spotify / 1688 / quark / nowcoder / google-scholar / hupu / xianyu / weread / weread-official / xiaoyuzhou / and more).
283
210
 
284
211
  ## CLI Hub
285
212
 
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
-
288
- | External CLI | Description | Example |
289
- |--------------|-------------|---------|
290
- | **gh** | GitHub CLI | `opencli gh pr list --limit 5` |
291
- | **obsidian** | Obsidian vault management | `opencli obsidian search query="AI"` |
292
- | **docker** | Docker | `opencli docker ps` |
293
- | **ntn** | Notion CLI — official Notion API CLI for pages, databases, blocks, search, comments | `opencli ntn pages list` |
294
- | **lark-cli** | Lark/Feishu — messages, docs, calendar, tasks, 200+ commands | `opencli lark-cli calendar +agenda` |
295
- | **dws** | DingTalk — cross-platform CLI for DingTalk's full suite, designed for humans and AI agents | `opencli dws msg send --to user "hello"` |
296
- | **wecom-cli** | WeCom/企业微信 — CLI for WeCom open platform, for humans and AI agents | `opencli wecom-cli msg send --to user "hello"` |
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"` |
300
- | **vercel** | Vercel — deploy projects, manage domains, env vars, logs | `opencli vercel deploy --prod` |
301
-
302
- **Register your own** — add any local CLI so AI agents can discover it via `opencli list`:
303
-
304
- ```bash
305
- opencli external register mycli
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
-
310
- ### Desktop App Adapters
213
+ Unified passthrough for your existing command-line tools. Run `opencli <tool> ...` for any of:
311
214
 
312
- Control Electron desktop apps directly from the terminal. Each adapter has its own detailed documentation:
215
+ `gh` · `docker` · `vercel` · `wrangler` · `ntn` · `obsidian` · `longbridge` · `lark-cli` · `dws` · `wecom-cli` · `tg` · `discord` · `wx`
313
216
 
314
- | App | Description | Doc |
315
- |-----|-------------|-----|
316
- | **Cursor** | Control Cursor IDE — Composer, chat, code extraction | [Doc](./docs/adapters/desktop/cursor.md) |
317
- | **Codex** | Drive OpenAI Codex CLI agent headlessly | [Doc](./docs/adapters/desktop/codex.md) |
318
- | **Antigravity** | Control Antigravity Ultra from terminal | [Doc](./docs/adapters/desktop/antigravity.md) |
319
- | **ChatGPT App** | Automate ChatGPT macOS desktop app | [Doc](./docs/adapters/desktop/chatgpt-app.md) |
320
- | **ChatWise** | Multi-LLM client (GPT-4, Claude, Gemini) | [Doc](./docs/adapters/desktop/chatwise.md) |
321
- | **Discord** | Discord Desktop — messages, channels, servers | [Doc](./docs/adapters/desktop/discord.md) |
322
- | **Doubao** | Control Doubao AI desktop app via CDP | [Doc](./docs/adapters/desktop/doubao-app.md) |
217
+ Register your own with `opencli external register <name>`; list everything with `opencli external list`.
323
218
 
324
- To add a new Electron app, start with [docs/guide/electron-app-cli.md](./docs/guide/electron-app-cli.md).
219
+ **Desktop app adapters** (Electron, via CDP): Cursor / Codex / Antigravity / ChatGPT App / ChatWise / Discord / Doubao — see [`docs/adapters/desktop/`](./docs/adapters/desktop/).
325
220
 
326
221
  ## Download Support
327
222
 
@@ -407,18 +302,6 @@ opencli plugin uninstall my-tool
407
302
 
408
303
  See [Plugins Guide](./docs/guide/plugins.md) for creating your own plugin.
409
304
 
410
- ## For AI Agents (Developer Guide)
411
-
412
- Before writing any adapter code, read the [`opencli-adapter-author` skill](./skills/opencli-adapter-author/SKILL.md). It takes you end-to-end:
413
-
414
- - Recon the site and pick a pattern (SPA / SSR / JSONP / Token / Streaming).
415
- - Discover the right endpoint via `opencli browser <session> network`, `eval`, or the interceptor fallback.
416
- - Decide auth strategy (`PUBLIC` / `COOKIE` / `INTERCEPT` / `UI` / `LOCAL`).
417
- - Run `opencli browser recon analyze <url>` for one-shot recon, decode response fields, design columns, scaffold with `opencli browser recon init`.
418
- - Verify with `opencli browser recon verify <site>/<name>` before shipping.
419
-
420
- 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.
421
-
422
305
  ## Testing
423
306
 
424
307
  See **[TESTING.md](./TESTING.md)** for how to run and write tests.
package/README.zh-CN.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # OpenCLI
2
2
 
3
- > **把网站、浏览器会话、Electron 应用和本地工具,统一变成适合人类与 AI Agent 使用的确定性接口。**
4
- > 复用浏览器登录态,先自动化真实操作,再把高频流程沉淀成可复用的 CLI 命令。
3
+ > **把任意网站变成 CLI & 在你的登录态浏览器上跑 Browser Use。**
4
+ > 把网站、浏览器会话、Electron 应用和本地工具,统一变成适合人类与 AI Agent 使用的确定性接口。
5
+ > 或者在任意页面上跑 Browser Use —— 导航、填表单、点击、抓取、自动化。
5
6
 
6
7
  [![English](https://img.shields.io/badge/docs-English-1D4ED8?style=flat-square)](./README.md)
7
8
  [![npm](https://img.shields.io/npm/v/@jackwener/opencli?style=flat-square)](https://www.npmjs.com/package/@jackwener/opencli)
@@ -11,21 +12,10 @@
11
12
  OpenCLI 可以用同一套 CLI 做三类事情:
12
13
 
13
14
  - **直接使用现成适配器**:B站、知乎、小红书、Twitter/X、Reddit、HackerNews 等 [100+ 站点](#内置命令) 开箱即用。
14
- - **让 AI Agent 操作任意网站**:在你的 AI Agent(Claude Code、Cursor 等)中安装 `opencli-adapter-author` skill,Agent 就能用你的已登录浏览器导航、点击、输入/填充、提取任意网页内容。
15
+ - **让 AI Agent 操作任意网站**:在你的 AI Agent(Claude Code、Cursor 等)中安装 `opencli-browser` skill,Agent 就能用你的已登录浏览器导航、点击、输入/填充、提取任意网页内容。
15
16
  - **把新网站写成 CLI**:用 `opencli browser` 原语 + `opencli-adapter-author` skill,从站点侦察、API 发现、字段解码到 `opencli browser verify` 一条龙。
16
17
 
17
- 除了网站能力,OpenCLI 还是一个 **CLI 枢纽**:你可以把 `gh`、`docker`、`tg`、`discord`、`wx`、`ntn`(Notion)等本地工具统一注册到 `opencli` 下,也可以通过桌面端适配器控制 Cursor、Codex、Antigravity、ChatGPT 等 Electron 应用。
18
-
19
- ## 亮点
20
-
21
- - **桌面应用控制** — 通过 CDP 直接在终端驱动 Electron 应用(Cursor、Codex、ChatGPT 等)。
22
- - **AI Agent 浏览器自动化** — 安装 `opencli-adapter-author` skill,你的 AI Agent 就能操作任意网站:导航、点击、输入/填充、提取、截图——全部通过你的已登录 Chrome 会话完成。
23
- - **网站 → CLI** — 把任何网站变成确定性 CLI:100+ 站点能力已注册,或用 `opencli-adapter-author` skill + `opencli browser verify` 自己写。
24
- - **账号安全** — 复用 Chrome/Chromium 登录态,凭证永远不会离开浏览器。
25
- - **面向 AI Agent** — 一个 skill 带你走完站点侦察、API 发现、字段解码、适配器编写、验证的全流程。
26
- - **CLI 枢纽** — 统一发现、自动安装、纯透传任何外部 CLI(gh、docker、obsidian、tg、discord、wx 等)。
27
- - **零 LLM 成本** — 运行时不消耗模型 token,跑 10,000 次也不花一分钱。
28
- - **确定性输出** — 相同命令,相同输出结构,每次一致。可管道、可脚本、CI 友好。
18
+ 除了网站能力,OpenCLI 还是一个 **CLI 枢纽**:你可以把 `gh`、`docker`、`longbridge`、`tg`、`discord`、`wx`、`ntn`(Notion)等本地工具统一注册到 `opencli` 下,也可以通过桌面端适配器控制 Cursor、Codex、Antigravity、ChatGPT 等 Electron 应用。
29
19
 
30
20
  ## 快速开始
31
21
 
@@ -89,7 +79,7 @@ opencli bilibili hot --limit 5
89
79
 
90
80
  OpenCLI 的 browser 命令是给 AI Agent 用的——不是手动执行的。把 skill 安装到你的 AI Agent(Claude Code、Cursor 等)中,Agent 就能用你的已登录 Chrome 会话替你操作网站。
91
81
 
92
- ### 安装 skill
82
+ ### 安装 skill(同时也用于更新)
93
83
 
94
84
  ```bash
95
85
  npx skills add jackwener/opencli
@@ -102,22 +92,20 @@ npx skills add jackwener/opencli --skill opencli-adapter-author
102
92
  npx skills add jackwener/opencli --skill opencli-autofix
103
93
  npx skills add jackwener/opencli --skill opencli-browser
104
94
  npx skills add jackwener/opencli --skill opencli-usage
105
- npx skills add jackwener/opencli --skill smart-search
106
95
  ```
107
96
 
108
97
  ### 选择哪个 skill
109
98
 
110
99
  | Skill | 适用场景 | 你对 AI Agent 说的话 |
111
100
  |-------|---------|-------------------|
112
- | **opencli-adapter-author** | 实时操作任意网站,或为新站点写可复用适配器 | "帮我看看小红书的通知" / "帮我做一个抖音热门的适配器" / "帮我做一个抓取这个页面热帖的命令" |
101
+ | **opencli-adapter-author** | 为新站点写可复用适配器,或给已有站点添加命令 | "帮我做一个抖音热门的适配器" / "帮我做一个抓取这个页面热帖的命令" |
113
102
  | **opencli-autofix** | 内置命令失败时修复已有适配器 | "`opencli zhihu hot` 返回空了,修一下" |
114
- | **opencli-browser** | 浏览器自动化参考文档 | "用浏览器命令抓取这个页面" |
103
+ | **opencli-browser** | 实时驱动 Chrome 页面——导航、填表单、点击、抓取 | "帮我看看小红书的通知" / "帮我填一下这个表单" / "用浏览器命令抓取这个页面" |
115
104
  | **opencli-usage** | 所有命令和站点的快速参考 | "OpenCLI 有哪些 Twitter 相关的命令?" |
116
- | **smart-search** | 在现有 OpenCLI 能力里搜索 | "帮我找个 B 站热门相关的适配器" |
117
105
 
118
106
  ### 工作原理
119
107
 
120
- 安装 `opencli-adapter-author` skill 后,你的 AI Agent 可以:
108
+ 安装 `opencli-browser` skill 后,你的 AI Agent 可以:
121
109
 
122
110
  1. **导航**到任意 URL,使用你的已登录浏览器
123
111
  2. **读取**页面内容——通过结构化 DOM 快照(不是截图)
@@ -128,45 +116,25 @@ npx skills add jackwener/opencli --skill smart-search
128
116
  Agent 在内部自动处理所有 `opencli browser` 命令——你只需用自然语言描述想做的事。
129
117
 
130
118
  **Skill 参考文档:**
131
- - [`skills/opencli-adapter-author/SKILL.md`](./skills/opencli-adapter-author/SKILL.md) — 浏览器操作 + 适配器编写,全流程
119
+ - [`skills/opencli-browser/SKILL.md`](./skills/opencli-browser/SKILL.md) — 实时驱动 Chrome(导航、填表单、点击、抓取)
120
+ - [`skills/opencli-adapter-author/SKILL.md`](./skills/opencli-adapter-author/SKILL.md) — 给新站点写适配器,全流程
132
121
  - [`skills/opencli-autofix/SKILL.md`](./skills/opencli-autofix/SKILL.md) — 修复已有适配器
133
- - [`skills/opencli-browser/SKILL.md`](./skills/opencli-browser/SKILL.md) — 浏览器自动化参考
134
122
  - [`skills/opencli-usage/SKILL.md`](./skills/opencli-usage/SKILL.md) — 命令和站点参考
135
- - [`skills/smart-search/SKILL.md`](./skills/smart-search/SKILL.md) — 能力搜索
136
123
 
137
124
  `browser` 可用命令包括:`open`、`state`、`click`、`type`、`fill`、`select`、`keys`、`wait`、`get`、`find`、`extract`、`frames`、`screenshot`、`scroll`、`back`、`eval`、`network`、`tab list`、`tab new`、`tab select`、`tab close`、`init`、`verify`、`close`。
138
125
 
139
126
  `opencli browser` 命令必须紧跟一个 `<session>` 位置参数。`opencli browser work open <url>` 和 `opencli browser work tab new [url]` 都会返回 target ID。`opencli browser work tab list` 用来查看当前已存在 tab 的 target ID,再通过 `--tab <targetId>` 把命令明确路由到某个 tab。`tab new` 只会新建 tab,不会改变默认浏览器目标;只有显式执行 `tab select <targetId>`,才会把该 tab 设为同一 session 后续未指定 target 的默认目标。
140
127
 
141
- ## 核心概念
142
-
143
- ### `browser`:AI Agent 的浏览器控制层
144
-
145
- `opencli browser` 命令是 AI Agent 操作网站的底层原语。你不需要手动运行这些命令——把 `opencli-adapter-author` skill 安装到你的 AI Agent 中,用自然语言描述你想做的事,Agent 会自动处理浏览器操作。
146
-
147
- 比如你告诉 Agent:*"帮我看看小红书的通知"*——Agent 会在底层调用 `opencli browser <session> open`、`state`、`click` 等命令。
148
-
149
- ### 内置适配器:稳定命令
150
-
151
- 当某个站点能力已经存在时,优先使用 `opencli hackernews top`、`opencli reddit hot` 这类稳定命令。这些命令是确定性的,无需浏览器——人类和 AI Agent 都可以直接使用。
152
-
153
- ### 为新站点写适配器
154
-
155
- 当你需要的网站还没覆盖时,用 `opencli-adapter-author` skill,它会把 Agent 带到闭环:
128
+ ## 为新站点写适配器
156
129
 
157
- 1. 侦察站点,分类 pattern(SPA / SSR / JSONP / Token / Streaming)
158
- 2. 发现目标 endpoint——network 精读、initial state、bundle 搜索、token 溯源,或 interceptor 兜底
159
- 3. 定认证策略——`PUBLIC` / `COOKIE` / `INTERCEPT` / `UI` / `LOCAL`
160
- 4. 字段解码 + 设计输出列
161
- 5. `opencli browser recon analyze <url>` 一步侦察,再 `opencli browser recon init <site>/<name>` → 写适配器 → `opencli browser recon verify <site>/<name>`
162
- 6. 把站点知识沉到 `~/.opencli/sites/<site>/`,下次写同站点的其他命令直接吃缓存
130
+ 当你需要的网站还没覆盖时,用 `opencli-adapter-author` skill,全流程:
163
131
 
164
- ### CLI 枢纽与桌面端适配器
165
-
166
- OpenCLI 不只是网站 CLI,还可以:
167
-
168
- - 统一代理本地二进制工具,例如 `gh`、`docker`、`obsidian`、`tg`、`discord`、`wx`
169
- - 通过专门适配器和 CDP 集成控制 Electron 桌面应用
132
+ 1. **侦察**站点,分类 pattern(SPA / SSR / JSONP / Token / Streaming)
133
+ 2. **发现** endpoint——network 精读、initial state、bundle 搜索、token 溯源,或 interceptor 兜底
134
+ 3. **定认证**——`PUBLIC` / `COOKIE` / `INTERCEPT` / `UI` / `LOCAL`
135
+ 4. **字段解码** + 设计输出列
136
+ 5. `opencli browser recon analyze <url>` → `opencli browser recon init <site>/<name>` → 写适配器 → `opencli browser recon verify <site>/<name>`
137
+ 6. 站点知识沉到 `~/.opencli/sites/<site>/`,下次同站点直接吃缓存
170
138
 
171
139
  ## 前置要求
172
140
 
@@ -191,23 +159,6 @@ OpenCLI 不只是网站 CLI,还可以:
191
159
 
192
160
  `opencli browser *` 必须紧跟一个 `<session>` 位置参数,默认使用前台窗口,并保留该 session 的 tab lease,直到你手动执行 `opencli browser <session> close` 或等空闲超时。浏览器型 adapter 默认使用后台 adapter 窗口并在命令结束后释放一次性 tab lease;如果需要调试最终页面,可以传 `--window foreground --keep-tab true`。
193
161
 
194
- ## 更新
195
-
196
- ```bash
197
- npm install -g @jackwener/opencli@latest
198
-
199
- # 如果你在用打包发布的 OpenCLI skills,也一起刷新
200
- npx skills add jackwener/opencli
201
- ```
202
-
203
- 如果你只装了部分 skill,也可以只刷新自己在用的:
204
-
205
- ```bash
206
- npx skills add jackwener/opencli --skill opencli-adapter-author
207
- npx skills add jackwener/opencli --skill opencli-autofix
208
- npx skills add jackwener/opencli --skill smart-search
209
- ```
210
-
211
162
  ## 面向开发者
212
163
 
213
164
  从源码安装:
@@ -229,141 +180,31 @@ npm link
229
180
 
230
181
  运行 `opencli list` 查看完整注册表。
231
182
 
232
- | 站点 | 命令 | 模式 |
233
- |------|------|------|
234
- | **twitter** | `trending` `search` `timeline` `tweets` `lists` `list-tweets` `list-add` `list-remove` `bookmarks` `profile` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `likes` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` `block` `unblock` `hide-reply` | 浏览器 |
235
- | **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` | 浏览器 |
236
- | **tieba** | `hot` `posts` `search` `read` | 浏览器 |
237
- | **hupu** | `hot` `search` `detail` `mentions` `reply` `like` `unlike` | 浏览器 |
238
- | **cursor** | `status` `send` `read` `new` `dump` `composer` `model` `extract-code` `ask` `screenshot` `history` `export` | 桌面端 |
239
- | **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `video` `comments` `dynamic` `ranking` `following` `user-videos` `download` | 浏览器 |
240
- | **codex** | `status` `send` `read` `new` `dump` `extract-diff` `model` `ask` `screenshot` `projects` `history` `export` | 桌面端 |
241
- | **chatwise** | `status` `new` `send` `read` `ask` `model` `history` `export` `screenshot` | 桌面端 |
242
- | **doubao** | `status` `new` `send` `read` `ask` `history` `detail` `meeting-summary` `meeting-transcript` | 浏览器 |
243
- | **doubao-app** | `status` `new` `send` `read` `ask` `screenshot` `dump` | 桌面端 |
244
- | **discord-app** | `status` `send` `read` `channels` `servers` `search` `members` | 桌面端 |
245
- | **v2ex** | `hot` `latest` `topic` `node` `user` `member` `replies` `nodes` `daily` `me` `notifications` | 公开 / 浏览器 |
246
- | **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `comments` `watchlist` `earnings-date` `fund-holdings` `fund-snapshot` | 浏览器 |
247
- | **antigravity** | `status` `send` `read` `new` `dump` `extract-code` `model` `watch` `serve` | 桌面端 |
248
- | **chatgpt-app** | `status` `new` `send` `read` `ask` `model` | 桌面端 |
249
- | **xiaohongshu** | `search` `note` `comments` `notifications` `feed` `user` `download` `publish` `creator-notes` `creator-note-detail` `creator-notes-summary` `creator-profile` `creator-stats` | 浏览器 |
250
- | **rednote** | `search` `note` `comments` `user` `download` `feed` `notifications` | 浏览器 |
251
- | **xiaoe** | `courses` `detail` `catalog` `play-url` `content` | 浏览器 |
252
- | **quark** | `ls` `mkdir` `mv` `rename` `rm` `save` `share-tree` | 浏览器 |
253
- | **uiverse** | `code` `preview` | 浏览器 |
254
- | **apple-podcasts** | `search` `episodes` `top` | 公开 |
255
- | **baidu-scholar** | `search` | 公开 |
256
- | **google-scholar** | `search` `cite` `profile` | 公开 |
257
- | **gov-law** | `search` `recent` | 公开 |
258
- | **gov-policy** | `search` `recent` | 公开 |
259
- | **nowcoder** | `hot` `trending` `topics` `recommend` `creators` `companies` `jobs` `search` `suggest` `experience` `referral` `salary` `papers` `practice` `notifications` `detail` | 公开 / 浏览器 |
260
- | **wanfang** | `search` | 公开 |
261
- | **xiaoyuzhou** | `podcast*` `podcast-episodes*` `episode*` `download*` `transcript*` `auth` | 本地凭证 |
262
- | **zhihu** | `hot` `search` `question` `download` `follow` `like` `favorite` `comment` `answer` | 浏览器 |
263
- | **weixin** | `download` | 浏览器 |
264
- | **youtube** | `search` `video` `transcript` `comments` `channel` `playlist` `feed` `history` `watch-later` `subscriptions` `like` `unlike` `subscribe` `unsubscribe` | 浏览器 |
265
- | **boss** | `search` `detail` `recommend` `joblist` `greet` `batchgreet` `send` `chatlist` `chatmsg` `invite` `mark` `exchange` `resume` `stats` | 浏览器 |
266
- | **coupang** | `search` `add-to-cart` | 浏览器 |
267
- | **bbc** | `news` | 公共 API |
268
- | **bloomberg** | `main` `markets` `economics` `industries` `tech` `politics` `businessweek` `opinions` `feeds` `news` | 公共 API / 浏览器 |
269
- | **ctrip** | `search` | 浏览器 |
270
- | **devto** | `top` `tag` `user` | 公开 |
271
- | **dictionary** | `search` `synonyms` `examples` | 公开 |
272
- | **arxiv** | `search` `paper` | 公开 |
273
- | **pubmed** | `search` `article` `author` `citations` `related` | 公开 |
274
- | **openreview** | `search` `venue` `paper` `reviews` | 公开 |
275
- | **paperreview** | `submit` `review` `feedback` | 公开 |
276
- | **wikipedia** | `search` `summary` `random` `trending` | 公开 |
277
- | **hackernews** | `top` `new` `best` `ask` `show` `jobs` `search` `user` | 公共 API |
278
- | **jd** | `item` | 浏览器 |
279
- | **linkedin** | `search` `timeline` | 浏览器 |
280
- | **reuters** | `search` | 浏览器 |
281
- | **smzdm** | `search` | 浏览器 |
282
- | **web** | `read` | 浏览器 |
283
- | **weibo** | `hot` `search` `feed` `user` `me` `post` `comments` | 浏览器 |
284
- | **yahoo-finance** | `quote` | 浏览器 |
285
- | **sinafinance** | `news` | 🌐 公开 |
286
- | **barchart** | `quote` `options` `greeks` `flow` | 浏览器 |
287
- | **chaoxing** | `assignments` `exams` | 浏览器 |
288
- | **grok** | `ask` `image` | 浏览器 |
289
- | **hf** | `top` | 公开 |
290
- | **jike** | `feed` `search` `create` `like` `comment` `repost` `notifications` `post` `topic` `user` | 浏览器 |
291
- | **jimeng** | `generate` `history` | 浏览器 |
292
- | **yollomi** | `generate` `video` `edit` `upload` `models` `remove-bg` `upscale` `face-swap` `restore` `try-on` `background` `object-remover` | 浏览器 |
293
- | **linux-do** | `feed` `search` `categories` `tags` `topic` `topic-content` `user-posts` `user-topics` | 浏览器 |
294
- | **stackoverflow** | `hot` `search` `bounties` `unanswered` | 公开 |
295
- | **steam** | `top-sellers` | 公开 |
296
- | **weread** | `shelf` `search` `book` `highlights` `notes` `notebooks` `ranking` | 浏览器 |
297
- | **douban** | `search` `top250` `subject` `photos` `download` `marks` `reviews` `movie-hot` `book-hot` | 浏览器 |
298
- | **facebook** | `feed` `profile` `search` `friends` `groups` `events` `notifications` `memories` `add-friend` `join-group` | 浏览器 |
299
- | **google** | `news` `search` `suggest` `trends` | 公开 |
300
- | **amazon** | `bestsellers` `search` `product` `offer` `discussion` `movers-shakers` `new-releases` `rankings` | 浏览器 |
301
- | **1688** | `search` `item` `assets` `download` `store` | 浏览器 |
302
- | **gitee** | `trending` `search` `user` | 公开 / 浏览器 |
303
- | **gemini** | `new` `ask` `image` `deep-research` `deep-research-result` | 浏览器 |
304
- | **claude** | `ask` `send` `new` `status` `read` `history` `detail` | 浏览器 |
305
- | **spotify** | `auth` `status` `play` `pause` `next` `prev` `volume` `search` `queue` `shuffle` `repeat` | OAuth API |
306
- | **notebooklm** | `status` `list` `open` `current` `get` `history` `summary` `note-list` `notes-get` `source-list` `source-get` `source-fulltext` `source-guide` | 浏览器 |
307
- | **36kr** | `news` `hot` `search` `article` | 公开 / 浏览器 |
308
- | **imdb** | `search` `title` `top` `trending` `person` `reviews` | 公开 |
309
- | **producthunt** | `posts` `today` `hot` `browse` | 公开 / 浏览器 |
310
- | **instagram** | `explore` `profile` `search` `user` `followers` `following` `follow` `unfollow` `like` `unlike` `comment` `save` `unsave` `saved` | 浏览器 |
311
- | **lobsters** | `hot` `newest` `active` `tag` `read` | 公开 |
312
- | **medium** | `feed` `search` `user` | 浏览器 |
313
- | **sinablog** | `hot` `search` `article` `user` | 浏览器 |
314
- | **substack** | `feed` `search` `publication` | 浏览器 |
315
- | **pixiv** | `ranking` `search` `user` `illusts` `detail` `download` | 浏览器 |
316
- | **tiktok** | `explore` `search` `profile` `user` `following` `follow` `unfollow` `like` `unlike` `comment` `save` `unsave` `live` `notifications` `friends` | 浏览器 |
317
- | **bluesky** | `search` `trending` `user` `profile` `thread` `feeds` `followers` `following` `starter-packs` | 公开 |
318
- | **xianyu** | `search` `item` `chat` `publish` | 浏览器 |
319
- | **douyin** | `videos` `publish` `drafts` `draft` `delete` `stats` `profile` `update` `hashtag` `location` `activities` `collections` | 浏览器 |
320
- | **yuanbao** | `new` `ask` | 浏览器 |
321
-
322
- 100+ 站点能力 — **[→ 查看完整命令列表](./docs/adapters/index.md)**
323
-
324
- `*` `opencli xiaoyuzhou podcast`、`podcast-episodes`、`episode`、`download`、`transcript` 需要本地小宇宙凭证:`~/.opencli/xiaoyuzhou.json`。
183
+ | 站点 | 命令 |
184
+ |------|------|
185
+ | **xiaohongshu** | `search` `note` `comments` `notifications` `feed` `user` `download` `publish` `creator-notes` `creator-note-detail` `creator-notes-summary` `creator-profile` `creator-stats` |
186
+ | **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `summary` `video` `comments` `dynamic` `ranking` `following` `user-videos` `download` |
187
+ | **zhihu** | `hot` `search` `question` `download` `follow` `like` `favorite` `comment` `answer` |
188
+ | **hackernews** | `top` `new` `best` `ask` `show` `jobs` `search` `user` |
189
+ | **linkedin** | `connect` `inbox` `safe-send` `search` `people-search` `sent-invitations` `thread-snapshot` `timeline` `salesnav-search` `salesnav-inbox` `salesnav-message` `salesnav-thread` |
190
+ | **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` |
191
+ | **twitter** | `trending` `search` `timeline` `tweets` `lists` `list-tweets` `list-add` `list-remove` `bookmarks` `profile` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `likes` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` `block` `unblock` `hide-reply` |
192
+ | **claude** | `ask` `send` `new` `status` `read` `history` `detail` |
193
+ | **gemini** | `new` `ask` `image` `deep-research` `deep-research-result` |
194
+ | **notebooklm** | `status` `list` `open` `current` `get` `history` `summary` `note-list` `notes-get` `source-list` `source-get` `source-fulltext` `source-guide` |
195
+ | **amazon** | `bestsellers` `search` `product` `offer` `discussion` `movers-shakers` `new-releases` `rankings` |
196
+
197
+ 精选清单 **[→ 查看全部 100+ 站点和命令](./docs/adapters/index.md)**(小红书 / B站 / 知乎 / Twitter / Reddit / 抖音 / 微博 / 微信读书 / 小宇宙 / 1688 / 夸克 / Spotify / 牛客 / arxiv / Bilibili / 等)。
325
198
 
326
199
  ### 外部 CLI 枢纽
327
200
 
328
- OpenCLI 也可以作为你现有命令行工具的统一入口,负责发现、自动安装和纯透传执行。
329
-
330
- | 外部 CLI | 描述 | 示例 |
331
- |----------|------|------|
332
- | **gh** | GitHub CLI | `opencli gh pr list --limit 5` |
333
- | **obsidian** | Obsidian 仓库管理 | `opencli obsidian search query="AI"` |
334
- | **docker** | Docker 命令行工具 | `opencli docker ps` |
335
- | **ntn** | Notion CLI — 基于官方 Notion API 的页面、数据库、块、搜索、评论命令 | `opencli ntn pages list` |
336
- | **lark-cli** | 飞书 CLI — 消息、文档、日历、任务,200+ 命令 | `opencli lark-cli calendar +agenda` |
337
- | **dws** | 钉钉 CLI — 钉钉全套产品能力的跨平台命令行工具,支持人类和 AI Agent 使用 | `opencli dws msg send --to user "hello"` |
338
- | **wecom-cli** | 企业微信 CLI — 企业微信开放平台命令行工具,支持人类和 AI Agent 使用 | `opencli wecom-cli msg send --to user "hello"` |
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
- | **vercel** | Vercel — 部署项目、管理域名、环境变量、日志 | `opencli vercel deploy --prod` |
343
-
344
- **零配置透传**:OpenCLI 会把你的输入原样转发给底层二进制,保留原生 stdout / stderr 行为。
345
-
346
- **自动安装**:如果某个外部 CLI 配置了安全的包管理器安装命令,OpenCLI 会优先尝试安装后再执行;`ntn` 的官方安装方式是 shell 脚本,请先按 <https://ntn.dev> 手动安装。
201
+ 把现有命令行工具统一接入 `opencli <tool> ...`:
347
202
 
348
- **注册自定义本地 CLI**:
203
+ `gh` · `docker` · `vercel` · `wrangler` · `ntn` · `obsidian` · `longbridge` · `lark-cli` · `dws` · `wecom-cli` · `tg` · `discord` · `wx`
349
204
 
350
- ```bash
351
- opencli register mycli
352
- ```
353
-
354
- ### 桌面应用适配器
205
+ 注册自定义本地 CLI:`opencli external register <name>`;查看所有:`opencli external list`。
355
206
 
356
- 每个桌面适配器都有自己详细的文档说明,包括命令参考、启动配置与使用示例:
357
-
358
- | 应用 | 描述 | 文档 |
359
- |-----|-------------|-----|
360
- | **Cursor** | 控制 Cursor IDE — Composer、对话、代码提取等 | [Doc](./docs/adapters/desktop/cursor.md) |
361
- | **Codex** | 在后台(无头)驱动 OpenAI Codex CLI Agent | [Doc](./docs/adapters/desktop/codex.md) |
362
- | **Antigravity** | 在终端直接控制 Antigravity Ultra | [Doc](./docs/adapters/desktop/antigravity.md) |
363
- | **ChatGPT App** | 自动化操作 ChatGPT macOS 桌面客户端 | [Doc](./docs/adapters/desktop/chatgpt-app.md) |
364
- | **ChatWise** | 多 LLM 客户端(GPT-4、Claude、Gemini) | [Doc](./docs/adapters/desktop/chatwise.md) |
365
- | **Discord** | Discord 桌面版 — 消息、频道、服务器 | [Doc](./docs/adapters/desktop/discord.md) |
366
- | **Doubao** | 通过 CDP 控制豆包桌面应用 | [Doc](./docs/adapters/desktop/doubao-app.md) |
207
+ **桌面应用适配器**(Electron,通过 CDP):Cursor / Codex / Antigravity / ChatGPT App / ChatWise / Discord / Doubao — 详见 [`docs/adapters/desktop/`](./docs/adapters/desktop/)。
367
208
 
368
209
  ## 下载支持
369
210
 
@@ -501,20 +342,6 @@ opencli plugin uninstall my-tool # 卸载
501
342
 
502
343
  详见 [插件指南](./docs/zh/guide/plugins.md) 了解如何创建自己的插件。
503
344
 
504
- ## 致 AI Agent(开发者指南)
505
-
506
- 如果你是一个被要求查阅代码并编写新 `opencli` 适配器的 AI,请遵守以下工作流。
507
-
508
- 在动代码前,先读 [`opencli-adapter-author` skill](./skills/opencli-adapter-author/SKILL.md)。它把整个流程串起来:
509
-
510
- - 侦察站点,选定 pattern(SPA / SSR / JSONP / Token / Streaming)
511
- - 用 `opencli browser <name> network`、`eval`、interceptor 等找到目标 endpoint
512
- - 定认证策略(`PUBLIC` / `COOKIE` / `INTERCEPT` / `UI` / `LOCAL`)
513
- - 先用 `opencli browser recon analyze <url>` 一步侦察,再字段解码、设计 columns、`opencli browser recon init` 生成骨架
514
- - 交付前用 `opencli browser recon verify <site>/<name>` 验证
515
-
516
- 在仓库外写的私有适配器放到 `~/.opencli/clis/<site>/<name>.js`;每个站点的 endpoint、字段映射、抓包样本会累积在 `~/.opencli/sites/<site>/`,下次写同站点的其他命令可以直接复用。
517
-
518
345
  ## 常见问题排查
519
346
 
520
347
  - **"Extension not connected" 报错**