Skip to content

Commit 95f48c8

Browse files
committed
Add README and agent-first skill guidance
1 parent b3f8232 commit 95f48c8

4 files changed

Lines changed: 218 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# OpenCLI Skill
2+
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.
4+
5+
Repository: [GloriaGuo/opencli-skill](https://github.com/GloriaGuo/opencli-skill)
6+
7+
## What This Skill Covers
8+
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
17+
18+
## Files
19+
20+
- [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
24+
- [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
27+
28+
## Install
29+
30+
Clone or copy the repo into your Codex skills directory:
31+
32+
```bash
33+
git clone git@github.com:GloriaGuo/opencli-skill.git "${CODEX_HOME:-$HOME/.codex}/skills/opencli"
34+
```
35+
36+
Or copy the folder contents manually into:
37+
38+
```bash
39+
${CODEX_HOME:-$HOME/.codex}/skills/opencli
40+
```
41+
42+
## Recommended OpenCLI Setup
43+
44+
```bash
45+
npm install -g @jackwener/opencli
46+
opencli doctor
47+
opencli list -f yaml
48+
```
49+
50+
For browser-backed commands:
51+
52+
- Keep Chrome open
53+
- Log into the target site in Chrome
54+
- Install and enable the OpenCLI Browser Bridge extension
55+
56+
## Quick Examples
57+
58+
Public data:
59+
60+
```bash
61+
opencli hackernews top --limit 5 -f json
62+
```
63+
64+
Browser-backed data:
65+
66+
```bash
67+
opencli bilibili hot --limit 5 -f json
68+
opencli zhihu search "Android 性能优化" -f json
69+
```
70+
71+
Desktop adapters:
72+
73+
```bash
74+
opencli codex --help
75+
opencli codex read -f json
76+
opencli cursor read -f json
77+
opencli cursor ask "总结当前工作区最近一次对话"
78+
```
79+
80+
Downloads:
81+
82+
```bash
83+
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu
84+
opencli bilibili download BV1xxx --output ./bilibili
85+
```
86+
87+
## Design Principles
88+
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
94+
95+
## Validation
96+
97+
This skill can be validated with:
98+
99+
```bash
100+
python3 /Users/ruiguo/.codex/skills/.system/skill-creator/scripts/quick_validate.py .
101+
```

‎SKILL.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,23 @@ description: Use when Codex needs to install, inspect, troubleshoot, or operate
77

88
OpenCLI turns websites, Electron apps, and existing local CLIs into structured terminal commands. Prefer it when deterministic CLI output is more useful than ad-hoc browser automation.
99

10+
## Trigger Cues
11+
12+
Load this skill when the task sounds like any of these:
13+
14+
- "use opencli"
15+
- "pull data from Bilibili/Zhihu/Xiaohongshu/Weixin/Boss"
16+
- "reuse my Chrome login"
17+
- "control Cursor/Codex/Notion/ChatGPT from the terminal"
18+
- "download article/video/media through OpenCLI"
19+
- "inspect what OpenCLI supports on this machine"
20+
- "create or troubleshoot an OpenCLI adapter"
21+
1022
## Reference Files
1123

1224
| Reference | Use for |
1325
| --- | --- |
26+
| [references/agent-playbook.md](references/agent-playbook.md) | Agent-first trigger patterns, action order, and safe defaults |
1427
| [references/commands.md](references/commands.md) | Common commands, category selection, and example invocations |
1528
| [references/china-workflows.md](references/china-workflows.md) | China-focused site templates and desktop-agent workflows |
1629
| [references/practical-scenarios.md](references/practical-scenarios.md) | Detailed field manual for choosing OpenCLI and executing end-to-end workflows |
@@ -28,6 +41,7 @@ OpenCLI turns websites, Electron apps, and existing local CLIs into structured t
2841
- New site development: use `explore`, `synthesize`, `generate`, and `cascade`.
2942
4. Prefer `-f json` for agent-readable output. Use `-f yaml` for human inspection, `-f table` for terminal browsing, and `-v` only when debugging.
3043
5. If a browser-backed command returns empty data or authorization errors, verify the Chrome login state before changing commands or code.
44+
6. Before any write-like action such as `post`, `reply`, `send`, `publish`, `greet`, or `follow`, do at least one read-only command first unless the user explicitly asks to skip that safety step.
3145

3246
## Decision Guide
3347

@@ -57,4 +71,6 @@ Use `opencli explore <url> --site <name>` to inspect a site, `opencli synthesize
5771
- Prefer structured output over prose whenever another tool or agent will consume the result.
5872
- For media downloads, install `yt-dlp` when the adapter requires it.
5973
- When a command is likely browser-backed, assume login state matters until proven otherwise.
74+
- For desktop adapters, check `--help` before assuming command parity across apps or versions.
75+
- Treat `opencli list -f yaml` as the source of truth when the README and installed commands disagree.
6076
- Read [references/troubleshooting.md](references/troubleshooting.md) before concluding that an adapter is broken.

‎agents/openai.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
interface:
22
display_name: "OpenCLI"
3-
short_description: "Run websites and desktop apps through OpenCLI"
4-
default_prompt: "Use $opencli to inspect the local OpenCLI setup and run the right command for this site or app."
3+
short_description: "Discover and run OpenCLI workflows safely"
4+
default_prompt: "Use $opencli to inspect the installed OpenCLI surface, choose the right adapter, and run a safe read-first workflow for this task."

‎references/agent-playbook.md‎

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# OpenCLI Agent Playbook
2+
3+
This file is optimized for agent behavior. Read it when the user wants results through OpenCLI and you need a safe default path quickly.
4+
5+
## Trigger Phrases
6+
7+
Strong signals:
8+
9+
- "use opencli"
10+
- "check what opencli can do"
11+
- "run this through my browser login"
12+
- "query Bilibili / Zhihu / Xiaohongshu / Weixin / Boss"
13+
- "control Codex / Cursor / ChatGPT / Notion from terminal"
14+
- "download this article/video with opencli"
15+
- "generate an opencli adapter"
16+
17+
Weak but useful signals:
18+
19+
- The task needs deterministic CLI output instead of free-form browsing
20+
- The user already has the site logged in in Chrome
21+
- The task targets a known site repeatedly
22+
23+
## Default Action Order
24+
25+
Follow this order unless the user already gave an exact command:
26+
27+
1. `opencli doctor` if the task is browser-backed and health is unknown
28+
2. `opencli list -f yaml` if the command surface is unknown
29+
3. Use read-only commands first
30+
4. Use `-f json` if another tool or model will consume the result
31+
5. Expand scope only after a small first pass succeeds
32+
33+
## First Commands By Situation
34+
35+
### Browser-backed site
36+
37+
```bash
38+
opencli doctor
39+
opencli list -f yaml
40+
opencli <site> <read-command> --limit 5 -f json
41+
```
42+
43+
### Desktop adapter
44+
45+
```bash
46+
opencli <app> --help
47+
opencli <app> read -f json
48+
opencli <app> history -f json
49+
opencli <app> model -f json
50+
```
51+
52+
### External CLI passthrough
53+
54+
```bash
55+
opencli <tool> ...
56+
```
57+
58+
### Adapter development
59+
60+
```bash
61+
opencli explore <url> --site <name>
62+
opencli synthesize <name>
63+
opencli generate <url> --goal "<goal>"
64+
```
65+
66+
## Safe Defaults
67+
68+
- Start with `--limit 5` or `--limit 10`
69+
- Prefer `json` for machine consumption
70+
- Prefer `yaml` when the human will scan raw output
71+
- Do not begin with write actions such as `post`, `reply`, `publish`, `greet`, `send`, or `follow`
72+
- For browser-backed commands, suspect login state before suspecting the adapter
73+
74+
## Write-Action Rule
75+
76+
Before any write-capable command:
77+
78+
1. Read current state first
79+
2. Confirm target identity or content source
80+
3. Keep the outbound command explicit in the transcript
81+
82+
Examples:
83+
84+
- Before `boss greet`, run `boss detail`
85+
- Before `jike post`, inspect timeline or notifications if relevant
86+
- Before desktop `send` or `ask`, confirm the app and active context with `read`, `history`, or `model`
87+
88+
## Installed-Version Rule
89+
90+
Do not assume the README equals the installed surface area.
91+
92+
When in doubt:
93+
94+
```bash
95+
opencli <adapter> --help
96+
opencli list -f yaml
97+
```
98+
99+
Trust the installed CLI over stale docs.

0 commit comments

Comments
 (0)