@jackwener/opencli 0.6.0 → 0.6.1
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 +22 -7
- package/README.zh-CN.md +23 -8
- package/SKILL.md +6 -2
- package/dist/setup.js +1 -1
- package/package.json +1 -1
- package/src/setup.ts +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](https://nodejs.org)
|
|
10
10
|
[](./LICENSE)
|
|
11
11
|
|
|
12
|
-
A CLI tool that turns **any website** into a command-line interface
|
|
12
|
+
A CLI tool that turns **any website** into a command-line interface — bilibili, zhihu, xiaohongshu, twitter, reddit, and many more — powered by browser session reuse and AI-native discovery.
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
@@ -46,11 +46,21 @@ OpenCLI connects to your browser through the Playwright MCP Bridge extension.
|
|
|
46
46
|
### Playwright MCP Bridge Extension Setup
|
|
47
47
|
|
|
48
48
|
1. Install **[Playwright MCP Bridge](https://chromewebstore.google.com/detail/playwright-mcp-bridge/mmlmfjhmonkocbjadbfplnigmagldckm)** extension in Chrome.
|
|
49
|
-
2.
|
|
49
|
+
2. Run `opencli setup` — it auto-discovers your token and lets you choose which tools to configure:
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
```bash
|
|
52
|
+
opencli setup
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The interactive TUI will:
|
|
56
|
+
- 🔍 Auto-discover `PLAYWRIGHT_MCP_EXTENSION_TOKEN` from Chrome (no manual copy needed)
|
|
57
|
+
- ☑️ Show all detected tools (Codex, Cursor, Claude Code, Gemini CLI, etc.)
|
|
58
|
+
- ✏️ Update only the files you select (Space to toggle, Enter to confirm)
|
|
52
59
|
|
|
53
|
-
|
|
60
|
+
<details>
|
|
61
|
+
<summary>Manual setup (alternative)</summary>
|
|
62
|
+
|
|
63
|
+
Add token to your MCP client config (e.g. Claude/Cursor):
|
|
54
64
|
|
|
55
65
|
```json
|
|
56
66
|
{
|
|
@@ -66,13 +76,15 @@ First, add it to your MCP client config (e.g. Claude/Cursor):
|
|
|
66
76
|
}
|
|
67
77
|
```
|
|
68
78
|
|
|
69
|
-
|
|
79
|
+
Export in shell (e.g. `~/.zshrc`):
|
|
70
80
|
|
|
71
81
|
```bash
|
|
72
82
|
export PLAYWRIGHT_MCP_EXTENSION_TOKEN="<your-token-here>"
|
|
73
83
|
```
|
|
74
84
|
|
|
75
|
-
|
|
85
|
+
</details>
|
|
86
|
+
|
|
87
|
+
Verify with `opencli doctor` — shows colored status for all config locations:
|
|
76
88
|
|
|
77
89
|
```bash
|
|
78
90
|
opencli doctor
|
|
@@ -84,6 +96,7 @@ opencli doctor
|
|
|
84
96
|
|
|
85
97
|
```bash
|
|
86
98
|
npm install -g @jackwener/opencli
|
|
99
|
+
opencli setup # One-time: configure Playwright MCP token
|
|
87
100
|
```
|
|
88
101
|
|
|
89
102
|
Then use directly:
|
|
@@ -118,7 +131,7 @@ npm install -g @jackwener/opencli@latest
|
|
|
118
131
|
|
|
119
132
|
| Site | Commands | Mode |
|
|
120
133
|
|------|----------|------|
|
|
121
|
-
| **bilibili** | `hot` `search` `me` `favorite`
|
|
134
|
+
| **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `dynamic` `ranking` `following` `user-videos` | 🔐 Browser |
|
|
122
135
|
| **zhihu** | `hot` `search` `question` | 🔐 Browser |
|
|
123
136
|
| **xiaohongshu** | `search` `notifications` `feed` `me` `user` | 🔐 Browser |
|
|
124
137
|
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` | 🔐 Browser |
|
|
@@ -185,6 +198,8 @@ Explore outputs to `.opencli/explore/<site>/` (manifest.json, endpoints.json, ca
|
|
|
185
198
|
- Your login session in Chrome might have expired. Open a normal Chrome tab, navigate to the target site, and log in or refresh the page to prove you are human.
|
|
186
199
|
- **Node API errors**
|
|
187
200
|
- Make sure you are using Node.js >= 18. Some dependencies require modern Node APIs.
|
|
201
|
+
- **Token issues**
|
|
202
|
+
- Run `opencli doctor` to diagnose token configuration across all tools.
|
|
188
203
|
|
|
189
204
|
## Releasing New Versions
|
|
190
205
|
|
package/README.zh-CN.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](https://nodejs.org)
|
|
10
10
|
[](./LICENSE)
|
|
11
11
|
|
|
12
|
-
OpenCLI
|
|
12
|
+
OpenCLI 将任何网站变成命令行工具 — B站、知乎、小红书、Twitter、Reddit 等众多站点 — 复用浏览器登录态,AI 驱动探索。
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
@@ -29,7 +29,7 @@ OpenCLI 将任何网站变成命令行工具。**59 个命令**覆盖 **18 个
|
|
|
29
29
|
|
|
30
30
|
## 亮点
|
|
31
31
|
|
|
32
|
-
-
|
|
32
|
+
- **多站点覆盖** — B站、知乎、小红书、Twitter、Reddit 等众多站点
|
|
33
33
|
- **零风控** — 复用 Chrome 登录态,无需存储任何凭证
|
|
34
34
|
- **AI 原生** — `explore` 自动发现 API,`synthesize` 生成适配器,`cascade` 探测认证策略
|
|
35
35
|
- **动态加载引擎** — 声明式的 `.yaml` 或者底层定制的 `.ts` 适配器,放入 `clis/` 文件夹即可自动注册生效
|
|
@@ -46,11 +46,21 @@ OpenCLI 通过 Playwright MCP Bridge 扩展与你的浏览器通信。
|
|
|
46
46
|
### Playwright MCP Bridge 扩展配置
|
|
47
47
|
|
|
48
48
|
1. 安装 **[Playwright MCP Bridge](https://chromewebstore.google.com/detail/playwright-mcp-bridge/mmlmfjhmonkocbjadbfplnigmagldckm)** 扩展
|
|
49
|
-
2.
|
|
49
|
+
2. 运行 `opencli setup` — 自动发现 Token 并让你选择要配置哪些工具:
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
```bash
|
|
52
|
+
opencli setup
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
交互式 TUI 会:
|
|
56
|
+
- 🔍 从 Chrome 自动发现 `PLAYWRIGHT_MCP_EXTENSION_TOKEN`(无需手动复制)
|
|
57
|
+
- ☑️ 显示所有支持的工具(Codex、Cursor、Claude Code、Gemini CLI 等)
|
|
58
|
+
- ✏️ 只更新你选中的文件(空格切换,回车确认)
|
|
52
59
|
|
|
53
|
-
|
|
60
|
+
<details>
|
|
61
|
+
<summary>手动配置(备选方案)</summary>
|
|
62
|
+
|
|
63
|
+
配置你的 MCP 客户端(如 Claude/Cursor 等):
|
|
54
64
|
|
|
55
65
|
```json
|
|
56
66
|
{
|
|
@@ -66,13 +76,15 @@ OpenCLI 通过 Playwright MCP Bridge 扩展与你的浏览器通信。
|
|
|
66
76
|
}
|
|
67
77
|
```
|
|
68
78
|
|
|
69
|
-
|
|
79
|
+
在终端环境变量中导出(建议写进 `~/.zshrc`):
|
|
70
80
|
|
|
71
81
|
```bash
|
|
72
82
|
export PLAYWRIGHT_MCP_EXTENSION_TOKEN="<你的-token>"
|
|
73
83
|
```
|
|
74
84
|
|
|
75
|
-
|
|
85
|
+
</details>
|
|
86
|
+
|
|
87
|
+
配置后运行 `opencli doctor` 检查所有位置的 Token 状态:
|
|
76
88
|
|
|
77
89
|
```bash
|
|
78
90
|
opencli doctor
|
|
@@ -84,6 +96,7 @@ opencli doctor
|
|
|
84
96
|
|
|
85
97
|
```bash
|
|
86
98
|
npm install -g @jackwener/opencli
|
|
99
|
+
opencli setup # 首次使用:配置 Playwright MCP token
|
|
87
100
|
```
|
|
88
101
|
|
|
89
102
|
直接使用:
|
|
@@ -118,7 +131,7 @@ npm install -g @jackwener/opencli@latest
|
|
|
118
131
|
|
|
119
132
|
| 站点 | 命令 | 模式 |
|
|
120
133
|
|------|------|------|
|
|
121
|
-
| **bilibili** | `hot` `search` `me` `favorite`
|
|
134
|
+
| **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `dynamic` `ranking` `following` `user-videos` | 🔐 浏览器 |
|
|
122
135
|
| **zhihu** | `hot` `search` `question` | 🔐 浏览器 |
|
|
123
136
|
| **xiaohongshu** | `search` `notifications` `feed` `me` `user` | 🔐 浏览器 |
|
|
124
137
|
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` | 🔐 浏览器 |
|
|
@@ -185,6 +198,8 @@ opencli cascade https://api.example.com/data
|
|
|
185
198
|
- Chrome 里的登录态可能已经过期(甚至被要求过滑动验证码)。请打开当前 Chrome 页面,在新标签页重新手工登录或刷新该页面。
|
|
186
199
|
- **Node API 错误 (如 parseArgs, fs 等)**
|
|
187
200
|
- 确保 Node.js 版本 `>= 18`。旧版不支持我们使用的现代核心库 API。
|
|
201
|
+
- **Token 问题**
|
|
202
|
+
- 运行 `opencli doctor` 诊断所有工具的 Token 配置状态。
|
|
188
203
|
|
|
189
204
|
## 版本发布
|
|
190
205
|
|
package/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: opencli
|
|
3
3
|
description: "OpenCLI — Make any website your CLI. Zero risk, AI-powered, reuse Chrome login."
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
author: jackwener
|
|
6
6
|
tags: [cli, browser, web, mcp, playwright, bilibili, zhihu, twitter, github, v2ex, hackernews, reddit, xiaohongshu, xueqiu, AI, agent]
|
|
7
7
|
---
|
|
@@ -34,7 +34,8 @@ npm update -g @jackwener/opencli
|
|
|
34
34
|
|
|
35
35
|
Browser commands require:
|
|
36
36
|
1. Chrome browser running **(logged into target sites)**
|
|
37
|
-
2. [Playwright MCP Bridge](https://chromewebstore.google.com/detail/playwright-mcp-bridge/mmlmfjhmonkocbjadbfplnigmagldckm) extension installed
|
|
37
|
+
2. [Playwright MCP Bridge](https://chromewebstore.google.com/detail/playwright-mcp-bridge/mmlmfjhmonkocbjadbfplnigmagldckm) extension installed
|
|
38
|
+
3. Run `opencli setup` to auto-discover token and configure all tools
|
|
38
39
|
|
|
39
40
|
> **Note**: You must be logged into the target website in Chrome before running commands. Tabs opened during command execution are auto-closed afterwards.
|
|
40
41
|
|
|
@@ -139,6 +140,9 @@ opencli list --json # JSON output
|
|
|
139
140
|
opencli list -f yaml # YAML output
|
|
140
141
|
opencli validate # Validate all CLI definitions
|
|
141
142
|
opencli validate bilibili # Validate specific site
|
|
143
|
+
opencli setup # Interactive token setup (auto-discover + TUI checkbox)
|
|
144
|
+
opencli doctor # Diagnose token config across all tools
|
|
145
|
+
opencli doctor --fix -y # Auto-fix all config files (non-interactive)
|
|
142
146
|
```
|
|
143
147
|
|
|
144
148
|
### AI Agent Workflow
|
package/dist/setup.js
CHANGED
|
@@ -84,7 +84,7 @@ export async function runSetup(opts = {}) {
|
|
|
84
84
|
items.push({
|
|
85
85
|
label: padRight(shortenPath(config.path), 50) + chalk.dim(tool ? ` [${tool}]` : ''),
|
|
86
86
|
value: `config:${config.path}`,
|
|
87
|
-
checked:
|
|
87
|
+
checked: false, // let user explicitly select which tools to configure
|
|
88
88
|
status: ok ? `configured (${fp})` : !config.exists ? 'will create' : fp ? `mismatch (${fp})` : 'missing',
|
|
89
89
|
statusColor: ok ? 'green' : 'yellow',
|
|
90
90
|
});
|
package/package.json
CHANGED
package/src/setup.ts
CHANGED
|
@@ -104,7 +104,7 @@ export async function runSetup(opts: { cliVersion?: string; token?: string } = {
|
|
|
104
104
|
items.push({
|
|
105
105
|
label: padRight(shortenPath(config.path), 50) + chalk.dim(tool ? ` [${tool}]` : ''),
|
|
106
106
|
value: `config:${config.path}`,
|
|
107
|
-
checked:
|
|
107
|
+
checked: false, // let user explicitly select which tools to configure
|
|
108
108
|
status: ok ? `configured (${fp})` : !config.exists ? 'will create' : fp ? `mismatch (${fp})` : 'missing',
|
|
109
109
|
statusColor: ok ? 'green' : 'yellow',
|
|
110
110
|
});
|