You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: consolidate 6 skills into 3, remove mechanical commands (#1094)
* refactor: consolidate 6 skills into 3, remove mechanical commands
Replaces opencli-oneshot / opencli-explorer / opencli-browser /
opencli-usage with a single opencli-adapter-author skill that takes
the AI agent end-to-end: site recon, API discovery, field decoding,
adapter coding, and `opencli browser verify`.
Removes the mechanical commands (`explore`, `synthesize`, `generate`,
`cascade`, `record`) and their src/tests — they were codegen scaffolding
meant for agents, which the new skill handles more flexibly via
`opencli browser` primitives.
Skill highlights:
- Top-level decision tree + 12-step runbook
- 5 site patterns (SPA / SSR / JSONP / Token / Streaming)
- 5-layer API discovery (network → initial state → bundle → token → interceptor)
- Field decode playbook (self-explanatory → codes → sort-key comparison)
- Output design guide (columns, types, order, ≤15 per adapter)
- Two-layer site memory: in-repo seeds for eastmoney/xueqiu/bilibili/tonghuashun
plus local `~/.opencli/sites/<site>/` runtime workspace
Kept skills: opencli-autofix (now points to adapter-author for rewrites),
smart-search. Kept primitives: `browser *`, `doctor`, `list`, `validate`,
`verify`, `<site> <cmd>`, `plugin *`, `completion`.
No backward compatibility shims. Full test suite (1605 tests) passes.
* review fixes: honest coverage, hard memory-hit path, typo, stale docs
- site-memory hit path no longer jumps to writing adapter; forces Step 5
endpoint re-verification + Step 7 field check, and 30-day expiry
- site-memory.md now specifies exact schemas for endpoints.json /
field-map.json / notes.md / fixtures + write-back timing rules
- coverage-matrix.md marks unverified patterns as 🟡 with an evidence
section citing coingecko dry run + PR #1091 eastmoney + bilibili
- eastmoney seed typo: resolveSecids -> resolveSecid (and splitSymbols)
- docs/developer/ai-workflow.md rewritten to teach the adapter-author
skill + opencli browser * primitives (dropped generate/synthesize/
cascade/explore references)
- ts-adapter.md, getting-started.md, CHANGELOG.md:87 updated to point
at opencli-adapter-author
* fix(ci): resync package-lock + drop stale built-in list reference
- Regenerate package-lock.json to restore @emnapi/core + @emnapi/runtime
entries that got dropped during the rebase — `npm ci` was failing on all
CI jobs (build / audit / docs-build / bun-test / unit-test)
- docs/guide/getting-started.md: built-in list dropped `explore`, now
reads (list, validate, verify, browser, doctor, plugin...)
* fix(ci): restore package-lock.json from main (unrelated lockfile churn)
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,7 +84,7 @@ Adapter code, validation, and error handling have been modernized.
84
84
1.**Update Node.js** to v21 or later (v22 LTS recommended).
85
85
2.**Run `npm install -g @jackwener/opencli@latest`** — the preuninstall hook gracefully stops the old daemon; the first browser command after upgrade auto-restarts it.
86
86
3.**If you have custom `.ts` adapters** in `~/.opencli/clis/`, rename or compile them to `.js`. A warning will be printed on startup if stale `.ts` files are detected.
87
-
4.**If you have custom `.yaml` adapters**, convert them to JS using the `cli()` API (see `skills/opencli-explorer/references/adapter-templates.md`).
87
+
4.**If you have custom `.yaml` adapters**, convert them to JS using the `cli()` API (see `skills/opencli-adapter-author/references/adapter-template.md`).
88
88
5.**If you parse error output from stdout**, switch to stderr. Errors are now structured YAML envelopes with typed exit codes.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,7 @@ cli({
102
102
});
103
103
```
104
104
105
-
Use `opencli explore <url>` to discover APIs and see [opencli-explorer skill](./skills/opencli-explorer/SKILL.md) if you need the full adapter workflow.
105
+
Install the [`opencli-adapter-author` skill](./skills/opencli-adapter-author/SKILL.md) if you need the full adapter workflow — recon → API discovery → field decoding → `opencli browser verify`.
Copy file name to clipboardExpand all lines: README.md
+34-39Lines changed: 34 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -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
-
-**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, extract, and inspect any page using your logged-in browser.
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 for AI Agents** — Install the `opencli-browser` 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 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. The `opencli-browser` skill gives any AI agent full browser control.
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.
|**opencli-browser**| Operate any website in real time | "Help me post this content on Xiaohongshu" / "Check my Twitter notifications and summarize them" |
95
-
|**opencli-explorer**| Create a reusable CLI for a site | "Generate an adapter for douyin trending" |
96
-
|**opencli-oneshot**| Quick one-off: URL + goal → adapter | "Make a command that grabs the top posts from this page" |
97
-
|**opencli-usage**| Use existing built-in adapters | "Get the top 5 Bilibili trending videos" |
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" |
98
96
99
97
### How it works
100
98
101
-
Once the `opencli-browser` skill is installed, your AI agent can:
99
+
Once `opencli-adapter-author` is installed, your AI agent can:
102
100
103
101
1.**Navigate** to any URL using your logged-in browser
104
102
2.**Read** page content via structured DOM snapshots (not screenshots)
@@ -109,8 +107,9 @@ Once the `opencli-browser` skill is installed, your AI agent can:
109
107
The agent handles all the `opencli browser` commands internally — you just describe what you want done in natural language.
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`.
116
115
@@ -120,25 +119,24 @@ Available browser commands include `open`, `state`, `click`, `type`, `select`, `
120
119
121
120
### `browser`: AI Agent browser control
122
121
123
-
`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-browser` skill into your AI agent, describe what you want in natural language, and the agent handles the browser operations.
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.
124
123
125
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.
126
125
127
126
### Built-in adapters: stable commands
128
127
129
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.
130
129
131
-
### `explore` / `synthesize` / `generate`: create new CLIs
130
+
### Writing a new adapter
132
131
133
-
Use these commands when the site you need is not covered yet:
132
+
When the site you need is not yet covered, use the `opencli-adapter-author` skill. It takes the agent end-to-end:
134
133
135
-
-`explore` inspects the page, network activity, and capability surface.
136
-
-`synthesize` turns exploration artifacts into evaluate-based JS adapters.
137
-
-`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.
138
-
139
-
### `cascade`: auth strategy discovery
140
-
141
-
Use `cascade` to probe fallback auth paths such as public endpoints, cookies, and custom headers before you commit to an adapter design.
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.
@@ -359,16 +355,15 @@ See [Plugins Guide](./docs/guide/plugins.md) for creating your own plugin.
359
355
360
356
## For AI Agents (Developer Guide)
361
357
362
-
> **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.
358
+
Before writing any adapter code, read the [`opencli-adapter-author` skill](./skills/opencli-adapter-author/SKILL.md). It takes you end-to-end:
363
359
364
-
> **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.
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.
opencli cascade https://api.example.com/data # Auto-probe: PUBLIC → COOKIE → HEADER
371
-
```
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.
0 commit comments