@jackwener/opencli 1.7.4 → 1.7.6

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 (181) hide show
  1. package/README.md +76 -51
  2. package/README.zh-CN.md +78 -62
  3. package/cli-manifest.json +4558 -2979
  4. package/clis/antigravity/serve.js +71 -25
  5. package/clis/baidu-scholar/search.js +87 -0
  6. package/clis/baidu-scholar/search.test.js +23 -0
  7. package/clis/bilibili/video.js +61 -0
  8. package/clis/bilibili/video.test.js +81 -0
  9. package/clis/deepseek/ask.js +94 -0
  10. package/clis/deepseek/ask.test.js +73 -0
  11. package/clis/deepseek/history.js +25 -0
  12. package/clis/deepseek/new.js +20 -0
  13. package/clis/deepseek/read.js +22 -0
  14. package/clis/deepseek/status.js +24 -0
  15. package/clis/deepseek/utils.js +291 -0
  16. package/clis/deepseek/utils.test.js +37 -0
  17. package/clis/eastmoney/_secid.js +78 -0
  18. package/clis/eastmoney/announcement.js +52 -0
  19. package/clis/eastmoney/convertible.js +73 -0
  20. package/clis/eastmoney/etf.js +65 -0
  21. package/clis/eastmoney/holders.js +78 -0
  22. package/clis/eastmoney/index-board.js +96 -0
  23. package/clis/eastmoney/kline.js +87 -0
  24. package/clis/eastmoney/kuaixun.js +54 -0
  25. package/clis/eastmoney/longhu.js +67 -0
  26. package/clis/eastmoney/money-flow.js +78 -0
  27. package/clis/eastmoney/northbound.js +57 -0
  28. package/clis/eastmoney/quote.js +107 -0
  29. package/clis/eastmoney/rank.js +94 -0
  30. package/clis/eastmoney/sectors.js +76 -0
  31. package/clis/google-scholar/search.js +58 -0
  32. package/clis/google-scholar/search.test.js +23 -0
  33. package/clis/gov-law/commands.test.js +39 -0
  34. package/clis/gov-law/recent.js +22 -0
  35. package/clis/gov-law/search.js +41 -0
  36. package/clis/gov-law/shared.js +51 -0
  37. package/clis/gov-policy/commands.test.js +27 -0
  38. package/clis/gov-policy/recent.js +47 -0
  39. package/clis/gov-policy/search.js +48 -0
  40. package/clis/jianyu/search.js +139 -3
  41. package/clis/jianyu/search.test.js +25 -0
  42. package/clis/jianyu/shared/procurement-detail.js +15 -0
  43. package/clis/jianyu/shared/procurement-detail.test.js +12 -0
  44. package/clis/nowcoder/companies.js +23 -0
  45. package/clis/nowcoder/creators.js +27 -0
  46. package/clis/nowcoder/detail.js +61 -0
  47. package/clis/nowcoder/experience.js +36 -0
  48. package/clis/nowcoder/hot.js +24 -0
  49. package/clis/nowcoder/jobs.js +21 -0
  50. package/clis/nowcoder/notifications.js +29 -0
  51. package/clis/nowcoder/papers.js +40 -0
  52. package/clis/nowcoder/practice.js +37 -0
  53. package/clis/nowcoder/recommend.js +30 -0
  54. package/clis/nowcoder/referral.js +39 -0
  55. package/clis/nowcoder/salary.js +40 -0
  56. package/clis/nowcoder/search.js +49 -0
  57. package/clis/nowcoder/suggest.js +33 -0
  58. package/clis/nowcoder/topics.js +27 -0
  59. package/clis/nowcoder/trending.js +25 -0
  60. package/clis/twitter/list-add.js +337 -0
  61. package/clis/twitter/list-add.test.js +15 -0
  62. package/clis/twitter/list-remove.js +297 -0
  63. package/clis/twitter/list-remove.test.js +14 -0
  64. package/clis/twitter/list-tweets.js +185 -0
  65. package/clis/twitter/list-tweets.test.js +108 -0
  66. package/clis/twitter/lists.js +134 -47
  67. package/clis/twitter/lists.test.js +105 -38
  68. package/clis/twitter/shared.js +7 -2
  69. package/clis/twitter/tweets.js +218 -0
  70. package/clis/twitter/tweets.test.js +125 -0
  71. package/clis/wanfang/search.js +66 -0
  72. package/clis/wanfang/search.test.js +23 -0
  73. package/clis/web/read.js +1 -1
  74. package/clis/weixin/download.js +3 -2
  75. package/clis/xiaohongshu/publish.js +149 -28
  76. package/clis/xiaohongshu/publish.test.js +319 -6
  77. package/clis/xiaoyuzhou/download.js +8 -4
  78. package/clis/xiaoyuzhou/download.test.js +23 -13
  79. package/clis/xiaoyuzhou/episode.js +9 -4
  80. package/clis/xiaoyuzhou/podcast-episodes.js +15 -11
  81. package/clis/xiaoyuzhou/podcast.js +9 -4
  82. package/clis/xiaoyuzhou/utils.js +0 -40
  83. package/clis/xiaoyuzhou/utils.test.js +15 -75
  84. package/clis/youtube/channel.js +35 -0
  85. package/clis/zsxq/dynamics.js +1 -1
  86. package/clis/zsxq/utils.js +6 -3
  87. package/clis/zsxq/utils.test.js +31 -0
  88. package/dist/src/browser/base-page.d.ts +14 -4
  89. package/dist/src/browser/base-page.js +35 -25
  90. package/dist/src/browser/bridge.d.ts +1 -0
  91. package/dist/src/browser/bridge.js +1 -1
  92. package/dist/src/browser/cdp.d.ts +1 -0
  93. package/dist/src/browser/cdp.js +13 -4
  94. package/dist/src/browser/compound.d.ts +59 -0
  95. package/dist/src/browser/compound.js +112 -0
  96. package/dist/src/browser/compound.test.js +175 -0
  97. package/dist/src/browser/daemon-client.d.ts +6 -4
  98. package/dist/src/browser/daemon-client.js +6 -1
  99. package/dist/src/browser/daemon-client.test.js +40 -1
  100. package/dist/src/browser/dom-snapshot.d.ts +7 -0
  101. package/dist/src/browser/dom-snapshot.js +83 -5
  102. package/dist/src/browser/dom-snapshot.test.js +65 -0
  103. package/dist/src/browser/extract.d.ts +69 -0
  104. package/dist/src/browser/extract.js +132 -0
  105. package/dist/src/browser/extract.test.js +129 -0
  106. package/dist/src/browser/find.d.ts +76 -0
  107. package/dist/src/browser/find.js +179 -0
  108. package/dist/src/browser/find.test.js +120 -0
  109. package/dist/src/browser/html-tree.d.ts +75 -0
  110. package/dist/src/browser/html-tree.js +112 -0
  111. package/dist/src/browser/html-tree.test.d.ts +1 -0
  112. package/dist/src/browser/html-tree.test.js +181 -0
  113. package/dist/src/browser/network-cache.d.ts +48 -0
  114. package/dist/src/browser/network-cache.js +66 -0
  115. package/dist/src/browser/network-cache.test.d.ts +1 -0
  116. package/dist/src/browser/network-cache.test.js +58 -0
  117. package/dist/src/browser/network-key.d.ts +22 -0
  118. package/dist/src/browser/network-key.js +66 -0
  119. package/dist/src/browser/network-key.test.d.ts +1 -0
  120. package/dist/src/browser/network-key.test.js +49 -0
  121. package/dist/src/browser/page.d.ts +14 -4
  122. package/dist/src/browser/page.js +48 -7
  123. package/dist/src/browser/page.test.js +97 -0
  124. package/dist/src/browser/shape-filter.d.ts +52 -0
  125. package/dist/src/browser/shape-filter.js +101 -0
  126. package/dist/src/browser/shape-filter.test.d.ts +1 -0
  127. package/dist/src/browser/shape-filter.test.js +101 -0
  128. package/dist/src/browser/shape.d.ts +23 -0
  129. package/dist/src/browser/shape.js +95 -0
  130. package/dist/src/browser/shape.test.d.ts +1 -0
  131. package/dist/src/browser/shape.test.js +82 -0
  132. package/dist/src/browser/target-errors.d.ts +14 -1
  133. package/dist/src/browser/target-errors.js +13 -0
  134. package/dist/src/browser/target-errors.test.js +39 -6
  135. package/dist/src/browser/target-resolver.d.ts +57 -10
  136. package/dist/src/browser/target-resolver.js +195 -75
  137. package/dist/src/browser/target-resolver.test.js +80 -5
  138. package/dist/src/cli.js +849 -267
  139. package/dist/src/cli.test.js +961 -90
  140. package/dist/src/commanderAdapter.d.ts +0 -1
  141. package/dist/src/commanderAdapter.js +2 -16
  142. package/dist/src/commanderAdapter.test.js +1 -1
  143. package/dist/src/completion-shared.js +2 -5
  144. package/dist/src/daemon.js +8 -0
  145. package/dist/src/download/article-download.d.ts +1 -0
  146. package/dist/src/download/article-download.js +3 -0
  147. package/dist/src/download/article-download.test.d.ts +1 -0
  148. package/dist/src/download/article-download.test.js +39 -0
  149. package/dist/src/execution.js +7 -2
  150. package/dist/src/execution.test.js +54 -0
  151. package/dist/src/main.js +16 -0
  152. package/dist/src/plugin.d.ts +1 -8
  153. package/dist/src/plugin.js +1 -27
  154. package/dist/src/plugin.test.js +1 -59
  155. package/dist/src/registry.d.ts +1 -0
  156. package/dist/src/registry.js +3 -2
  157. package/dist/src/registry.test.js +22 -0
  158. package/dist/src/types.d.ts +32 -8
  159. package/package.json +1 -1
  160. package/clis/twitter/lists-parser.js +0 -77
  161. package/clis/twitter/lists.d.ts +0 -5
  162. package/dist/src/cascade.d.ts +0 -46
  163. package/dist/src/cascade.js +0 -135
  164. package/dist/src/explore.d.ts +0 -99
  165. package/dist/src/explore.js +0 -402
  166. package/dist/src/generate-verified.d.ts +0 -105
  167. package/dist/src/generate-verified.js +0 -696
  168. package/dist/src/generate-verified.test.js +0 -925
  169. package/dist/src/generate.d.ts +0 -46
  170. package/dist/src/generate.js +0 -117
  171. package/dist/src/record.d.ts +0 -96
  172. package/dist/src/record.js +0 -657
  173. package/dist/src/record.test.js +0 -293
  174. package/dist/src/skill-generate.d.ts +0 -30
  175. package/dist/src/skill-generate.js +0 -75
  176. package/dist/src/skill-generate.test.js +0 -173
  177. package/dist/src/synthesize.d.ts +0 -97
  178. package/dist/src/synthesize.js +0 -208
  179. /package/dist/src/{generate-verified.test.d.ts → browser/compound.test.d.ts} +0 -0
  180. /package/dist/src/{record.test.d.ts → browser/extract.test.d.ts} +0 -0
  181. /package/dist/src/{skill-generate.test.d.ts → browser/find.test.d.ts} +0 -0
