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
57Repository: [ 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
5070For 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
5878Public data:
5979
@@ -74,7 +94,7 @@ Desktop adapters:
7494opencli codex --help
7595opencli codex read -f json
7696opencli cursor read -f json
77- opencli cursor ask " 总结当前工作区最近一次对话 "
97+ opencli cursor ask " Summarize the latest workspace conversation "
7898```
7999
80100Downloads:
@@ -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
100118python3 /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+ - 浏览器登录态是第一优先级依赖
0 commit comments