Skip to content

Commit bee0f38

Browse files
committed
Add bilingual README and example prompts
1 parent 95f48c8 commit bee0f38

4 files changed

Lines changed: 255 additions & 27 deletions

File tree

‎README.md‎

Lines changed: 138 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,49 @@
11
# OpenCLI Skill
22

3-
A Codex skill for working with [OpenCLI](https://github.com/jackwener/opencli): installation checks, command discovery, browser-login reuse, desktop-app adapters, downloads, troubleshooting, and adapter-generation workflows.
3+
English | [中文](#中文说明)
4+
5+
A Codex skill for working with [OpenCLI](https://github.com/jackwener/opencli): command discovery, browser-login reuse, desktop-app adapters, downloads, troubleshooting, and adapter-generation workflows.
46

57
Repository: [GloriaGuo/opencli-skill](https://github.com/GloriaGuo/opencli-skill)
68

9+
## Why This Exists
10+
11+
OpenCLI is powerful, but it spans several different modes:
12+
13+
- public data commands
14+
- browser-backed site adapters
15+
- Electron desktop adapters
16+
- external CLI passthrough
17+
- adapter generation workflows
18+
19+
This skill gives Codex a read-first, agent-safe operating path so it can:
20+
21+
- discover the installed OpenCLI surface before guessing
22+
- choose the right adapter for a site or app
23+
- prefer structured output such as JSON
24+
- troubleshoot Browser Bridge, login-state, and installed-version mismatches
25+
726
## What This Skill Covers
827

9-
- Choosing when OpenCLI is a better fit than browser agents or Playwright
10-
- Discovering commands safely with `opencli list -f yaml`
11-
- Running browser-backed site commands with Chrome login reuse
12-
- Running desktop adapters such as Codex and Cursor
13-
- Using OpenCLI as a passthrough hub for local CLIs such as `gh` and `docker`
14-
- Downloading media and exported articles
15-
- Troubleshooting the Browser Bridge, daemon, auth, and installed-command mismatches
16-
- Generating new OpenCLI adapters
28+
- choosing OpenCLI vs browser agents vs Playwright
29+
- discovering commands safely with `opencli list -f yaml`
30+
- running browser-backed site commands with Chrome login reuse
31+
- running desktop adapters such as Codex and Cursor
32+
- using OpenCLI as a passthrough hub for local CLIs such as `gh` and `docker`
33+
- downloading media and exported articles
34+
- troubleshooting daemon, extension, auth, and command-surface issues
35+
- generating new OpenCLI adapters
1736

18-
## Files
37+
## Repository Structure
1938

2039
- [SKILL.md](./SKILL.md): main skill entrypoint
21-
- [agents/openai.yaml](./agents/openai.yaml): UI metadata for the skill
22-
- [references/agent-playbook.md](./references/agent-playbook.md): fastest agent-first operating path
23-
- [references/commands.md](./references/commands.md): common commands and output patterns
40+
- [agents/openai.yaml](./agents/openai.yaml): UI metadata
41+
- [references/agent-playbook.md](./references/agent-playbook.md): shortest agent-first path
42+
- [references/commands.md](./references/commands.md): common commands and output modes
2443
- [references/china-workflows.md](./references/china-workflows.md): China-focused site and desktop examples
25-
- [references/practical-scenarios.md](./references/practical-scenarios.md): detailed use-case manual
26-
- [references/troubleshooting.md](./references/troubleshooting.md): common failure signatures and fixes
44+
- [references/practical-scenarios.md](./references/practical-scenarios.md): detailed scenario manual
45+
- [references/troubleshooting.md](./references/troubleshooting.md): common failures and fixes
46+
- [examples/README.md](./examples/README.md): example prompts and command recipes
2747

2848
## Install
2949

@@ -49,11 +69,11 @@ opencli list -f yaml
4969

5070
For browser-backed commands:
5171

52-
- Keep Chrome open
53-
- Log into the target site in Chrome
54-
- Install and enable the OpenCLI Browser Bridge extension
72+
- keep Chrome open
73+
- log into the target site in Chrome
74+
- install and enable the OpenCLI Browser Bridge extension
5575

56-
## Quick Examples
76+
## Quick Start
5777

5878
Public data:
5979

@@ -74,7 +94,7 @@ Desktop adapters:
7494
opencli codex --help
7595
opencli codex read -f json
7696
opencli cursor read -f json
77-
opencli cursor ask "总结当前工作区最近一次对话"
97+
opencli cursor ask "Summarize the latest workspace conversation"
7898
```
7999

80100
Downloads:
@@ -86,16 +106,107 @@ opencli bilibili download BV1xxx --output ./bilibili
86106

87107
## Design Principles
88108

89-
- Prefer deterministic command output over ad-hoc browsing
90-
- Start with read-only commands
91-
- Trust the installed CLI surface over stale README assumptions
92-
- Use `json` for agents and `yaml` for humans
93-
- Treat browser login state as a first-class dependency
109+
- prefer deterministic command output over ad-hoc browsing
110+
- start with read-only commands
111+
- trust the installed CLI surface over stale README assumptions
112+
- use `json` for agents and `yaml` for humans
113+
- treat browser login state as a first-class dependency
94114

95115
## Validation
96116

97-
This skill can be validated with:
98-
99117
```bash
100118
python3 /Users/ruiguo/.codex/skills/.system/skill-creator/scripts/quick_validate.py .
101119
```
120+
121+
## 中文说明
122+
123+
这是一个给 Codex 用的 `OpenCLI` skill,目标不是重复官方 README,而是让 agent 更稳定地完成真实任务:
124+
125+
- 先发现本机已安装的命令面
126+
- 再选择站点 / 桌面应用 / CLI passthrough / adapter generation 路径
127+
- 默认走只读优先、结构化输出优先
128+
- 遇到浏览器命令时优先检查 Chrome 登录态和 Browser Bridge
129+
130+
## 这个 skill 解决什么问题
131+
132+
- 帮 Codex 判断什么时候该用 OpenCLI,而不是 browser agent 或 Playwright
133+
- 帮 Codex 在动手前先跑 `opencli list -f yaml`
134+
- 帮 Codex 对 B 站、知乎、小红书、微信公众号、Boss、Cursor、Codex 等场景选对命令
135+
- 帮 Codex 在安装版本和 README 不一致时,以本机实际命令面为准
136+
- 帮 Codex 在写操作前先做读操作,降低误操作风险
137+
138+
## 仓库内容
139+
140+
- [SKILL.md](./SKILL.md):主 skill
141+
- [agents/openai.yaml](./agents/openai.yaml):UI 元数据
142+
- [references/agent-playbook.md](./references/agent-playbook.md):最短执行路径,偏 agent-first
143+
- [references/commands.md](./references/commands.md):常用命令和输出格式
144+
- [references/china-workflows.md](./references/china-workflows.md):中文平台和桌面应用示例
145+
- [references/practical-scenarios.md](./references/practical-scenarios.md):详细实用场景手册
146+
- [references/troubleshooting.md](./references/troubleshooting.md):常见故障排查
147+
- [examples/README.md](./examples/README.md):可直接照抄的 prompt 和命令示例
148+
149+
## 安装方式
150+
151+
```bash
152+
git clone git@github.com:GloriaGuo/opencli-skill.git "${CODEX_HOME:-$HOME/.codex}/skills/opencli"
153+
```
154+
155+
或者手动复制到:
156+
157+
```bash
158+
${CODEX_HOME:-$HOME/.codex}/skills/opencli
159+
```
160+
161+
## 推荐的 OpenCLI 环境准备
162+
163+
```bash
164+
npm install -g @jackwener/opencli
165+
opencli doctor
166+
opencli list -f yaml
167+
```
168+
169+
如果要跑浏览器类命令:
170+
171+
- 保持 Chrome 打开
172+
- 先在 Chrome 中登录目标网站
173+
- 安装并启用 OpenCLI Browser Bridge 扩展
174+
175+
## 快速示例
176+
177+
公共数据:
178+
179+
```bash
180+
opencli hackernews top --limit 5 -f json
181+
```
182+
183+
浏览器站点:
184+
185+
```bash
186+
opencli bilibili hot --limit 5 -f json
187+
opencli zhihu search "Android 性能优化" -f json
188+
```
189+
190+
桌面应用:
191+
192+
```bash
193+
opencli codex --help
194+
opencli codex read -f json
195+
opencli cursor read -f json
196+
opencli cursor ask "总结当前工作区最近一次对话"
197+
```
198+
199+
下载:
200+
201+
```bash
202+
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu
203+
opencli bilibili download BV1xxx --output ./bilibili
204+
```
205+
206+
## 设计原则
207+
208+
- 优先用确定性的命令输出,而不是临场网页推理
209+
- 先读后写
210+
- 以本机安装版本的命令面为准,不盲信旧文档
211+
- agent 消费优先 `json`,人工查看优先 `yaml`
212+
- 浏览器登录态是第一优先级依赖

‎examples/README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Examples
2+
3+
This folder contains practical prompts and command recipes you can copy into Codex or run directly.
4+
5+
- [agent-prompts.md](./agent-prompts.md): user-style prompts that should trigger the skill
6+
- [command-recipes.md](./command-recipes.md): reusable command recipes grouped by workflow

‎examples/agent-prompts.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Agent Prompts
2+
3+
These are realistic prompts that should naturally trigger the OpenCLI skill.
4+
5+
## Discovery
6+
7+
- Use OpenCLI to check what site adapters are available on this machine.
8+
- Inspect the installed OpenCLI surface and tell me whether Bilibili, Zhihu, and Codex adapters exist.
9+
- Use OpenCLI to troubleshoot why my browser-backed commands are returning empty data.
10+
11+
## Browser-Backed Sites
12+
13+
- Use OpenCLI to fetch the top 10 Bilibili hot videos as JSON.
14+
- Pull Zhihu search results for "Android 性能优化" through OpenCLI and summarize the top themes.
15+
- Use OpenCLI to search Xiaohongshu for "AI Agent" and return the first 10 results in YAML.
16+
- Export this Weixin article through OpenCLI and save it locally as Markdown.
17+
18+
## Desktop Adapters
19+
20+
- Use OpenCLI to inspect the current Codex desktop conversation and summarize it.
21+
- Use OpenCLI to read Cursor's current conversation and tell me what model it is using.
22+
- Use OpenCLI to export the current Codex thread to Markdown.
23+
24+
## Downloads
25+
26+
- Download this Bilibili video with OpenCLI into `./bilibili`.
27+
- Use OpenCLI to export a Zhihu article and download all images.
28+
- Download the media from this Xiaohongshu note through OpenCLI.
29+
30+
## Adapter Development
31+
32+
- Explore this site with OpenCLI and generate an adapter for its hot list.
33+
- Use OpenCLI cascade to probe the authentication strategy for this endpoint.
34+
35+
## Chinese Prompts
36+
37+
- 用 OpenCLI 拉一下 B 站热榜,返回 JSON。
38+
- 用 OpenCLI 搜索知乎里的“Android 性能优化”,先给我前 10 条。
39+
- 用 OpenCLI 读取当前 Codex 桌面会话并总结最近进度。
40+
- 用 OpenCLI 检查为什么小红书命令拿不到数据。

‎examples/command-recipes.md‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Command Recipes
2+
3+
## 1. Environment Check
4+
5+
```bash
6+
opencli doctor
7+
opencli list -f yaml
8+
```
9+
10+
## 2. Public Data
11+
12+
```bash
13+
opencli hackernews top --limit 5 -f json
14+
opencli google news --limit 10 -f json
15+
opencli wikipedia trending -f json
16+
```
17+
18+
## 3. Chinese Platforms
19+
20+
```bash
21+
opencli bilibili hot --limit 10 -f json
22+
opencli zhihu hot -f json
23+
opencli zhihu search "Android 性能优化" -f json
24+
opencli xiaohongshu search "AI Agent" --limit 10 -f yaml
25+
opencli weibo hot -f yaml
26+
opencli weixin download --url "https://mp.weixin.qq.com/s/xxx" --output ./weixin
27+
```
28+
29+
## 4. Desktop Adapters
30+
31+
```bash
32+
opencli codex --help
33+
opencli codex read -f json
34+
opencli codex history -f json
35+
opencli codex model -f json
36+
opencli codex export
37+
38+
opencli cursor --help
39+
opencli cursor read -f json
40+
opencli cursor history -f json
41+
opencli cursor model -f json
42+
opencli cursor ask "Summarize the latest workspace conversation"
43+
opencli cursor export
44+
```
45+
46+
## 5. Downloads
47+
48+
```bash
49+
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu
50+
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --download-images
51+
opencli xiaohongshu download abc123 --output ./xhs
52+
opencli bilibili download BV1xxx --output ./bilibili
53+
```
54+
55+
## 6. External CLI Hub
56+
57+
```bash
58+
opencli gh pr list --limit 5
59+
opencli docker ps
60+
opencli obsidian search query="AI"
61+
opencli gws docs list
62+
```
63+
64+
## 7. Adapter Development
65+
66+
```bash
67+
opencli explore https://example.com --site mysite
68+
opencli synthesize mysite
69+
opencli generate https://example.com --goal "hot"
70+
opencli cascade https://api.example.com/data
71+
```

0 commit comments

Comments
 (0)