Skip to content

Commit 90722be

Browse files
authored
refactor(skills): merge opencli-generate into opencli-explorer (#891)
* refactor(skills): merge opencli-generate into opencli-explorer opencli-generate was a thin wrapper over generateVerifiedFromUrl, essentially an internal pipeline orchestration. Merge its entry point into opencli-explorer as the automated fast path, keeping one unified skill for adapter creation. - Delete skills/opencli-generate/SKILL.md - Add automated generation tip to opencli-explorer SKILL.md - Update README/README.zh-CN skill references - Update skill-generate.ts comment * fix(docs): fix dead link in yaml-adapter deprecation page Change ../../CONTRIBUTING.md to ./contributing (VitePress internal link).
1 parent 810547c commit 90722be

6 files changed

Lines changed: 14 additions & 191 deletions

File tree

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Use OpenCLI directly when you want a reliable command instead of a live browser
8181

8282
Use two different entry points depending on the task:
8383

84-
- [`skills/opencli-generate/SKILL.md`](./skills/opencli-generate/SKILL.md): the task-level entry point for requests like "generate a CLI for this site".
84+
- [`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.
8585
- [`skills/opencli-browser/SKILL.md`](./skills/opencli-browser/SKILL.md): the low-level control surface for live browsing, debugging, and manual intervention.
8686

8787
Install the packaged skills with:
@@ -94,15 +94,14 @@ Or install only what you need:
9494

9595
```bash
9696
npx skills add jackwener/opencli --skill opencli-usage
97-
npx skills add jackwener/opencli --skill opencli-generate
9897
npx skills add jackwener/opencli --skill opencli-browser
9998
npx skills add jackwener/opencli --skill opencli-explorer
10099
npx skills add jackwener/opencli --skill opencli-oneshot
101100
```
102101

103102
In practice:
104103

105-
- start with `opencli-generate` when the agent needs a reusable command for a site
104+
- start with `opencli-explorer` when the agent needs a reusable command for a site (it covers both automated and manual flows)
106105
- use `opencli-browser` when the agent needs to inspect or steer the page directly
107106

108107
Available browser commands include `open`, `state`, `click`, `type`, `select`, `keys`, `wait`, `get`, `screenshot`, `scroll`, `back`, `eval`, `network`, `init`, `verify`, and `close`.

README.zh-CN.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ opencli bilibili hot --limit 5
6969

7070
按任务类型,AI Agent 有两个不同入口:
7171

72-
- [`skills/opencli-generate/SKILL.md`](./skills/opencli-generate/SKILL.md)任务级入口,适合“帮我给这个网站生成 CLI”这类请求
72+
- [`skills/opencli-explorer/SKILL.md`](./skills/opencli-explorer/SKILL.md)适配器创建入口,支持全自动生成(`opencli generate <url>`)和手动探索两种流程
7373
- [`skills/opencli-browser/SKILL.md`](./skills/opencli-browser/SKILL.md):底层控制入口,适合实时操作页面、debug 和人工介入。
7474

7575
安装全部 OpenCLI skills:
@@ -82,15 +82,14 @@ npx skills add jackwener/opencli
8282

8383
```bash
8484
npx skills add jackwener/opencli --skill opencli-usage
85-
npx skills add jackwener/opencli --skill opencli-generate
8685
npx skills add jackwener/opencli --skill opencli-browser
8786
npx skills add jackwener/opencli --skill opencli-explorer
8887
npx skills add jackwener/opencli --skill opencli-oneshot
8988
```
9089

9190
实际使用上:
9291

93-
- 需要把某个站点收成可复用命令时,优先走 `opencli-generate`
92+
- 需要把某个站点收成可复用命令时,优先走 `opencli-explorer`(涵盖自动和手动两种路径)
9493
- 需要直接检查页面、操作页面时,再走 `opencli-browser`
9594

9695
`browser` 可用命令包括:`open``state``click``type``select``keys``wait``get``screenshot``scroll``back``eval``network``init``verify``close`

docs/developer/yaml-adapter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
> **YAML adapters are no longer supported.** All adapters now use TypeScript with the `cli()` API from `@jackwener/opencli/registry`.
44
5-
See [Contributing Guide](../../CONTRIBUTING.md) for how to write TypeScript adapters using the pipeline API or `func()`.
5+
See [Contributing Guide](./contributing) for how to write TypeScript adapters using the pipeline API or `func()`.

skills/opencli-explorer/SKILL.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: opencli-explorer
3-
description: Use when creating a new OpenCLI adapter from scratch, adding support for a new website or platform, or exploring a site's API endpoints via browser DevTools. Covers API discovery workflow, authentication strategy selection, TS adapter writing, and testing.
4-
tags: [opencli, adapter, browser, api-discovery, cli, web-scraping, automation]
3+
description: Use when creating a new OpenCLI adapter from scratch, adding support for a new website or platform, exploring a site's API endpoints via browser DevTools, or when a user asks to automatically generate a CLI for a website (e.g. "帮我生成 xxx.com 的 cli"). Covers automated generation, API discovery workflow, authentication strategy selection, TS adapter writing, and testing.
4+
tags: [opencli, adapter, browser, api-discovery, cli, web-scraping, automation, generate]
55
---
66

77
# CLI-EXPLORER — 适配器探索式开发完全指南
@@ -13,6 +13,10 @@ tags: [opencli, adapter, browser, api-discovery, cli, web-scraping, automation]
1313
> **只想为一个具体页面快速生成一个命令?**[opencli-oneshot skill](../opencli-oneshot/SKILL.md)~150 行,4 步搞定)。
1414
> 本文档适合从零探索一个新站点的完整流程。
1515
16+
> [!TIP]
17+
> **想要全自动生成?** 直接运行 `opencli generate <url> [--goal <goal>]`,内部会自动走完 explore → synthesize → cascade → verify 全流程。
18+
> 返回 `SkillOutput`(success / blocked / needs-human-check)。如果自动生成失败或需要人工介入,再按本文档的手动流程继续。
19+
1620
---
1721

1822
## AI Agent 开发者必读:用浏览器探索

skills/opencli-generate/SKILL.md

Lines changed: 0 additions & 179 deletions
This file was deleted.

src/skill-generate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* opencli-generate skill: thin wrapper over generateVerifiedFromUrl.
2+
* Generate skill: thin wrapper over generateVerifiedFromUrl.
33
*
4-
* Maps GenerateOutcome → SkillOutput per the skill spec
5-
* (skills/opencli-generate/SKILL.md).
4+
* Maps GenerateOutcome → SkillOutput.
5+
* Used by `opencli generate <url>` (automated path in opencli-explorer workflow).
66
*
77
* Design:
88
* - Input: url + goal? (user intent, not execution strategy)

0 commit comments

Comments
 (0)