package/README.md CHANGED
@@ -11,18 +11,18 @@
11
11
  OpenCLI gives you one surface for three different kinds of automation:
12
12
 
13
13
  - **Use built-in adapters** for sites like Bilibili, Zhihu, Xiaohongshu, Reddit, HackerNews, Twitter/X, and [many more](#built-in-commands).
14
- - **Drive a live browser directly** with `opencli browser` when an AI agent needs to click, type, extract, or inspect a page in real time.
15
- - **Generate new adapters** from real browser behavior with `explore`, `synthesize`, `generate`, and `cascade`.
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, extract, and inspect any page through your logged-in browser via `opencli browser` primitives.
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
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
19
  ## Highlights
20
20
 
21
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`.
22
+ - **Browser Automation for AI Agents** — Install the `opencli-adapter-author` skill, and your AI agent can operate any website: navigate, click, type, extract, screenshot — all through your logged-in Chrome session.
23
+ - **Website → CLI** — Turn any website into a deterministic CLI: 90+ pre-built adapters, or write your own with the `opencli-adapter-author` skill + `opencli browser verify`.
24
24
  - **Account-safe** — Reuses Chrome/Chromium logged-in state; your credentials never leave the browser.
25
- - **AI Agent ready** — `explore` discovers APIs, `synthesize` generates adapters, `cascade` finds auth strategies, `browser` controls the browser directly.
25
+ - **AI Agent ready** — One skill takes you from site recon through API discovery, field decoding, adapter writing, and verification.
26
26
  - **CLI Hub** — Discover, auto-install, and passthrough commands to any external CLI (gh, docker, obsidian, etc).
27
27
  - **Zero LLM cost** — No tokens consumed at runtime. Run 10,000 times and pay nothing.
28
28
  - **Deterministic** — Same command, same output schema, every time. Pipeable, scriptable, CI-friendly.
@@ -70,12 +70,9 @@ Use OpenCLI directly when you want a reliable command instead of a live browser
70
70
 
71
71
  ## For AI Agents
72
72
 
73
- Use two different entry points depending on the task:
73
+ 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.
74
74
 
75
- - [`skills/opencli-explorer/SKILL.md`](./skills/opencli-explorer/SKILL.md): the entry point for creating new adapters — supports both fully automated generation (`opencli generate <url>`) and manual exploration workflows.
76
- - [`skills/opencli-browser/SKILL.md`](./skills/opencli-browser/SKILL.md): the low-level control surface for live browsing, debugging, and manual intervention.
77
-
78
- Install the packaged skills with:
75
+ ### Install skills
79
76
 
80
77
  ```bash
81
78
  npx skills add jackwener/opencli
@@ -84,40 +81,62 @@ npx skills add jackwener/opencli
84
81
  Or install only what you need:
85
82
 
86
83
  ```bash
87
- npx skills add jackwener/opencli --skill opencli-usage
88
- npx skills add jackwener/opencli --skill opencli-browser
89
- npx skills add jackwener/opencli --skill opencli-explorer
90
- npx skills add jackwener/opencli --skill opencli-oneshot
84
+ npx skills add jackwener/opencli --skill opencli-adapter-author
85
+ npx skills add jackwener/opencli --skill opencli-autofix
86
+ npx skills add jackwener/opencli --skill smart-search
91
87
  ```
92
88
 
93
- In practice:
89
+ ### Which skill to use
94
90
 
95
- - start with `opencli-explorer` when the agent needs a reusable command for a site (it covers both automated and manual flows)
96
- - use `opencli-browser` when the agent needs to inspect or steer the page directly
91
+ | Skill | When to use | Example prompt to your AI agent |
92
+ |-------|------------|-------------------------------|
93
+ | **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" |
94
+ | **opencli-autofix** | Repair a broken adapter when a built-in command fails | "`opencli zhihu hot` is returning empty — fix it" |
95
+ | **smart-search** | Search across existing OpenCLI capabilities | "Find me a Bilibili trending adapter" |
97
96
 
98
- Available browser commands include `open`, `state`, `click`, `type`, `select`, `keys`, `wait`, `get`, `screenshot`, `scroll`, `back`, `eval`, `network`, `init`, `verify`, and `close`.
97
+ ### How it works
99
98
 
100
- ## Core Concepts
99
+ Once `opencli-adapter-author` is installed, your AI agent can:
101
100
 
102
- ### `browser`: live control
101
+ 1. **Navigate** to any URL using your logged-in browser
102
+ 2. **Read** page content via structured DOM snapshots (not screenshots)
103
+ 3. **Interact** — click buttons, fill forms, select options, press keys
104
+ 4. **Extract** data from the page or intercept network API responses
105
+ 5. **Wait** for elements, text, or page transitions
103
106
 
104
- Use `opencli browser` when the task is inherently interactive and the agent needs to operate the page directly.
107
+ The agent handles all the `opencli browser` commands internally you just describe what you want done in natural language.
105
108
 
106
- ### Built-in adapters: stable commands
109
+ **Skill references:**
110
+ - [`skills/opencli-adapter-author/SKILL.md`](./skills/opencli-adapter-author/SKILL.md) — browser operation + adapter authoring, end-to-end
111
+ - [`skills/opencli-autofix/SKILL.md`](./skills/opencli-autofix/SKILL.md) — repair broken adapters
112
+ - [`skills/smart-search/SKILL.md`](./skills/smart-search/SKILL.md) — capability search
107
113
 
108
- Use site-specific commands such as `opencli hackernews top` or `opencli reddit hot` when the capability already exists and you want deterministic output.
114
+ Available browser commands include `open`, `state`, `click`, `type`, `select`, `keys`, `wait`, `get`, `screenshot`, `scroll`, `back`, `eval`, `network`, `tab list`, `tab new`, `tab select`, `tab close`, `init`, `verify`, and `close`.
109
115
 
110
- ### `explore` / `synthesize` / `generate`: create new CLIs
116
+ `opencli browser open <url>` and `opencli browser tab new [url]` both return a target ID. Use `opencli browser tab list` to inspect the target IDs of tabs that already exist, 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 `opencli browser ...` commands.
111
117
 
112
- Use these commands when the site you need is not covered yet:
118
+ ## Core Concepts
113
119
 
114
- - `explore` inspects the page, network activity, and capability surface.
115
- - `synthesize` turns exploration artifacts into evaluate-based JS adapters.
116
- - `generate` runs the verified generation path and returns either a usable command or a structured explanation of why completion was blocked or needs human review.
120
+ ### `browser`: AI Agent browser control
117
121
 
118
- ### `cascade`: auth strategy discovery
122
+ `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.
123
+
124
+ For example, tell your agent: *"Help me check my Xiaohongshu notifications"* — the agent will use `opencli browser open`, `state`, `click`, etc. under the hood.
125
+
126
+ ### Built-in adapters: stable commands
119
127
 
120
- Use `cascade` to probe fallback auth paths such as public endpoints, cookies, and custom headers before you commit to an adapter design.
128
+ 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.
129
+
130
+ ### Writing a new adapter
131
+
132
+ When the site you need is not yet covered, use the `opencli-adapter-author` skill. It takes the agent end-to-end:
133
+
134
+ 1. Recon the site and classify its pattern (SPA / SSR / JSONP / Token / Streaming).
135
+ 2. Discover the right endpoint — network inspection, initial state, bundle search, token trace, or interceptor fallback.
136
+ 3. Decide the auth strategy — `PUBLIC` / `COOKIE` / `HEADER` / `INTERCEPT`.
137
+ 4. Decode response fields and design output columns.
138
+ 5. `opencli browser init <site>/<name>` → write adapter → `opencli browser verify <site>/<name>`.
139
+ 6. Persist site knowledge to `~/.opencli/sites/<site>/` so the next adapter for the same site is faster.
121
140
 
122
141
  ### CLI Hub and desktop adapters
123
142
 
@@ -138,16 +157,18 @@ OpenCLI is not only for websites. It can also:
138
157
  | Variable | Default | Description |
139
158
  |----------|---------|-------------|
140
159
  | `OPENCLI_DAEMON_PORT` | `19825` | HTTP port for the daemon-extension bridge |
141
- | `OPENCLI_WINDOW_FOCUSED` | `false` | Set to `1` to open automation windows in the foreground (useful for debugging) |
160
+ | `OPENCLI_WINDOW_FOCUSED` | `false` | Set to `1` to open automation windows in the foreground (useful for debugging). The `--focus` flag sets this. |
161
+ | `OPENCLI_LIVE` | `false` | Set to `1` to keep the automation window open after an adapter command finishes (useful for inspection). The `--live` flag sets this. |
142
162
  | `OPENCLI_BROWSER_CONNECT_TIMEOUT` | `30` | Seconds to wait for browser connection |
143
163
  | `OPENCLI_BROWSER_COMMAND_TIMEOUT` | `60` | Seconds to wait for a single browser command |
144
- | `OPENCLI_BROWSER_EXPLORE_TIMEOUT` | `120` | Seconds to wait for explore/record operations |
145
164
  | `OPENCLI_CDP_ENDPOINT` | — | Chrome DevTools Protocol endpoint for remote browser or Electron apps |
146
165
  | `OPENCLI_CDP_TARGET` | — | Filter CDP targets by URL substring (e.g. `detail.1688.com`) |
147
166
  | `OPENCLI_VERBOSE` | `false` | Enable verbose logging (`-v` flag also works) |
148
167
  | `OPENCLI_DIAGNOSTIC` | `false` | Set to `1` to capture structured diagnostic context on failures |
149
168
  | `DEBUG_SNAPSHOT` | — | Set to `1` for DOM snapshot debug output |
150
169
 
170
+ `--focus` works for both `opencli browser *` and browser-backed adapter commands. `--live` is mainly for adapter commands: browser subcommands already keep the automation window open until you run `opencli browser close` or the idle timeout expires.
171
+
151
172
  ## Update
152
173
 
153
174
  ```bash
@@ -160,10 +181,9 @@ npx skills add jackwener/opencli
160
181
  Or refresh only the skills you actually use:
161
182
 
162
183
  ```bash
163
- npx skills add jackwener/opencli --skill opencli-usage
164
- npx skills add jackwener/opencli --skill opencli-browser
165
- npx skills add jackwener/opencli --skill opencli-explorer
166
- npx skills add jackwener/opencli --skill opencli-oneshot
184
+ npx skills add jackwener/opencli --skill opencli-adapter-author
185
+ npx skills add jackwener/opencli --skill opencli-autofix
186
+ npx skills add jackwener/opencli --skill smart-search
167
187
  ```
168
188
 
169
189
  ## For Developers
@@ -188,10 +208,10 @@ To load the source Browser Bridge extension:
188
208
  | Site | Commands |
189
209
  |------|----------|
190
210
  | **xiaohongshu** | `search` `note` `comments` `feed` `user` `download` `publish` `notifications` `creator-notes` `creator-notes-summary` `creator-note-detail` `creator-profile` `creator-stats` |
191
- | **bilibili** | `hot` `search` `history` `feed` `ranking` `download` `comments` `dynamic` `favorite` `following` `me` `subtitle` `user-videos` |
211
+ | **bilibili** | `hot` `search` `history` `feed` `ranking` `download` `comments` `dynamic` `favorite` `following` `me` `subtitle` `video` `user-videos` |
192
212
  | **tieba** | `hot` `posts` `search` `read` |
193
213
  | **hupu** | `hot` `search` `detail` `mentions` `reply` `like` `unlike` |
194
- | **twitter** | `trending` `search` `timeline` `lists` `bookmarks` `post` `download` `profile` `article` `like` `likes` `notifications` `reply` `reply-dm` `thread` `follow` `unfollow` `followers` `following` `block` `unblock` `bookmark` `unbookmark` `delete` `hide-reply` `accept` |
214
+ | **twitter** | `trending` `search` `timeline` `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` |
195
215
  | **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `upvoted` `save` `saved` `comment` `subscribe` |
196
216
  | **zhihu** | `hot` `search` `question` `download` `follow` `like` `favorite` `comment` `answer` |
197
217
  | **amazon** | `bestsellers` `search` `product` `offer` `discussion` `movers-shakers` `new-releases` |
@@ -205,11 +225,17 @@ To load the source Browser Bridge extension:
205
225
  | **xiaoe** | `courses` `detail` `catalog` `play-url` `content` |
206
226
  | **quark** | `ls` `mkdir` `mv` `rename` `rm` `save` `share-tree` |
207
227
  | **uiverse** | `code` `preview` |
208
- | **xiaoyuzhou** | `podcast` `podcast-episodes` `episode` `download` `transcript*` |
228
+ | **baidu-scholar** | `search` |
229
+ | **google-scholar** | `search` |
230
+ | **gov-law** | `search` `recent` |
231
+ | **gov-policy** | `search` `recent` |
232
+ | **nowcoder** | `hot` `trending` `topics` `recommend` `creators` `companies` `jobs` `search` `suggest` `experience` `referral` `salary` `papers` `practice` `notifications` `detail` |
233
+ | **wanfang** | `search` |
234
+ | **xiaoyuzhou** | `podcast*` `podcast-episodes*` `episode*` `download*` `transcript*` |
209
235
 
210
- 87+ adapters in total — **[→ see all supported sites & commands](./docs/adapters/index.md)**
236
+ 90+ adapters in total — **[→ see all supported sites & commands](./docs/adapters/index.md)**
211
237
 
212
- `*` `opencli xiaoyuzhou transcript` requires local Xiaoyuzhou credentials in `~/.opencli/xiaoyuzhou.json`.
238
+ `*` `opencli xiaoyuzhou podcast`, `podcast-episodes`, `episode`, `download`, and `transcript` require local Xiaoyuzhou credentials in `~/.opencli/xiaoyuzhou.json`.
213
239
 
214
240
  ## CLI Hub
215
241
 
@@ -260,7 +286,7 @@ OpenCLI supports downloading images, videos, and articles from supported platfor
260
286
  | **douban** | Images | Poster / still image lists |
261
287
  | **pixiv** | Images | Original-quality illustrations, multi-page |
262
288
  | **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 |
289
+ | **xiaoyuzhou** | Audio, Transcript | Downloads episode audio and transcript JSON/text with local credentials |
264
290
  | **zhihu** | Articles (Markdown) | Exports with optional image download |
265
291
  | **weixin** | Articles (Markdown) | WeChat Official Account articles |
266
292
 
@@ -276,7 +302,7 @@ opencli xiaoyuzhou download 69b3b675772ac2295bfc01d0 --output ./xiaoyuzhou
276
302
  opencli xiaoyuzhou transcript 69dd0c98e2c8be31551f6a33 --output ./xiaoyuzhou-transcripts
277
303
  ```
278
304
 
279
- `opencli xiaoyuzhou transcript` requires local Xiaoyuzhou credentials in `~/.opencli/xiaoyuzhou.json`.
305
+ `opencli xiaoyuzhou download` and `transcript` require local Xiaoyuzhou credentials in `~/.opencli/xiaoyuzhou.json`.
280
306
 
281
307
  ## Output Formats
282
308
 
@@ -332,16 +358,15 @@ See [Plugins Guide](./docs/guide/plugins.md) for creating your own plugin.
332
358
 
333
359
  ## For AI Agents (Developer Guide)
334
360
 
335
- > **Quick mode**: To generate a single command for a specific page URL, see [opencli-oneshot skill](./skills/opencli-oneshot/SKILL.md) just a URL + one-line goal, 4 steps done.
361
+ Before writing any adapter code, read the [`opencli-adapter-author` skill](./skills/opencli-adapter-author/SKILL.md). It takes you end-to-end:
336
362
 
337
- > **Full mode**: Before writing any adapter code, read [opencli-explorer skill](./skills/opencli-explorer/SKILL.md). It contains the complete browser exploration workflow, the 5-tier authentication strategy decision tree, and debugging guide.
363
+ - Recon the site and pick a pattern (SPA / SSR / JSONP / Token / Streaming).
364
+ - Discover the right endpoint via `opencli browser network`, `eval`, or the interceptor fallback.
365
+ - Decide auth strategy (`PUBLIC` / `COOKIE` / `HEADER` / `INTERCEPT`).
366
+ - Decode response fields, design columns, scaffold with `opencli browser init`.
367
+ - Verify with `opencli browser verify <site>/<name>` before shipping.
338
368
 
339
- ```bash
340
- opencli explore https://example.com --site mysite # Discover APIs + capabilities
341
- opencli synthesize mysite # Generate JS adapters
342
- opencli generate https://example.com --goal "hot" # One-shot: explore → synthesize → register
343
- opencli cascade https://api.example.com/data # Auto-probe: PUBLIC → COOKIE → HEADER
344
- ```
369
+ Adapters you write outside the repo 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.
345
370
 
346
371
  ## Testing
347
372
 
package/README.zh-CN.md CHANGED
@@ -10,19 +10,19 @@
10
10
 
11
11
  OpenCLI 可以用同一套 CLI 做三类事情:
12
12
 
13
- - **直接使用现成适配器**:B站、知乎、小红书、Twitter/X、Reddit、HackerNews 等 [87+ 站点](#内置命令) 开箱即用。
14
- - **直接驱动浏览器**:用 `opencli browser` AI Agent 实时点击、输入、提取、截图、检查页面状态。
15
- - **把新网站生成成 CLI**:通过 `explore`、`synthesize`、`generate`、`cascade` 从真实页面行为推导出新的适配器。
13
+ - **直接使用现成适配器**:B站、知乎、小红书、Twitter/X、Reddit、HackerNews 等 [90+ 站点](#内置命令) 开箱即用。
14
+ - **让 AI Agent 操作任意网站**:在你的 AI Agent(Claude Code、Cursor 等)中安装 `opencli-adapter-author` skill,Agent 就能用你的已登录浏览器导航、点击、输入、提取任意网页内容。
15
+ - **把新网站写成 CLI**:用 `opencli browser` 原语 + `opencli-adapter-author` skill,从站点侦察、API 发现、字段解码到 `opencli browser verify` 一条龙。
16
16
 
17
17
  除了网站能力,OpenCLI 还是一个 **CLI 枢纽**:你可以把 `gh`、`docker` 等本地工具统一注册到 `opencli` 下,也可以通过桌面端适配器控制 Cursor、Codex、Antigravity、ChatGPT、Notion 等 Electron 应用。
18
18
 
19
19
  ## 亮点
20
20
 
21
21
  - **桌面应用控制** — 通过 CDP 直接在终端驱动 Electron 应用(Cursor、Codex、ChatGPT、Notion 等)。
22
- - **浏览器自动化** — `browser` AI Agent 直接控制浏览器:点击、输入、提取、截图,完全可编程。
23
- - **网站 → CLI** — 把任何网站变成确定性 CLI:87+ 内置适配器,或用 `opencli generate` 生成新的。
22
+ - **AI Agent 浏览器自动化** 安装 `opencli-adapter-author` skill,你的 AI Agent 就能操作任意网站:导航、点击、输入、提取、截图——全部通过你的已登录 Chrome 会话完成。
23
+ - **网站 → CLI** — 把任何网站变成确定性 CLI:90+ 内置适配器,或用 `opencli-adapter-author` skill + `opencli browser verify` 自己写。
24
24
  - **账号安全** — 复用 Chrome/Chromium 登录态,凭证永远不会离开浏览器。
25
- - **面向 AI Agent** — `explore` 发现 API,`synthesize` 生成适配器,`cascade` 探测认证策略,`browser` 直接控制浏览器。
25
+ - **面向 AI Agent** — 一个 skill 带你走完站点侦察、API 发现、字段解码、适配器编写、验证的全流程。
26
26
  - **CLI 枢纽** — 统一发现、自动安装、纯透传任何外部 CLI(gh、docker、obsidian 等)。
27
27
  - **零 LLM 成本** — 运行时不消耗模型 token,跑 10,000 次也不花一分钱。
28
28
  - **确定性输出** — 相同命令,相同输出结构,每次一致。可管道、可脚本、CI 友好。
@@ -68,12 +68,9 @@ opencli bilibili hot --limit 5
68
68
 
69
69
  ## 给 AI Agent
70
70
 
71
- 按任务类型,AI Agent 有两个不同入口:
71
+ OpenCLI 的 browser 命令是给 AI Agent 用的——不是手动执行的。把 skill 安装到你的 AI Agent(Claude Code、Cursor 等)中,Agent 就能用你的已登录 Chrome 会话替你操作网站。
72
72
 
73
- - [`skills/opencli-explorer/SKILL.md`](./skills/opencli-explorer/SKILL.md):适配器创建入口,支持全自动生成(`opencli generate <url>`)和手动探索两种流程。
74
- - [`skills/opencli-browser/SKILL.md`](./skills/opencli-browser/SKILL.md):底层控制入口,适合实时操作页面、debug 和人工介入。
75
-
76
- 安装全部 OpenCLI skills:
73
+ ### 安装 skill
77
74
 
78
75
  ```bash
79
76
  npx skills add jackwener/opencli
@@ -82,40 +79,62 @@ npx skills add jackwener/opencli
82
79
  或只装需要的 skill:
83
80
 
84
81
  ```bash
85
- npx skills add jackwener/opencli --skill opencli-usage
86
- npx skills add jackwener/opencli --skill opencli-browser
87
- npx skills add jackwener/opencli --skill opencli-explorer
88
- npx skills add jackwener/opencli --skill opencli-oneshot
82
+ npx skills add jackwener/opencli --skill opencli-adapter-author
83
+ npx skills add jackwener/opencli --skill opencli-autofix
84
+ npx skills add jackwener/opencli --skill smart-search
89
85
  ```
90
86
 
91
- 实际使用上:
87
+ ### 选择哪个 skill
92
88
 
93
- - 需要把某个站点收成可复用命令时,优先走 `opencli-explorer`(涵盖自动和手动两种路径)
94
- - 需要直接检查页面、操作页面时,再走 `opencli-browser`
89
+ | Skill | 适用场景 | 你对 AI Agent 说的话 |
90
+ |-------|---------|-------------------|
91
+ | **opencli-adapter-author** | 实时操作任意网站,或为新站点写可复用适配器 | "帮我看看小红书的通知" / "帮我做一个抖音热门的适配器" / "帮我做一个抓取这个页面热帖的命令" |
92
+ | **opencli-autofix** | 内置命令失败时修复已有适配器 | "`opencli zhihu hot` 返回空了,修一下" |
93
+ | **smart-search** | 在现有 OpenCLI 能力里搜索 | "帮我找个 B 站热门相关的适配器" |
95
94
 
96
- `browser` 可用命令包括:`open`、`state`、`click`、`type`、`select`、`keys`、`wait`、`get`、`screenshot`、`scroll`、`back`、`eval`、`network`、`init`、`verify`、`close`。
95
+ ### 工作原理
97
96
 
98
- ## 核心概念
97
+ 安装 `opencli-adapter-author` skill 后,你的 AI Agent 可以:
99
98
 
100
- ### `browser`:实时操作
99
+ 1. **导航**到任意 URL,使用你的已登录浏览器
100
+ 2. **读取**页面内容——通过结构化 DOM 快照(不是截图)
101
+ 3. **交互**——点击按钮、填写表单、选择选项、按键
102
+ 4. **提取**页面数据或拦截网络 API 响应
103
+ 5. **等待**元素、文本或页面跳转
101
104
 
102
- 当任务本身就是交互式页面操作时,使用 `opencli browser` 直接驱动浏览器。
105
+ Agent 在内部自动处理所有 `opencli browser` 命令——你只需用自然语言描述想做的事。
103
106
 
104
- ### 内置适配器:稳定命令
107
+ **Skill 参考文档:**
108
+ - [`skills/opencli-adapter-author/SKILL.md`](./skills/opencli-adapter-author/SKILL.md) — 浏览器操作 + 适配器编写,全流程
109
+ - [`skills/opencli-autofix/SKILL.md`](./skills/opencli-autofix/SKILL.md) — 修复已有适配器
110
+ - [`skills/smart-search/SKILL.md`](./skills/smart-search/SKILL.md) — 能力搜索
105
111
 
106
- 当某个站点能力已经存在时,优先使用 `opencli hackernews top`、`opencli reddit hot` 这类稳定命令,而不是重新走一遍浏览器操作。
112
+ `browser` 可用命令包括:`open`、`state`、`click`、`type`、`select`、`keys`、`wait`、`get`、`screenshot`、`scroll`、`back`、`eval`、`network`、`tab list`、`tab new`、`tab select`、`tab close`、`init`、`verify`、`close`。
107
113
 
108
- ### `explore` / `synthesize` / `generate`:生成新的 CLI
114
+ `opencli browser open <url>` 和 `opencli browser tab new [url]` 都会返回 target ID。`opencli browser tab list` 用来查看当前已存在 tab 的 target ID,再通过 `--tab <targetId>` 把命令明确路由到某个 tab。`tab new` 只会新建 tab,不会改变默认浏览器目标;只有显式执行 `tab select <targetId>`,才会把该 tab 设为后续未指定 target 的 `opencli browser ...` 命令的默认目标。
115
+
116
+ ## 核心概念
109
117
 
110
- 当你需要的网站还没覆盖时:
118
+ ### `browser`:AI Agent 的浏览器控制层
119
+
120
+ `opencli browser` 命令是 AI Agent 操作网站的底层原语。你不需要手动运行这些命令——把 `opencli-adapter-author` skill 安装到你的 AI Agent 中,用自然语言描述你想做的事,Agent 会自动处理浏览器操作。
121
+
122
+ 比如你告诉 Agent:*"帮我看看小红书的通知"*——Agent 会在底层调用 `opencli browser open`、`state`、`click` 等命令。
123
+
124
+ ### 内置适配器:稳定命令
111
125
 
112
- - `explore` 负责观察页面、网络请求和能力边界
113
- - `synthesize` 负责把探索结果转成 evaluate-based YAML 适配器
114
- - `generate` 负责跑通 verified generation 主链路,最后要么给出可直接使用的命令,要么返回结构化的阻塞原因 / 人工介入结果
126
+ 当某个站点能力已经存在时,优先使用 `opencli hackernews top`、`opencli reddit hot` 这类稳定命令。这些命令是确定性的,无需浏览器——人类和 AI Agent 都可以直接使用。
115
127
 
116
- ### `cascade`:认证策略探测
128
+ ### 为新站点写适配器
117
129
 
118
- `cascade` 去判断某个能力应该优先走公开接口、Cookie 还是自定义 Header,而不是一开始就把适配器写死。
130
+ 当你需要的网站还没覆盖时,用 `opencli-adapter-author` skill,它会把 Agent 带到闭环:
131
+
132
+ 1. 侦察站点,分类 pattern(SPA / SSR / JSONP / Token / Streaming)
133
+ 2. 发现目标 endpoint——network 精读、initial state、bundle 搜索、token 溯源,或 interceptor 兜底
134
+ 3. 定认证策略——`PUBLIC` / `COOKIE` / `HEADER` / `INTERCEPT`
135
+ 4. 字段解码 + 设计输出列
136
+ 5. `opencli browser init <site>/<name>` → 写适配器 → `opencli browser verify <site>/<name>`
137
+ 6. 把站点知识沉到 `~/.opencli/sites/<site>/`,下次写同站点的其他命令直接吃缓存
119
138
 
120
139
  ### CLI 枢纽与桌面端适配器
121
140
 
@@ -136,16 +155,18 @@ OpenCLI 不只是网站 CLI,还可以:
136
155
  | 变量 | 默认值 | 说明 |
137
156
  |------|--------|------|
138
157
  | `OPENCLI_DAEMON_PORT` | `19825` | daemon-extension 通信端口 |
139
- | `OPENCLI_WINDOW_FOCUSED` | `false` | 设为 `1` 时 automation 窗口在前台打开(适合调试) |
158
+ | `OPENCLI_WINDOW_FOCUSED` | `false` | 设为 `1` 时 automation 窗口在前台打开(适合调试)。`--focus` 标志会设置此变量 |
159
+ | `OPENCLI_LIVE` | `false` | 设为 `1` 时 adapter 命令执行完后保留 automation 窗口不关闭(适合检查页面)。`--live` 标志会设置此变量 |
140
160
  | `OPENCLI_BROWSER_CONNECT_TIMEOUT` | `30` | 浏览器连接超时(秒) |
141
161
  | `OPENCLI_BROWSER_COMMAND_TIMEOUT` | `60` | 单个浏览器命令超时(秒) |
142
- | `OPENCLI_BROWSER_EXPLORE_TIMEOUT` | `120` | explore/record 操作超时(秒) |
143
162
  | `OPENCLI_CDP_ENDPOINT` | — | Chrome DevTools Protocol 端点,用于远程浏览器或 Electron 应用 |
144
163
  | `OPENCLI_CDP_TARGET` | — | 按 URL 子串过滤 CDP target(如 `detail.1688.com`) |
145
164
  | `OPENCLI_VERBOSE` | `false` | 启用详细日志(`-v` 也可以) |
146
165
  | `OPENCLI_DIAGNOSTIC` | `false` | 设为 `1` 时在失败时输出结构化诊断上下文 |
147
166
  | `DEBUG_SNAPSHOT` | — | 设为 `1` 输出 DOM 快照调试信息 |
148
167
 
168
+ `--focus` 同时适用于 `opencli browser *` 和浏览器型 adapter 命令。`--live` 主要是给 adapter 命令用的:`browser` 子命令本来就会一直保留 automation window,直到你手动执行 `opencli browser close` 或等空闲超时。
169
+
149
170
  ## 更新
150
171
 
151
172
  ```bash
@@ -158,10 +179,9 @@ npx skills add jackwener/opencli
158
179
  如果你只装了部分 skill,也可以只刷新自己在用的:
159
180
 
160
181
  ```bash
161
- npx skills add jackwener/opencli --skill opencli-usage
162
- npx skills add jackwener/opencli --skill opencli-browser
163
- npx skills add jackwener/opencli --skill opencli-explorer
164
- npx skills add jackwener/opencli --skill opencli-oneshot
182
+ npx skills add jackwener/opencli --skill opencli-adapter-author
183
+ npx skills add jackwener/opencli --skill opencli-autofix
184
+ npx skills add jackwener/opencli --skill smart-search
165
185
  ```
166
186
 
167
187
  ## 面向开发者
@@ -187,12 +207,12 @@ npm link
187
207
 
188
208
  | 站点 | 命令 | 模式 |
189
209
  |------|------|------|
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` | 浏览器 |
210
+ | **twitter** | `trending` `search` `timeline` `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` | 浏览器 |
191
211
  | **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` | 浏览器 |
192
212
  | **tieba** | `hot` `posts` `search` `read` | 浏览器 |
193
213
  | **hupu** | `hot` `search` `detail` `mentions` `reply` `like` `unlike` | 浏览器 |
194
214
  | **cursor** | `status` `send` `read` `new` `dump` `composer` `model` `extract-code` `ask` `screenshot` `history` `export` | 桌面端 |
195
- | **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `dynamic` `ranking` `following` `user-videos` `download` | 浏览器 |
215
+ | **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `video` `dynamic` `ranking` `following` `user-videos` `download` | 浏览器 |
196
216
  | **codex** | `status` `send` `read` `new` `dump` `extract-diff` `model` `ask` `screenshot` `history` `export` | 桌面端 |
197
217
  | **chatwise** | `status` `new` `send` `read` `ask` `model` `history` `export` `screenshot` | 桌面端 |
198
218
  | **doubao** | `status` `new` `send` `read` `ask` `history` `detail` `meeting-summary` `meeting-transcript` | 浏览器 |
@@ -201,14 +221,20 @@ npm link
201
221
  | **discord-app** | `status` `send` `read` `channels` `servers` `search` `members` | 桌面端 |
202
222
  | **v2ex** | `hot` `latest` `topic` `node` `user` `member` `replies` `nodes` `daily` `me` `notifications` | 公开 / 浏览器 |
203
223
  | **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `comments` `watchlist` `earnings-date` `fund-holdings` `fund-snapshot` | 浏览器 |
204
- | **antigravity** | `status` `send` `read` `new` `dump` `extract-code` `model` `watch` | 桌面端 |
224
+ | **antigravity** | `status` `send` `read` `new` `dump` `extract-code` `model` `watch` `serve` | 桌面端 |
205
225
  | **chatgpt-app** | `status` `new` `send` `read` `ask` `model` | 桌面端 |
206
226
  | **xiaohongshu** | `search` `notifications` `feed` `user` `download` `publish` `creator-notes` `creator-note-detail` `creator-notes-summary` `creator-profile` `creator-stats` | 浏览器 |
207
227
  | **xiaoe** | `courses` `detail` `catalog` `play-url` `content` | 浏览器 |
208
228
  | **quark** | `ls` `mkdir` `mv` `rename` `rm` `save` `share-tree` | 浏览器 |
209
229
  | **uiverse** | `code` `preview` | 浏览器 |
210
230
  | **apple-podcasts** | `search` `episodes` `top` | 公开 |
211
- | **xiaoyuzhou** | `podcast` `podcast-episodes` `episode` `download` `transcript*` | 公开 |
231
+ | **baidu-scholar** | `search` | 公开 |
232
+ | **google-scholar** | `search` | 公开 |
233
+ | **gov-law** | `search` `recent` | 公开 |
234
+ | **gov-policy** | `search` `recent` | 公开 |
235
+ | **nowcoder** | `hot` `trending` `topics` `recommend` `creators` `companies` `jobs` `search` `suggest` `experience` `referral` `salary` `papers` `practice` `notifications` `detail` | 公开 / 浏览器 |
236
+ | **wanfang** | `search` | 公开 |
237
+ | **xiaoyuzhou** | `podcast*` `podcast-episodes*` `episode*` `download*` `transcript*` | 本地凭证 |
212
238
  | **zhihu** | `hot` `search` `question` `download` `follow` `like` `favorite` `comment` `answer` | 浏览器 |
213
239
  | **weixin** | `download` | 浏览器 |
214
240
  | **youtube** | `search` `video` `transcript` `comments` `channel` `playlist` `feed` `history` `watch-later` `subscriptions` `like` `unlike` `subscribe` `unsubscribe` | 浏览器 |
@@ -266,9 +292,9 @@ npm link
266
292
  | **douyin** | `videos` `publish` `drafts` `draft` `delete` `stats` `profile` `update` `hashtag` `location` `activities` `collections` | 浏览器 |
267
293
  | **yuanbao** | `new` `ask` | 浏览器 |
268
294
 
269
- 87+ 适配器 — **[→ 查看完整命令列表](./docs/adapters/index.md)**
295
+ 90+ 适配器 — **[→ 查看完整命令列表](./docs/adapters/index.md)**
270
296
 
271
- `*` `opencli xiaoyuzhou transcript` 需要本地小宇宙凭证:`~/.opencli/xiaoyuzhou.json`。
297
+ `*` `opencli xiaoyuzhou podcast`、`podcast-episodes`、`episode`、`download`、`transcript` 需要本地小宇宙凭证:`~/.opencli/xiaoyuzhou.json`。
272
298
 
273
299
  ### 外部 CLI 枢纽
274
300
 
@@ -322,7 +348,7 @@ OpenCLI 支持从各平台下载图片、视频和文章。
322
348
  | **Twitter/X** | 图片、视频 | 从用户媒体页或单条推文下载 |
323
349
  | **Pixiv** | 图片 | 下载原始画质插画,支持多页作品 |
324
350
  | **1688** | 图片、视频 | 下载商品页中可见的商品素材 |
325
- | **小宇宙** | 音频、转录 | 从公开单集数据下载音频,并使用本地凭证下载转录 JSON / 文本 |
351
+ | **小宇宙** | 音频、转录 | 使用本地凭证下载单集音频和转录 JSON / 文本 |
326
352
  | **知乎** | 文章(Markdown) | 导出文章,可选下载图片到本地 |
327
353
  | **微信公众号** | 文章(Markdown) | 导出微信公众号文章为 Markdown |
328
354
  | **豆瓣** | 图片 | 下载电影条目的海报 / 剧照图片 |
@@ -377,7 +403,7 @@ opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --download-images
377
403
  opencli weixin download --url "https://mp.weixin.qq.com/s/xxx" --output ./weixin
378
404
  ```
379
405
 
380
- `opencli xiaoyuzhou transcript` 需要本地小宇宙凭证:`~/.opencli/xiaoyuzhou.json`。
406
+ `opencli xiaoyuzhou download` 和 `transcript` 需要本地小宇宙凭证:`~/.opencli/xiaoyuzhou.json`。
381
407
 
382
408
 
383
409
 
@@ -448,25 +474,15 @@ opencli plugin uninstall my-tool # 卸载
448
474
 
449
475
  如果你是一个被要求查阅代码并编写新 `opencli` 适配器的 AI,请遵守以下工作流。
450
476
 
451
- > **快速模式**:只想为某个页面快速生成一个命令?看 [opencli-oneshot skill](./skills/opencli-oneshot/SKILL.md) — 给一个 URL + 一句话描述,4 步搞定。
452
-
453
- > **完整模式**:在编写任何新代码前,先阅读 [opencli-explorer skill](./skills/opencli-explorer/SKILL.md)。它包含完整的适配器探索开发指南、API 探测流程、5级认证策略以及常见陷阱。
454
-
455
- ```bash
456
- # 1. Deep Explore — 网络拦截 → 响应分析 → 能力推理 → 框架检测
457
- opencli explore https://example.com --site mysite
458
-
459
- # 2. Synthesize — 从探索成果物生成 evaluate-based TS 适配器
460
- opencli synthesize mysite
477
+ 在动代码前,先读 [`opencli-adapter-author` skill](./skills/opencli-adapter-author/SKILL.md)。它把整个流程串起来:
461
478
 
462
- # 3. Generate 一键完成:探索 合成 注册
463
- opencli generate https://example.com --goal "hot"
464
-
465
- # 4. Strategy Cascade 自动降级探测:PUBLIC → COOKIE → HEADER
466
- opencli cascade https://api.example.com/data
467
- ```
479
+ - 侦察站点,选定 pattern(SPA / SSR / JSONP / Token / Streaming)
480
+ - 用 `opencli browser network`、`eval`、interceptor 等找到目标 endpoint
481
+ - 定认证策略(`PUBLIC` / `COOKIE` / `HEADER` / `INTERCEPT`)
482
+ - 字段解码、设计 columns、`opencli browser init` 生成骨架
483
+ - 交付前用 `opencli browser verify <site>/<name>` 验证
468
484
 
469
- 探索结果输出到 `.opencli/explore/<site>/`。
485
+ 在仓库外写的私有适配器放到 `~/.opencli/clis/<site>/<name>.js`;每个站点的 endpoint、字段映射、抓包样本会累积在 `~/.opencli/sites/<site>/`,下次写同站点的其他命令可以直接复用。
470
486
 
471
487
  ## 常见问题排查
472
488