@jackwener/opencli 1.7.3 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -59
- package/README.zh-CN.md +93 -67
- package/cli-manifest.json +5015 -2975
- package/clis/antigravity/serve.js +71 -25
- package/clis/baidu-scholar/search.js +87 -0
- package/clis/baidu-scholar/search.test.js +23 -0
- package/clis/bilibili/favorite.js +18 -13
- package/clis/binance/depth.js +3 -4
- package/clis/boss/utils.js +2 -3
- package/clis/chatgpt-app/ax.js +6 -3
- package/clis/deepseek/ask.js +74 -0
- package/clis/deepseek/history.js +25 -0
- package/clis/deepseek/new.js +20 -0
- package/clis/deepseek/read.js +22 -0
- package/clis/deepseek/status.js +24 -0
- package/clis/deepseek/utils.js +208 -0
- package/clis/douban/search.js +1 -0
- package/clis/douban/search.test.js +11 -0
- package/clis/douban/subject.js +20 -93
- package/clis/douban/subject.test.js +11 -0
- package/clis/douban/utils.js +250 -8
- package/clis/douban/utils.test.js +179 -4
- package/clis/doubao/utils.js +319 -130
- package/clis/doubao/utils.test.js +241 -2
- package/clis/eastmoney/_secid.js +78 -0
- package/clis/eastmoney/announcement.js +52 -0
- package/clis/eastmoney/convertible.js +73 -0
- package/clis/eastmoney/etf.js +65 -0
- package/clis/eastmoney/holders.js +78 -0
- package/clis/eastmoney/hot-rank.js +50 -0
- package/clis/eastmoney/hot-rank.test.js +59 -0
- package/clis/eastmoney/index-board.js +96 -0
- package/clis/eastmoney/kline.js +87 -0
- package/clis/eastmoney/kuaixun.js +54 -0
- package/clis/eastmoney/longhu.js +67 -0
- package/clis/eastmoney/money-flow.js +78 -0
- package/clis/eastmoney/northbound.js +57 -0
- package/clis/eastmoney/quote.js +107 -0
- package/clis/eastmoney/rank.js +94 -0
- package/clis/eastmoney/sectors.js +76 -0
- package/clis/google-scholar/search.js +58 -0
- package/clis/google-scholar/search.test.js +23 -0
- package/clis/gov-law/commands.test.js +39 -0
- package/clis/gov-law/recent.js +22 -0
- package/clis/gov-law/search.js +41 -0
- package/clis/gov-law/shared.js +51 -0
- package/clis/gov-policy/commands.test.js +27 -0
- package/clis/gov-policy/recent.js +47 -0
- package/clis/gov-policy/search.js +48 -0
- package/clis/grok/image.test.ts +107 -0
- package/clis/grok/image.ts +356 -0
- package/clis/nowcoder/companies.js +23 -0
- package/clis/nowcoder/creators.js +27 -0
- package/clis/nowcoder/detail.js +61 -0
- package/clis/nowcoder/experience.js +36 -0
- package/clis/nowcoder/hot.js +24 -0
- package/clis/nowcoder/jobs.js +21 -0
- package/clis/nowcoder/notifications.js +29 -0
- package/clis/nowcoder/papers.js +40 -0
- package/clis/nowcoder/practice.js +37 -0
- package/clis/nowcoder/recommend.js +30 -0
- package/clis/nowcoder/referral.js +39 -0
- package/clis/nowcoder/salary.js +40 -0
- package/clis/nowcoder/search.js +49 -0
- package/clis/nowcoder/suggest.js +33 -0
- package/clis/nowcoder/topics.js +27 -0
- package/clis/nowcoder/trending.js +25 -0
- package/clis/tdx/hot-rank.js +47 -0
- package/clis/tdx/hot-rank.test.js +59 -0
- package/clis/ths/hot-rank.js +49 -0
- package/clis/ths/hot-rank.test.js +64 -0
- package/clis/twitter/bookmarks.js +2 -1
- package/clis/twitter/list-add.js +337 -0
- package/clis/twitter/list-add.test.js +15 -0
- package/clis/twitter/list-remove.js +297 -0
- package/clis/twitter/list-remove.test.js +14 -0
- package/clis/twitter/list-tweets.js +185 -0
- package/clis/twitter/list-tweets.test.js +108 -0
- package/clis/twitter/lists.js +134 -47
- package/clis/twitter/lists.test.js +105 -38
- package/clis/uiverse/_shared.js +368 -0
- package/clis/uiverse/_shared.test.js +55 -0
- package/clis/uiverse/code.js +47 -0
- package/clis/uiverse/preview.js +71 -0
- package/clis/wanfang/search.js +66 -0
- package/clis/wanfang/search.test.js +23 -0
- package/clis/web/read.js +1 -1
- package/clis/weixin/download.js +3 -2
- package/clis/xiaohongshu/comments.js +2 -2
- package/clis/xiaohongshu/comments.test.js +46 -25
- package/clis/xiaohongshu/download.js +6 -7
- package/clis/xiaohongshu/download.test.js +17 -5
- package/clis/xiaohongshu/note-helpers.js +46 -12
- package/clis/xiaohongshu/note.js +3 -5
- package/clis/xiaohongshu/note.test.js +52 -25
- package/clis/xiaohongshu/publish.js +149 -28
- package/clis/xiaohongshu/publish.test.js +319 -6
- package/clis/xiaoyuzhou/auth.js +303 -0
- package/clis/xiaoyuzhou/auth.test.js +124 -0
- package/clis/xiaoyuzhou/download.js +53 -0
- package/clis/xiaoyuzhou/download.test.js +135 -0
- package/clis/xiaoyuzhou/episode.js +9 -4
- package/clis/xiaoyuzhou/podcast-episodes.js +15 -11
- package/clis/xiaoyuzhou/podcast.js +9 -4
- package/clis/xiaoyuzhou/transcript.js +76 -0
- package/clis/xiaoyuzhou/transcript.test.js +195 -0
- package/clis/xiaoyuzhou/utils.js +0 -40
- package/clis/xiaoyuzhou/utils.test.js +15 -75
- package/clis/youtube/feed.js +120 -0
- package/clis/youtube/history.js +118 -0
- package/clis/youtube/like.js +62 -0
- package/clis/youtube/playlist.js +97 -0
- package/clis/youtube/subscribe.js +71 -0
- package/clis/youtube/subscriptions.js +57 -0
- package/clis/youtube/unlike.js +62 -0
- package/clis/youtube/unsubscribe.js +71 -0
- package/clis/youtube/utils.js +122 -0
- package/clis/youtube/utils.test.js +32 -1
- package/clis/youtube/watch-later.js +76 -0
- package/clis/zsxq/dynamics.js +1 -1
- package/clis/zsxq/utils.js +6 -3
- package/clis/zsxq/utils.test.js +31 -0
- package/dist/src/browser/base-page.d.ts +1 -1
- package/dist/src/browser/base-page.js +25 -5
- package/dist/src/browser/bridge.d.ts +3 -0
- package/dist/src/browser/bridge.js +52 -15
- package/dist/src/browser/cdp.js +2 -1
- package/dist/src/browser/daemon-client.d.ts +7 -4
- package/dist/src/browser/daemon-client.js +6 -1
- package/dist/src/browser/daemon-client.test.js +40 -1
- package/dist/src/browser/dom-snapshot.js +20 -3
- package/dist/src/browser/page.d.ts +18 -5
- package/dist/src/browser/page.js +96 -15
- package/dist/src/browser/page.test.js +158 -1
- package/dist/src/browser/target-errors.d.ts +23 -0
- package/dist/src/browser/target-errors.js +29 -0
- package/dist/src/browser/target-errors.test.js +61 -0
- package/dist/src/browser/target-resolver.d.ts +57 -0
- package/dist/src/browser/target-resolver.js +298 -0
- package/dist/src/browser/target-resolver.test.js +43 -0
- package/dist/src/browser.test.js +38 -1
- package/dist/src/cli.js +272 -187
- package/dist/src/cli.test.js +167 -90
- package/dist/src/commanderAdapter.d.ts +0 -1
- package/dist/src/commanderAdapter.js +2 -16
- package/dist/src/commanderAdapter.test.js +1 -1
- package/dist/src/commands/daemon.d.ts +4 -2
- package/dist/src/commands/daemon.js +22 -2
- package/dist/src/commands/daemon.test.js +65 -2
- package/dist/src/completion-shared.js +2 -5
- package/dist/src/daemon.js +10 -0
- package/dist/src/doctor.d.ts +1 -0
- package/dist/src/doctor.js +32 -9
- package/dist/src/doctor.test.js +28 -12
- package/dist/src/download/article-download.d.ts +1 -0
- package/dist/src/download/article-download.js +3 -0
- package/dist/src/download/article-download.test.js +39 -0
- package/dist/src/external-clis.yaml +2 -2
- package/dist/src/logger.d.ts +2 -2
- package/dist/src/logger.js +3 -3
- package/dist/src/output.js +1 -5
- package/dist/src/output.test.js +0 -21
- package/dist/src/pipeline/steps/transform.js +1 -1
- package/dist/src/pipeline/template.d.ts +1 -0
- package/dist/src/pipeline/template.js +11 -3
- package/dist/src/pipeline/template.test.js +3 -0
- package/dist/src/pipeline/transform.test.js +14 -0
- package/dist/src/plugin.d.ts +8 -9
- package/dist/src/plugin.js +24 -28
- package/dist/src/plugin.test.js +16 -60
- package/dist/src/registry.d.ts +1 -0
- package/dist/src/registry.js +3 -2
- package/dist/src/registry.test.js +22 -0
- package/dist/src/types.d.ts +15 -6
- package/package.json +1 -1
- package/clis/twitter/lists-parser.js +0 -77
- package/clis/twitter/lists.d.ts +0 -5
- package/dist/src/cascade.d.ts +0 -46
- package/dist/src/cascade.js +0 -135
- package/dist/src/explore.d.ts +0 -99
- package/dist/src/explore.js +0 -402
- package/dist/src/generate-verified.d.ts +0 -105
- package/dist/src/generate-verified.js +0 -696
- package/dist/src/generate-verified.test.js +0 -925
- package/dist/src/generate.d.ts +0 -46
- package/dist/src/generate.js +0 -117
- package/dist/src/record.d.ts +0 -96
- package/dist/src/record.js +0 -657
- package/dist/src/record.test.js +0 -293
- package/dist/src/skill-generate.d.ts +0 -30
- package/dist/src/skill-generate.js +0 -75
- package/dist/src/skill-generate.test.js +0 -173
- package/dist/src/synthesize.d.ts +0 -97
- package/dist/src/synthesize.js +0 -208
- /package/dist/src/{generate-verified.test.d.ts → browser/target-errors.test.d.ts} +0 -0
- /package/dist/src/{record.test.d.ts → browser/target-resolver.test.d.ts} +0 -0
- /package/dist/src/{skill-generate.test.d.ts → download/article-download.test.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -11,29 +11,21 @@
|
|
|
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
|
-
- **
|
|
15
|
-
- **
|
|
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
|
-
## Why OpenCLI
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
19
|
## Highlights
|
|
24
20
|
|
|
25
|
-
- **
|
|
26
|
-
- **Browser Automation** — `
|
|
27
|
-
- **Website → CLI** — Turn any website into a deterministic CLI:
|
|
21
|
+
- **Desktop App Control** — Drive Electron apps (Cursor, Codex, ChatGPT, Notion, 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, 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`.
|
|
28
24
|
- **Account-safe** — Reuses Chrome/Chromium logged-in state; your credentials never leave the browser.
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
- **External CLI Hub** — Discover, auto-install, and passthrough commands to any external CLI (gh, obsidian, docker, etc). Zero setup.
|
|
32
|
-
- **Self-healing setup** — `opencli doctor` diagnoses and auto-starts the daemon, extension, and live browser connectivity.
|
|
33
|
-
- **Dynamic Loader** — Simply drop `.js` adapters into the `clis/` folder for auto-registration.
|
|
25
|
+
- **AI Agent ready** — One skill takes you from site recon through API discovery, field decoding, adapter writing, and verification.
|
|
26
|
+
- **CLI Hub** — Discover, auto-install, and passthrough commands to any external CLI (gh, docker, obsidian, etc).
|
|
34
27
|
- **Zero LLM cost** — No tokens consumed at runtime. Run 10,000 times and pay nothing.
|
|
35
28
|
- **Deterministic** — Same command, same output schema, every time. Pipeable, scriptable, CI-friendly.
|
|
36
|
-
- **Broad coverage** — 87+ sites across global and Chinese platforms (Bilibili, Zhihu, Xiaohongshu, Reddit, HackerNews, and more), plus desktop Electron apps via CDP.
|
|
37
29
|
|
|
38
30
|
---
|
|
39
31
|
|
|
@@ -49,7 +41,7 @@ npm install -g @jackwener/opencli
|
|
|
49
41
|
|
|
50
42
|
OpenCLI connects to Chrome/Chromium through a lightweight Browser Bridge extension plus a small local daemon. The daemon auto-starts when needed.
|
|
51
43
|
|
|
52
|
-
1. Download the latest `opencli-extension.zip` from the GitHub [Releases page](https://github.com/jackwener/opencli/releases).
|
|
44
|
+
1. Download the latest `opencli-extension-v{version}.zip` from the GitHub [Releases page](https://github.com/jackwener/opencli/releases).
|
|
53
45
|
2. Unzip it, open `chrome://extensions`, and enable **Developer mode**.
|
|
54
46
|
3. Click **Load unpacked** and select the unzipped folder.
|
|
55
47
|
|
|
@@ -78,12 +70,9 @@ Use OpenCLI directly when you want a reliable command instead of a live browser
|
|
|
78
70
|
|
|
79
71
|
## For AI Agents
|
|
80
72
|
|
|
81
|
-
|
|
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.
|
|
82
74
|
|
|
83
|
-
|
|
84
|
-
- [`skills/opencli-browser/SKILL.md`](./skills/opencli-browser/SKILL.md): the low-level control surface for live browsing, debugging, and manual intervention.
|
|
85
|
-
|
|
86
|
-
Install the packaged skills with:
|
|
75
|
+
### Install skills
|
|
87
76
|
|
|
88
77
|
```bash
|
|
89
78
|
npx skills add jackwener/opencli
|
|
@@ -92,40 +81,62 @@ npx skills add jackwener/opencli
|
|
|
92
81
|
Or install only what you need:
|
|
93
82
|
|
|
94
83
|
```bash
|
|
95
|
-
npx skills add jackwener/opencli --skill opencli-
|
|
96
|
-
npx skills add jackwener/opencli --skill opencli-
|
|
97
|
-
npx skills add jackwener/opencli --skill
|
|
98
|
-
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
|
|
99
87
|
```
|
|
100
88
|
|
|
101
|
-
|
|
89
|
+
### Which skill to use
|
|
102
90
|
|
|
103
|
-
|
|
104
|
-
|
|
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" |
|
|
105
96
|
|
|
106
|
-
|
|
97
|
+
### How it works
|
|
107
98
|
|
|
108
|
-
|
|
99
|
+
Once `opencli-adapter-author` is installed, your AI agent can:
|
|
109
100
|
|
|
110
|
-
|
|
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
|
|
111
106
|
|
|
112
|
-
|
|
107
|
+
The agent handles all the `opencli browser` commands internally — you just describe what you want done in natural language.
|
|
113
108
|
|
|
114
|
-
|
|
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
|
|
113
|
+
|
|
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`.
|
|
115
115
|
|
|
116
|
-
|
|
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.
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
## Core Concepts
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
### `browser`: AI Agent browser control
|
|
121
121
|
|
|
122
|
-
- `
|
|
123
|
-
- `synthesize` turns exploration artifacts into evaluate-based JS adapters.
|
|
124
|
-
- `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.
|
|
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.
|
|
125
123
|
|
|
126
|
-
|
|
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.
|
|
127
125
|
|
|
128
|
-
|
|
126
|
+
### Built-in adapters: stable commands
|
|
127
|
+
|
|
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.
|
|
129
140
|
|
|
130
141
|
### CLI Hub and desktop adapters
|
|
131
142
|
|
|
@@ -149,13 +160,10 @@ OpenCLI is not only for websites. It can also:
|
|
|
149
160
|
| `OPENCLI_WINDOW_FOCUSED` | `false` | Set to `1` to open automation windows in the foreground (useful for debugging) |
|
|
150
161
|
| `OPENCLI_BROWSER_CONNECT_TIMEOUT` | `30` | Seconds to wait for browser connection |
|
|
151
162
|
| `OPENCLI_BROWSER_COMMAND_TIMEOUT` | `60` | Seconds to wait for a single browser command |
|
|
152
|
-
| `OPENCLI_BROWSER_EXPLORE_TIMEOUT` | `120` | Seconds to wait for explore/record operations |
|
|
153
163
|
| `OPENCLI_CDP_ENDPOINT` | — | Chrome DevTools Protocol endpoint for remote browser or Electron apps |
|
|
154
164
|
| `OPENCLI_CDP_TARGET` | — | Filter CDP targets by URL substring (e.g. `detail.1688.com`) |
|
|
155
165
|
| `OPENCLI_VERBOSE` | `false` | Enable verbose logging (`-v` flag also works) |
|
|
156
166
|
| `OPENCLI_DIAGNOSTIC` | `false` | Set to `1` to capture structured diagnostic context on failures |
|
|
157
|
-
| `OUTPUT` | — | Override output format: `json`, `yaml`, or `table` |
|
|
158
|
-
| `DEBUG` | — | Set to `opencli` for internal debug logging |
|
|
159
167
|
| `DEBUG_SNAPSHOT` | — | Set to `1` for DOM snapshot debug output |
|
|
160
168
|
|
|
161
169
|
## Update
|
|
@@ -170,10 +178,9 @@ npx skills add jackwener/opencli
|
|
|
170
178
|
Or refresh only the skills you actually use:
|
|
171
179
|
|
|
172
180
|
```bash
|
|
173
|
-
npx skills add jackwener/opencli --skill opencli-
|
|
174
|
-
npx skills add jackwener/opencli --skill opencli-
|
|
175
|
-
npx skills add jackwener/opencli --skill
|
|
176
|
-
npx skills add jackwener/opencli --skill opencli-oneshot
|
|
181
|
+
npx skills add jackwener/opencli --skill opencli-adapter-author
|
|
182
|
+
npx skills add jackwener/opencli --skill opencli-autofix
|
|
183
|
+
npx skills add jackwener/opencli --skill smart-search
|
|
177
184
|
```
|
|
178
185
|
|
|
179
186
|
## For Developers
|
|
@@ -201,7 +208,7 @@ To load the source Browser Bridge extension:
|
|
|
201
208
|
| **bilibili** | `hot` `search` `history` `feed` `ranking` `download` `comments` `dynamic` `favorite` `following` `me` `subtitle` `user-videos` |
|
|
202
209
|
| **tieba** | `hot` `posts` `search` `read` |
|
|
203
210
|
| **hupu** | `hot` `search` `detail` `mentions` `reply` `like` `unlike` |
|
|
204
|
-
| **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` |
|
|
211
|
+
| **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` |
|
|
205
212
|
| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `upvoted` `save` `saved` `comment` `subscribe` |
|
|
206
213
|
| **zhihu** | `hot` `search` `question` `download` `follow` `like` `favorite` `comment` `answer` |
|
|
207
214
|
| **amazon** | `bestsellers` `search` `product` `offer` `discussion` `movers-shakers` `new-releases` |
|
|
@@ -214,8 +221,18 @@ To load the source Browser Bridge extension:
|
|
|
214
221
|
| **xianyu** | `search` `item` `chat` |
|
|
215
222
|
| **xiaoe** | `courses` `detail` `catalog` `play-url` `content` |
|
|
216
223
|
| **quark** | `ls` `mkdir` `mv` `rename` `rm` `save` `share-tree` |
|
|
224
|
+
| **uiverse** | `code` `preview` |
|
|
225
|
+
| **baidu-scholar** | `search` |
|
|
226
|
+
| **google-scholar** | `search` |
|
|
227
|
+
| **gov-law** | `search` `recent` |
|
|
228
|
+
| **gov-policy** | `search` `recent` |
|
|
229
|
+
| **nowcoder** | `hot` `trending` `topics` `recommend` `creators` `companies` `jobs` `search` `suggest` `experience` `referral` `salary` `papers` `practice` `notifications` `detail` |
|
|
230
|
+
| **wanfang** | `search` |
|
|
231
|
+
| **xiaoyuzhou** | `podcast*` `podcast-episodes*` `episode*` `download*` `transcript*` |
|
|
217
232
|
|
|
218
|
-
|
|
233
|
+
90+ adapters in total — **[→ see all supported sites & commands](./docs/adapters/index.md)**
|
|
234
|
+
|
|
235
|
+
`*` `opencli xiaoyuzhou podcast`, `podcast-episodes`, `episode`, `download`, and `transcript` require local Xiaoyuzhou credentials in `~/.opencli/xiaoyuzhou.json`.
|
|
219
236
|
|
|
220
237
|
## CLI Hub
|
|
221
238
|
|
|
@@ -266,18 +283,24 @@ OpenCLI supports downloading images, videos, and articles from supported platfor
|
|
|
266
283
|
| **douban** | Images | Poster / still image lists |
|
|
267
284
|
| **pixiv** | Images | Original-quality illustrations, multi-page |
|
|
268
285
|
| **1688** | Images, Videos | Downloads page-visible product media from item pages |
|
|
286
|
+
| **xiaoyuzhou** | Audio, Transcript | Downloads episode audio and transcript JSON/text with local credentials |
|
|
269
287
|
| **zhihu** | Articles (Markdown) | Exports with optional image download |
|
|
270
288
|
| **weixin** | Articles (Markdown) | WeChat Official Account articles |
|
|
271
289
|
|
|
272
290
|
For video downloads, install `yt-dlp` first: `brew install yt-dlp`
|
|
273
291
|
|
|
274
292
|
```bash
|
|
275
|
-
opencli xiaohongshu download
|
|
293
|
+
opencli xiaohongshu download "https://www.xiaohongshu.com/search_result/<id>?xsec_token=..." --output ./xhs
|
|
294
|
+
opencli xiaohongshu download "https://xhslink.com/..." --output ./xhs
|
|
276
295
|
opencli bilibili download BV1xxx --output ./bilibili
|
|
277
296
|
opencli twitter download elonmusk --limit 20 --output ./twitter
|
|
278
297
|
opencli 1688 download 841141931191 --output ./1688-downloads
|
|
298
|
+
opencli xiaoyuzhou download 69b3b675772ac2295bfc01d0 --output ./xiaoyuzhou
|
|
299
|
+
opencli xiaoyuzhou transcript 69dd0c98e2c8be31551f6a33 --output ./xiaoyuzhou-transcripts
|
|
279
300
|
```
|
|
280
301
|
|
|
302
|
+
`opencli xiaoyuzhou download` and `transcript` require local Xiaoyuzhou credentials in `~/.opencli/xiaoyuzhou.json`.
|
|
303
|
+
|
|
281
304
|
## Output Formats
|
|
282
305
|
|
|
283
306
|
All built-in commands support `--format` / `-f` with `table` (default), `json`, `yaml`, `md`, and `csv`.
|
|
@@ -332,16 +355,15 @@ See [Plugins Guide](./docs/guide/plugins.md) for creating your own plugin.
|
|
|
332
355
|
|
|
333
356
|
## For AI Agents (Developer Guide)
|
|
334
357
|
|
|
335
|
-
|
|
358
|
+
Before writing any adapter code, read the [`opencli-adapter-author` skill](./skills/opencli-adapter-author/SKILL.md). It takes you end-to-end:
|
|
336
359
|
|
|
337
|
-
|
|
360
|
+
- Recon the site and pick a pattern (SPA / SSR / JSONP / Token / Streaming).
|
|
361
|
+
- Discover the right endpoint via `opencli browser network`, `eval`, or the interceptor fallback.
|
|
362
|
+
- Decide auth strategy (`PUBLIC` / `COOKIE` / `HEADER` / `INTERCEPT`).
|
|
363
|
+
- Decode response fields, design columns, scaffold with `opencli browser init`.
|
|
364
|
+
- Verify with `opencli browser verify <site>/<name>` before shipping.
|
|
338
365
|
|
|
339
|
-
|
|
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
|
-
```
|
|
366
|
+
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
367
|
|
|
346
368
|
## Testing
|
|
347
369
|
|
package/README.zh-CN.md
CHANGED
|
@@ -10,20 +10,22 @@
|
|
|
10
10
|
|
|
11
11
|
OpenCLI 可以用同一套 CLI 做三类事情:
|
|
12
12
|
|
|
13
|
-
- **直接使用现成适配器**:B站、知乎、小红书、Twitter/X、Reddit、HackerNews 等 [
|
|
14
|
-
-
|
|
15
|
-
-
|
|
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
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
21
|
+
- **桌面应用控制** — 通过 CDP 直接在终端驱动 Electron 应用(Cursor、Codex、ChatGPT、Notion 等)。
|
|
22
|
+
- **AI Agent 浏览器自动化** — 安装 `opencli-adapter-author` skill,你的 AI Agent 就能操作任意网站:导航、点击、输入、提取、截图——全部通过你的已登录 Chrome 会话完成。
|
|
23
|
+
- **网站 → CLI** — 把任何网站变成确定性 CLI:90+ 内置适配器,或用 `opencli-adapter-author` skill + `opencli browser verify` 自己写。
|
|
24
|
+
- **账号安全** — 复用 Chrome/Chromium 登录态,凭证永远不会离开浏览器。
|
|
25
|
+
- **面向 AI Agent** — 一个 skill 带你走完站点侦察、API 发现、字段解码、适配器编写、验证的全流程。
|
|
26
|
+
- **CLI 枢纽** — 统一发现、自动安装、纯透传任何外部 CLI(gh、docker、obsidian 等)。
|
|
27
|
+
- **零 LLM 成本** — 运行时不消耗模型 token,跑 10,000 次也不花一分钱。
|
|
28
|
+
- **确定性输出** — 相同命令,相同输出结构,每次一致。可管道、可脚本、CI 友好。
|
|
27
29
|
|
|
28
30
|
## 快速开始
|
|
29
31
|
|
|
@@ -37,7 +39,7 @@ npm install -g @jackwener/opencli
|
|
|
37
39
|
|
|
38
40
|
OpenCLI 通过轻量 Browser Bridge 扩展和本地微型 daemon 与 Chrome/Chromium 通信。daemon 会按需自动启动。
|
|
39
41
|
|
|
40
|
-
1. 到 GitHub [Releases 页面](https://github.com/jackwener/opencli/releases) 下载最新的 `opencli-extension.zip`。
|
|
42
|
+
1. 到 GitHub [Releases 页面](https://github.com/jackwener/opencli/releases) 下载最新的 `opencli-extension-v{version}.zip`。
|
|
41
43
|
2. 解压后打开 `chrome://extensions`,启用 **开发者模式**。
|
|
42
44
|
3. 点击 **加载已解压的扩展程序**,选择解压后的目录。
|
|
43
45
|
|
|
@@ -66,12 +68,9 @@ opencli bilibili hot --limit 5
|
|
|
66
68
|
|
|
67
69
|
## 给 AI Agent
|
|
68
70
|
|
|
69
|
-
|
|
71
|
+
OpenCLI 的 browser 命令是给 AI Agent 用的——不是手动执行的。把 skill 安装到你的 AI Agent(Claude Code、Cursor 等)中,Agent 就能用你的已登录 Chrome 会话替你操作网站。
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
- [`skills/opencli-browser/SKILL.md`](./skills/opencli-browser/SKILL.md):底层控制入口,适合实时操作页面、debug 和人工介入。
|
|
73
|
-
|
|
74
|
-
安装全部 OpenCLI skills:
|
|
73
|
+
### 安装 skill
|
|
75
74
|
|
|
76
75
|
```bash
|
|
77
76
|
npx skills add jackwener/opencli
|
|
@@ -80,40 +79,62 @@ npx skills add jackwener/opencli
|
|
|
80
79
|
或只装需要的 skill:
|
|
81
80
|
|
|
82
81
|
```bash
|
|
83
|
-
npx skills add jackwener/opencli --skill opencli-
|
|
84
|
-
npx skills add jackwener/opencli --skill opencli-
|
|
85
|
-
npx skills add jackwener/opencli --skill
|
|
86
|
-
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
|
|
87
85
|
```
|
|
88
86
|
|
|
89
|
-
|
|
87
|
+
### 选择哪个 skill
|
|
90
88
|
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
| Skill | 适用场景 | 你对 AI Agent 说的话 |
|
|
90
|
+
|-------|---------|-------------------|
|
|
91
|
+
| **opencli-adapter-author** | 实时操作任意网站,或为新站点写可复用适配器 | "帮我看看小红书的通知" / "帮我做一个抖音热门的适配器" / "帮我做一个抓取这个页面热帖的命令" |
|
|
92
|
+
| **opencli-autofix** | 内置命令失败时修复已有适配器 | "`opencli zhihu hot` 返回空了,修一下" |
|
|
93
|
+
| **smart-search** | 在现有 OpenCLI 能力里搜索 | "帮我找个 B 站热门相关的适配器" |
|
|
93
94
|
|
|
94
|
-
|
|
95
|
+
### 工作原理
|
|
95
96
|
|
|
96
|
-
|
|
97
|
+
安装 `opencli-adapter-author` skill 后,你的 AI Agent 可以:
|
|
97
98
|
|
|
98
|
-
|
|
99
|
+
1. **导航**到任意 URL,使用你的已登录浏览器
|
|
100
|
+
2. **读取**页面内容——通过结构化 DOM 快照(不是截图)
|
|
101
|
+
3. **交互**——点击按钮、填写表单、选择选项、按键
|
|
102
|
+
4. **提取**页面数据或拦截网络 API 响应
|
|
103
|
+
5. **等待**元素、文本或页面跳转
|
|
99
104
|
|
|
100
|
-
|
|
105
|
+
Agent 在内部自动处理所有 `opencli browser` 命令——你只需用自然语言描述想做的事。
|
|
101
106
|
|
|
102
|
-
|
|
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) — 能力搜索
|
|
111
|
+
|
|
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`。
|
|
113
|
+
|
|
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 ...` 命令的默认目标。
|
|
103
115
|
|
|
104
|
-
|
|
116
|
+
## 核心概念
|
|
117
|
+
|
|
118
|
+
### `browser`:AI Agent 的浏览器控制层
|
|
119
|
+
|
|
120
|
+
`opencli browser` 命令是 AI Agent 操作网站的底层原语。你不需要手动运行这些命令——把 `opencli-adapter-author` skill 安装到你的 AI Agent 中,用自然语言描述你想做的事,Agent 会自动处理浏览器操作。
|
|
105
121
|
|
|
106
|
-
|
|
122
|
+
比如你告诉 Agent:*"帮我看看小红书的通知"*——Agent 会在底层调用 `opencli browser open`、`state`、`click` 等命令。
|
|
123
|
+
|
|
124
|
+
### 内置适配器:稳定命令
|
|
107
125
|
|
|
108
|
-
|
|
126
|
+
当某个站点能力已经存在时,优先使用 `opencli hackernews top`、`opencli reddit hot` 这类稳定命令。这些命令是确定性的,无需浏览器——人类和 AI Agent 都可以直接使用。
|
|
109
127
|
|
|
110
|
-
|
|
111
|
-
- `synthesize` 负责把探索结果转成 evaluate-based YAML 适配器
|
|
112
|
-
- `generate` 负责跑通 verified generation 主链路,最后要么给出可直接使用的命令,要么返回结构化的阻塞原因 / 人工介入结果
|
|
128
|
+
### 为新站点写适配器
|
|
113
129
|
|
|
114
|
-
|
|
130
|
+
当你需要的网站还没覆盖时,用 `opencli-adapter-author` skill,它会把 Agent 带到闭环:
|
|
115
131
|
|
|
116
|
-
|
|
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>/`,下次写同站点的其他命令直接吃缓存
|
|
117
138
|
|
|
118
139
|
### CLI 枢纽与桌面端适配器
|
|
119
140
|
|
|
@@ -137,13 +158,10 @@ OpenCLI 不只是网站 CLI,还可以:
|
|
|
137
158
|
| `OPENCLI_WINDOW_FOCUSED` | `false` | 设为 `1` 时 automation 窗口在前台打开(适合调试) |
|
|
138
159
|
| `OPENCLI_BROWSER_CONNECT_TIMEOUT` | `30` | 浏览器连接超时(秒) |
|
|
139
160
|
| `OPENCLI_BROWSER_COMMAND_TIMEOUT` | `60` | 单个浏览器命令超时(秒) |
|
|
140
|
-
| `OPENCLI_BROWSER_EXPLORE_TIMEOUT` | `120` | explore/record 操作超时(秒) |
|
|
141
161
|
| `OPENCLI_CDP_ENDPOINT` | — | Chrome DevTools Protocol 端点,用于远程浏览器或 Electron 应用 |
|
|
142
162
|
| `OPENCLI_CDP_TARGET` | — | 按 URL 子串过滤 CDP target(如 `detail.1688.com`) |
|
|
143
163
|
| `OPENCLI_VERBOSE` | `false` | 启用详细日志(`-v` 也可以) |
|
|
144
164
|
| `OPENCLI_DIAGNOSTIC` | `false` | 设为 `1` 时在失败时输出结构化诊断上下文 |
|
|
145
|
-
| `OUTPUT` | — | 覆盖输出格式:`json`、`yaml` 或 `table` |
|
|
146
|
-
| `DEBUG` | — | 设为 `opencli` 开启内部调试日志 |
|
|
147
165
|
| `DEBUG_SNAPSHOT` | — | 设为 `1` 输出 DOM 快照调试信息 |
|
|
148
166
|
|
|
149
167
|
## 更新
|
|
@@ -158,10 +176,9 @@ npx skills add jackwener/opencli
|
|
|
158
176
|
如果你只装了部分 skill,也可以只刷新自己在用的:
|
|
159
177
|
|
|
160
178
|
```bash
|
|
161
|
-
npx skills add jackwener/opencli --skill opencli-
|
|
162
|
-
npx skills add jackwener/opencli --skill opencli-
|
|
163
|
-
npx skills add jackwener/opencli --skill
|
|
164
|
-
npx skills add jackwener/opencli --skill opencli-oneshot
|
|
179
|
+
npx skills add jackwener/opencli --skill opencli-adapter-author
|
|
180
|
+
npx skills add jackwener/opencli --skill opencli-autofix
|
|
181
|
+
npx skills add jackwener/opencli --skill smart-search
|
|
165
182
|
```
|
|
166
183
|
|
|
167
184
|
## 面向开发者
|
|
@@ -187,7 +204,7 @@ npm link
|
|
|
187
204
|
|
|
188
205
|
| 站点 | 命令 | 模式 |
|
|
189
206
|
|------|------|------|
|
|
190
|
-
| **twitter** | `trending` `search` `timeline` `lists` `bookmarks` `profile` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `article` `follow` `unfollow` `bookmark` `unbookmark` `download` `accept` `reply-dm` `block` `unblock` `hide-reply` | 浏览器 |
|
|
207
|
+
| **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
208
|
| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` | 浏览器 |
|
|
192
209
|
| **tieba** | `hot` `posts` `search` `read` | 浏览器 |
|
|
193
210
|
| **hupu** | `hot` `search` `detail` `mentions` `reply` `like` `unlike` | 浏览器 |
|
|
@@ -201,16 +218,23 @@ npm link
|
|
|
201
218
|
| **discord-app** | `status` `send` `read` `channels` `servers` `search` `members` | 桌面端 |
|
|
202
219
|
| **v2ex** | `hot` `latest` `topic` `node` `user` `member` `replies` `nodes` `daily` `me` `notifications` | 公开 / 浏览器 |
|
|
203
220
|
| **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` | 桌面端 |
|
|
221
|
+
| **antigravity** | `status` `send` `read` `new` `dump` `extract-code` `model` `watch` `serve` | 桌面端 |
|
|
205
222
|
| **chatgpt-app** | `status` `new` `send` `read` `ask` `model` | 桌面端 |
|
|
206
223
|
| **xiaohongshu** | `search` `notifications` `feed` `user` `download` `publish` `creator-notes` `creator-note-detail` `creator-notes-summary` `creator-profile` `creator-stats` | 浏览器 |
|
|
207
224
|
| **xiaoe** | `courses` `detail` `catalog` `play-url` `content` | 浏览器 |
|
|
208
225
|
| **quark** | `ls` `mkdir` `mv` `rename` `rm` `save` `share-tree` | 浏览器 |
|
|
226
|
+
| **uiverse** | `code` `preview` | 浏览器 |
|
|
209
227
|
| **apple-podcasts** | `search` `episodes` `top` | 公开 |
|
|
210
|
-
| **
|
|
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*` | 本地凭证 |
|
|
211
235
|
| **zhihu** | `hot` `search` `question` `download` `follow` `like` `favorite` `comment` `answer` | 浏览器 |
|
|
212
236
|
| **weixin** | `download` | 浏览器 |
|
|
213
|
-
| **youtube** | `search` `video` `transcript` | 浏览器 |
|
|
237
|
+
| **youtube** | `search` `video` `transcript` `comments` `channel` `playlist` `feed` `history` `watch-later` `subscriptions` `like` `unlike` `subscribe` `unsubscribe` | 浏览器 |
|
|
214
238
|
| **boss** | `search` `detail` `recommend` `joblist` `greet` `batchgreet` `send` `chatlist` `chatmsg` `invite` `mark` `exchange` `resume` `stats` | 浏览器 |
|
|
215
239
|
| **coupang** | `search` `add-to-cart` | 浏览器 |
|
|
216
240
|
| **bbc** | `news` | 公共 API |
|
|
@@ -232,7 +256,7 @@ npm link
|
|
|
232
256
|
| **sinafinance** | `news` | 🌐 公开 |
|
|
233
257
|
| **barchart** | `quote` `options` `greeks` `flow` | 浏览器 |
|
|
234
258
|
| **chaoxing** | `assignments` `exams` | 浏览器 |
|
|
235
|
-
| **grok** | `ask` | 浏览器 |
|
|
259
|
+
| **grok** | `ask` `image` | 浏览器 |
|
|
236
260
|
| **hf** | `top` | 公开 |
|
|
237
261
|
| **jike** | `feed` `search` `create` `like` `comment` `repost` `notifications` `post` `topic` `user` | 浏览器 |
|
|
238
262
|
| **jimeng** | `generate` `history` | 浏览器 |
|
|
@@ -265,7 +289,9 @@ npm link
|
|
|
265
289
|
| **douyin** | `videos` `publish` `drafts` `draft` `delete` `stats` `profile` `update` `hashtag` `location` `activities` `collections` | 浏览器 |
|
|
266
290
|
| **yuanbao** | `new` `ask` | 浏览器 |
|
|
267
291
|
|
|
268
|
-
|
|
292
|
+
90+ 适配器 — **[→ 查看完整命令列表](./docs/adapters/index.md)**
|
|
293
|
+
|
|
294
|
+
`*` `opencli xiaoyuzhou podcast`、`podcast-episodes`、`episode`、`download`、`transcript` 需要本地小宇宙凭证:`~/.opencli/xiaoyuzhou.json`。
|
|
269
295
|
|
|
270
296
|
### 外部 CLI 枢纽
|
|
271
297
|
|
|
@@ -319,6 +345,7 @@ OpenCLI 支持从各平台下载图片、视频和文章。
|
|
|
319
345
|
| **Twitter/X** | 图片、视频 | 从用户媒体页或单条推文下载 |
|
|
320
346
|
| **Pixiv** | 图片 | 下载原始画质插画,支持多页作品 |
|
|
321
347
|
| **1688** | 图片、视频 | 下载商品页中可见的商品素材 |
|
|
348
|
+
| **小宇宙** | 音频、转录 | 使用本地凭证下载单集音频和转录 JSON / 文本 |
|
|
322
349
|
| **知乎** | 文章(Markdown) | 导出文章,可选下载图片到本地 |
|
|
323
350
|
| **微信公众号** | 文章(Markdown) | 导出微信公众号文章为 Markdown |
|
|
324
351
|
| **豆瓣** | 图片 | 下载电影条目的海报 / 剧照图片 |
|
|
@@ -338,7 +365,8 @@ brew install yt-dlp
|
|
|
338
365
|
|
|
339
366
|
```bash
|
|
340
367
|
# 下载小红书笔记中的图片/视频
|
|
341
|
-
opencli xiaohongshu download
|
|
368
|
+
opencli xiaohongshu download "https://www.xiaohongshu.com/search_result/<id>?xsec_token=..." --output ./xhs
|
|
369
|
+
opencli xiaohongshu download "https://xhslink.com/..." --output ./xhs
|
|
342
370
|
|
|
343
371
|
# 下载B站视频(需要 yt-dlp)
|
|
344
372
|
opencli bilibili download BV1xxx --output ./bilibili
|
|
@@ -356,6 +384,12 @@ opencli douban download 30382501 --output ./douban
|
|
|
356
384
|
# 下载 1688 商品页中的图片 / 视频素材
|
|
357
385
|
opencli 1688 download 841141931191 --output ./1688-downloads
|
|
358
386
|
|
|
387
|
+
# 下载小宇宙单集音频
|
|
388
|
+
opencli xiaoyuzhou download 69b3b675772ac2295bfc01d0 --output ./xiaoyuzhou
|
|
389
|
+
|
|
390
|
+
# 下载小宇宙单集转录
|
|
391
|
+
opencli xiaoyuzhou transcript 69dd0c98e2c8be31551f6a33 --output ./xiaoyuzhou-transcripts
|
|
392
|
+
|
|
359
393
|
# 导出知乎文章为 Markdown
|
|
360
394
|
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu
|
|
361
395
|
|
|
@@ -366,6 +400,8 @@ opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --download-images
|
|
|
366
400
|
opencli weixin download --url "https://mp.weixin.qq.com/s/xxx" --output ./weixin
|
|
367
401
|
```
|
|
368
402
|
|
|
403
|
+
`opencli xiaoyuzhou download` 和 `transcript` 需要本地小宇宙凭证:`~/.opencli/xiaoyuzhou.json`。
|
|
404
|
+
|
|
369
405
|
|
|
370
406
|
|
|
371
407
|
## 输出格式
|
|
@@ -435,25 +471,15 @@ opencli plugin uninstall my-tool # 卸载
|
|
|
435
471
|
|
|
436
472
|
如果你是一个被要求查阅代码并编写新 `opencli` 适配器的 AI,请遵守以下工作流。
|
|
437
473
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
> **完整模式**:在编写任何新代码前,先阅读 [opencli-explorer skill](./skills/opencli-explorer/SKILL.md)。它包含完整的适配器探索开发指南、API 探测流程、5级认证策略以及常见陷阱。
|
|
474
|
+
在动代码前,先读 [`opencli-adapter-author` skill](./skills/opencli-adapter-author/SKILL.md)。它把整个流程串起来:
|
|
441
475
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
opencli synthesize mysite
|
|
448
|
-
|
|
449
|
-
# 3. Generate — 一键完成:探索 → 合成 → 注册
|
|
450
|
-
opencli generate https://example.com --goal "hot"
|
|
451
|
-
|
|
452
|
-
# 4. Strategy Cascade — 自动降级探测:PUBLIC → COOKIE → HEADER
|
|
453
|
-
opencli cascade https://api.example.com/data
|
|
454
|
-
```
|
|
476
|
+
- 侦察站点,选定 pattern(SPA / SSR / JSONP / Token / Streaming)
|
|
477
|
+
- 用 `opencli browser network`、`eval`、interceptor 等找到目标 endpoint
|
|
478
|
+
- 定认证策略(`PUBLIC` / `COOKIE` / `HEADER` / `INTERCEPT`)
|
|
479
|
+
- 字段解码、设计 columns、`opencli browser init` 生成骨架
|
|
480
|
+
- 交付前用 `opencli browser verify <site>/<name>` 验证
|
|
455
481
|
|
|
456
|
-
|
|
482
|
+
在仓库外写的私有适配器放到 `~/.opencli/clis/<site>/<name>.js`;每个站点的 endpoint、字段映射、抓包样本会累积在 `~/.opencli/sites/<site>/`,下次写同站点的其他命令可以直接复用。
|
|
457
483
|
|
|
458
484
|
## 常见问题排查
|
|
459
485
|
|