@zenalexa/unicli 0.218.0 → 0.218.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/AGENTS.md CHANGED
@@ -52,4 +52,22 @@ project ships at high cadence, written counts go stale fast.
52
52
 
53
53
  ## Version
54
54
 
55
- 0.218.0 — Apollo · Cernan
55
+ 0.218.1 — Apollo · Cernan Patch
56
+
57
+ ## MCP one-liner (Claude Desktop / Cursor / Continue)
58
+
59
+ ```json
60
+ {
61
+ "mcpServers": {
62
+ "unicli": {
63
+ "command": "npx",
64
+ "args": ["-y", "@zenalexa/unicli-mcp"]
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ Equivalent: `npx -y @zenalexa/unicli mcp serve`. Default profile exposes 4
71
+ meta-tools (~200 tokens); `--expanded` exposes one tool per command (3,319
72
+ tools, ~160K tokens). The registry manifest is shipped at `server.json` for
73
+ the official MCP registry.
package/README.md CHANGED
@@ -354,5 +354,5 @@ npm run verify
354
354
  [Apache-2.0](./LICENSE)
355
355
 
356
356
  <p align="center">
357
- <sub>v0.218.0 — Apollo · Cernan</sub>
357
+ <sub>v0.218.1 — Apollo · Cernan Patch</sub>
358
358
  </p>
package/README.zh-CN.md CHANGED
@@ -334,5 +334,5 @@ npm run verify
334
334
  [Apache-2.0](./LICENSE)
335
335
 
336
336
  <p align="center">
337
- <sub>v0.218.0 — Apollo · Cernan</sub>
337
+ <sub>v0.218.1 — Apollo · Cernan Patch</sub>
338
338
  </p>
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @owner src/bin/unicli-mcp.ts
4
+ * @does One-liner npm bin that boots the Uni-CLI MCP server (stdio).
5
+ * @needs ../mcp/server.js
6
+ * @feeds npm bin -> `npx -y @zenalexa/unicli-mcp` (Claude Desktop, Cursor, etc.)
7
+ * @breaks Server start failure propagates as exit 1; no fallback transport.
8
+ */
9
+ import "../mcp/server.js";
10
+ //# sourceMappingURL=unicli-mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unicli-mcp.d.ts","sourceRoot":"","sources":["../../src/bin/unicli-mcp.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG;AAEH,OAAO,kBAAkB,CAAC"}
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @owner src/bin/unicli-mcp.ts
4
+ * @does One-liner npm bin that boots the Uni-CLI MCP server (stdio).
5
+ * @needs ../mcp/server.js
6
+ * @feeds npm bin -> `npx -y @zenalexa/unicli-mcp` (Claude Desktop, Cursor, etc.)
7
+ * @breaks Server start failure propagates as exit 1; no fallback transport.
8
+ */
9
+ import "../mcp/server.js";
10
+ //# sourceMappingURL=unicli-mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unicli-mcp.js","sourceRoot":"","sources":["../../src/bin/unicli-mcp.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG;AAEH,OAAO,kBAAkB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.218.0",
2
+ "version": "0.218.1",
3
3
  "sites": {
4
4
  "1688": {
5
5
  "commands": [
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@zenalexa/unicli",
3
- "version": "0.218.0",
4
- "description": "Agent execution substrate for web, apps, local tools, and system capabilities",
3
+ "version": "0.218.1",
4
+ "description": "Agent execution substrate for web, apps, local tools, and system capabilities. Self-repairing CLI catalog for 237+ websites and apps. Stdio + Streamable HTTP MCP server.",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "bin": {
8
- "unicli": "dist/main.js"
8
+ "unicli": "dist/main.js",
9
+ "unicli-mcp": "dist/bin/unicli-mcp.js"
9
10
  },
10
11
  "files": [
11
12
  "dist/",
@@ -14,6 +15,19 @@
14
15
  "docs/mcp/clients/",
15
16
  "src/adapters/",
16
17
  "src/hub/",
18
+ "skills/unicli/",
19
+ "skills/unicli-browser/",
20
+ "skills/unicli-claude-code/",
21
+ "skills/unicli-explorer/",
22
+ "skills/unicli-hermes/",
23
+ "skills/unicli-oneshot/",
24
+ "skills/unicli-operate/",
25
+ "skills/unicli-repair/",
26
+ "skills/unicli-smart-search/",
27
+ "skills/unicli-usage/",
28
+ "skills/talk-normal/",
29
+ "skills/README.md",
30
+ "server.json",
17
31
  "AGENTS.md"
18
32
  ],
19
33
  "publishConfig": {
@@ -124,7 +138,7 @@
124
138
  "scripts": {
125
139
  "dev": "tsx src/main.ts",
126
140
  "build": "tsc && tsx scripts/build-manifest.js && tsx scripts/count-stats.ts && tsx scripts/build-readme.ts && tsx scripts/build-agents.ts && prettier --write AGENTS.md",
127
- "postbuild": "node -e \"require('fs').chmodSync('dist/main.js', 0o755)\"",
141
+ "postbuild": "node -e \"const fs=require('fs'); fs.chmodSync('dist/main.js', 0o755); fs.chmodSync('dist/bin/unicli-mcp.js', 0o755);\"",
128
142
  "stats": "tsx scripts/build-manifest.js && tsx scripts/count-stats.ts && tsx scripts/build-readme.ts && tsx scripts/build-agents.ts",
129
143
  "stats:check": "tsx scripts/count-consistency.ts",
130
144
  "build:agents": "tsx scripts/build-agents.ts",
@@ -219,10 +233,10 @@
219
233
  "zod": "^4.3.6"
220
234
  },
221
235
  "optionalDependencies": {
222
- "@zenalexa/unicli-atspi-linux-arm64": "0.218.0",
223
- "@zenalexa/unicli-atspi-linux-x64": "0.218.0",
224
- "@zenalexa/unicli-uia-win32-arm64": "0.218.0",
225
- "@zenalexa/unicli-uia-win32-x64": "0.218.0"
236
+ "@zenalexa/unicli-atspi-linux-arm64": "0.218.1",
237
+ "@zenalexa/unicli-atspi-linux-x64": "0.218.1",
238
+ "@zenalexa/unicli-uia-win32-arm64": "0.218.1",
239
+ "@zenalexa/unicli-uia-win32-x64": "0.218.1"
226
240
  },
227
241
  "devDependencies": {
228
242
  "@ai-sdk/openai-compatible": "^2.0.41",
package/server.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
3
+ "name": "io.github.olo-dot-io/Uni-CLI",
4
+ "description": "Self-repairing CLI catalog that exposes 237+ websites, desktop apps, and external CLIs as one MCP server. 920 declarative YAML adapters; structured error envelopes let agents fix failing adapters at runtime and retry.",
5
+ "version": "0.218.1",
6
+ "repository": {
7
+ "url": "https://github.com/olo-dot-io/Uni-CLI",
8
+ "source": "github"
9
+ },
10
+ "websiteUrl": "https://olo-dot-io.github.io/Uni-CLI/",
11
+ "packages": [
12
+ {
13
+ "registryType": "npm",
14
+ "registryBaseUrl": "https://registry.npmjs.org",
15
+ "identifier": "@zenalexa/unicli",
16
+ "version": "0.218.1",
17
+ "transport": {
18
+ "type": "stdio"
19
+ },
20
+ "runtimeArguments": [
21
+ {
22
+ "type": "positional",
23
+ "value": "mcp",
24
+ "valueHint": "subcommand",
25
+ "isRequired": true
26
+ },
27
+ {
28
+ "type": "positional",
29
+ "value": "serve",
30
+ "valueHint": "subcommand",
31
+ "isRequired": true
32
+ }
33
+ ],
34
+ "environmentVariables": [
35
+ {
36
+ "name": "UNICLI_MCP_PROFILE",
37
+ "description": "Tool profile: default (4 meta-tools), expanded (one tool per command), or computer-use",
38
+ "isRequired": false,
39
+ "default": "default"
40
+ }
41
+ ]
42
+ }
43
+ ]
44
+ }
@@ -0,0 +1,39 @@
1
+ # Uni-CLI Skills
2
+
3
+ Cross-vendor agent skills shipped with the repo. Each `<name>/SKILL.md`
4
+ follows the [Agent Skill Protocol v2.0](https://github.com/anthropics/skills)
5
+ with `name`, `description`, `triggers` frontmatter, and a progressive
6
+ loading layout (L0 index → L1 main → L2 references → L3 external).
7
+
8
+ These skills are consumable by any agent platform that speaks the
9
+ SKILL.md standard: Claude Code, Codex, Hermes, Cline, OpenCode, etc.
10
+
11
+ ## Skills
12
+
13
+ | Skill | Purpose |
14
+ | --------------------- | ----------------------------------------------------------------------------------- |
15
+ | `talk-normal` | Always-on concise writing rules for docs and UI copy |
16
+ | `unicli` | Comprehensive agent guide — discover, run, read output, auth, errors, skill routing |
17
+ | `bgclick-rev` | IDA-backed research workflow for macOS background clicks |
18
+ | `unicli-browser` | Control Chrome via daemon bridge |
19
+ | `unicli-claude` | Claude.ai-specific commands and integration |
20
+ | `unicli-claude-code` | Claude Code CLI integration |
21
+ | `unicli-explorer` | Create new adapters by exploring sites/APIs |
22
+ | `unicli-hermes` | Hermes-platform integration |
23
+ | `unicli-oneshot` | One-shot adapter generation from a URL + goal |
24
+ | `unicli-operate` | Direct browser automation via `operate` subcommands |
25
+ | `unicli-repair` | Self-repair workflow for broken adapters (envelope-driven) |
26
+ | `unicli-smart-search` | Route search queries to the best platform |
27
+ | `unicli-usage` | Command reference and usage guide |
28
+
29
+ ## Adding a skill
30
+
31
+ 1. Create `skills/<name>/SKILL.md` with v2.0 frontmatter.
32
+ 2. Keep the protocol section lean (decision trees, not prose).
33
+ 3. Push large references into `skills/<name>/references/`.
34
+ 4. Add a row above.
35
+ 5. `npm run lint:context` scores it against the agent-lint rubric;
36
+ threshold is 60/100.
37
+
38
+ See `docs/guide/integrations.md`, `contributing/mcp.md`, and the global
39
+ skills protocol guide for structure details.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: talk-normal
3
+ slug: talk-normal
4
+ description: Always-on writing rules for concise, normal, bilingual documentation and user-facing text.
5
+ version: 0.6.2
6
+ tags: [prompt, writing, concise, anti-slop, chinese, bilingual, always-on]
7
+ homepage: https://github.com/hexiecs/talk-normal
8
+ license: MIT
9
+ ---
10
+
11
+ # talk-normal
12
+
13
+ Use this skill before drafting or editing public docs, UI copy, README text,
14
+ agent-facing instructions, release notes, and other user-facing prose.
15
+
16
+ The full writing rules live in [prompt.md](prompt.md). The operating summary:
17
+
18
+ - Lead with the answer or concrete point.
19
+ - Keep useful detail; remove filler, throat-clearing, and corporate polish.
20
+ - Prefer direct positive claims.
21
+ - Use bullets only when the content is naturally parallel.
22
+ - End with the concrete recommendation or next action when one is needed.
23
+ - Avoid hypothetical follow-up offers.
24
+
25
+ Upstream: https://github.com/hexiecs/talk-normal
@@ -0,0 +1,35 @@
1
+ <!-- talk-normal 0.6.2 -->
2
+
3
+ Be direct and informative. No filler, no fluff, but give enough to be useful.
4
+
5
+ Your single hardest constraint: prefer direct positive claims. Do not use negation-based contrastive phrasing in any language or position — neither "reject then correct" (不是X,而是Y) nor "correct then reject" (X,而不是Y). If you catch yourself writing a sentence where a negative adverb sets up or follows a positive claim, restructure and state only the positive.
6
+
7
+ Examples:
8
+
9
+ BAD: 真正的创新者不是"有创意的人",而是五种特质同时拉满的人
10
+ GOOD: 真正的创新者是五种特质同时拉满的人
11
+
12
+ BAD: 真正的创新者是五种特质同时拉满的人,而不是单纯"聪明"的人
13
+ GOOD: 真正的创新者是五种特质同时拉满的人
14
+
15
+ BAD: 这更像创始人筛选框架,不是交易信号
16
+ GOOD: 这是一个创始人筛选框架
17
+
18
+ BAD: It's not about intelligence, it's about taste
19
+ GOOD: Taste is what matters
20
+
21
+ Rules:
22
+
23
+ - Lead with the answer, then add context only if it genuinely helps.
24
+ - Do not use negation-based contrastive phrasing in any position. This covers any sentence structure where a negative adverb rejects an alternative to set up or append to a positive claim: in any order, chained, symmetric, or with or without an explicit conjunction. State the positive claim directly. If a genuine distinction needs both sides, name them as parallel positive clauses. Narrow exception: technical statements about necessary or sufficient conditions in logic, math, or formal proofs.
25
+ - End with a concrete recommendation or next step when relevant. Do not use summary-stamp closings such as "In conclusion", "In summary", "Hope this helps", "一句话总结", "总结一下", "简而言之", or any structural variant that labels a summary before delivering it.
26
+ - Kill filler: "I'd be happy to", "Great question", "It's worth noting", "Certainly", "Of course", "Let me break this down", "首先我们需要", "值得注意的是", "综上所述", "让我们一起来看看".
27
+ - Never restate the question.
28
+ - Yes/no questions: answer first, one sentence of reasoning.
29
+ - Comparisons: give your recommendation with brief reasoning.
30
+ - Code: give the code and usage example if non-trivial.
31
+ - Explanations: match depth to complexity. Simple question = short answer. Complex question = structured but tight.
32
+ - Use structure only when the content has natural sequential or parallel structure.
33
+ - Do not end with hypothetical follow-up offers or conditional next-step menus.
34
+ - Do not restate the same point in a "plain language" or "in human terms" block after already explaining it.
35
+ - When listing pros/cons or comparing options, cap each side at 3-4 important points.
@@ -0,0 +1,389 @@
1
+ ---
2
+ name: unicli
3
+ description: >
4
+ Comprehensive guide to using Uni-CLI — the universal CLI for AI agents.
5
+ Trigger when the user needs to fetch data from websites (Twitter, Bilibili,
6
+ HackerNews, GitHub, Reddit, Bloomberg, Zhihu, WeChat, and 230+ more);
7
+ interact with news, finance, social, academic, shopping, or video platforms;
8
+ control macOS desktop apps (Blender, GIMP, Figma, VS Code, Cursor, Terminal,
9
+ Discord, Slack, etc.) via AppleScript or Accessibility API; automate browser
10
+ actions on login-gated pages; extract trending/hot/search/top lists from any
11
+ major platform; run desktop workflows or system tasks; or when the user says
12
+ "unicli", "scrape", "fetch from", "get trending", "check [site]", "find on
13
+ [platform]", "获取", "查询", "抓取".
14
+ version: 0.218.0
15
+ category: core
16
+ depends-on:
17
+ - talk-normal
18
+ allowed-tools: [Bash, Read]
19
+ protocol: 2.0
20
+ triggers:
21
+ - "unicli"
22
+ - "fetch from"
23
+ - "get from"
24
+ - "check twitter"
25
+ - "bilibili"
26
+ - "hackernews"
27
+ - "scrape"
28
+ - "trending"
29
+ - "hot topics"
30
+ - "desktop app"
31
+ - "macOS app"
32
+ - "browser automation"
33
+ - "search web"
34
+ - "social media"
35
+ - "获取"
36
+ - "查询"
37
+ - "抓取"
38
+ ---
39
+
40
+ # Uni-CLI — Agent Usage Guide
41
+
42
+ unicli converts 237 websites, 2,000+ desktop apps, and macOS system tools into
43
+ deterministic CLI commands. Each command is a ≤20-line YAML pipeline: fetch data,
44
+ transform it, emit a v2 AgentEnvelope. When a command breaks, read the structured
45
+ error, edit the YAML adapter, and it stays fixed for all future calls.
46
+
47
+ **Install** (once): `npm install -g @zenalexa/unicli`
48
+
49
+ ---
50
+
51
+ ## Five-Command Quick Start
52
+
53
+ ```bash
54
+ unicli list # browse all 3,319 commands
55
+ unicli list --site hackernews # commands for one site
56
+ unicli hackernews top --limit 5 # run a command
57
+ unicli hackernews top --limit 5 -f json # machine-readable JSON envelope
58
+ unicli describe hackernews top # full schema + example payload
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Step 1 — Discover the Right Command
64
+
65
+ ### Find by site
66
+
67
+ ```bash
68
+ unicli list --site <site> # all commands for a site
69
+ unicli describe <site> <command> # args, output columns, example
70
+ ```
71
+
72
+ ### Search by keyword
73
+
74
+ ```bash
75
+ unicli search "trending" # semantic search across all commands
76
+ unicli search "hot stock" # natural language
77
+ ```
78
+
79
+ ### Browse by type
80
+
81
+ ```bash
82
+ unicli list --type web-api # REST API adapters (1,138 commands)
83
+ unicli list --type desktop # desktop app control (2,068 commands)
84
+ unicli list --type browser # browser automation (23 commands)
85
+ unicli list --type service # local/remote services (43 commands)
86
+ unicli list --type bridge # passthrough CLI bridges (47 commands)
87
+ ```
88
+
89
+ ### Check if a site exists
90
+
91
+ ```bash
92
+ unicli list --site github-trending # returns commands or empty
93
+ unicli health # adapter index summary
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Step 2 — Run Commands
99
+
100
+ ### Basic syntax
101
+
102
+ ```bash
103
+ unicli <site> <command> [<positional-arg>] [--flag value] [-f json|md|yaml|csv]
104
+ ```
105
+
106
+ ### Key flags (universal)
107
+
108
+ | Flag | Effect |
109
+ | -------------------- | ---------------------------------------------------------- |
110
+ | `--limit N` | Cap output rows (default varies, max 100) |
111
+ | `-f json` | Machine-readable v2 AgentEnvelope JSON to stdout |
112
+ | `-f md` | Agent-native Markdown (default, frontmatter + sections) |
113
+ | `-f yaml` | YAML envelope |
114
+ | `-f csv` | Flat CSV (array data only) |
115
+ | `-f compact` | One row per line, `\|` separator |
116
+ | `--args-file <path>` | Read args from a JSON file (avoids shell-quote issues) |
117
+ | `--cursor <token>` | Pagination cursor from previous envelope `meta.pagination` |
118
+
119
+ ### Common patterns
120
+
121
+ ```bash
122
+ # Search
123
+ unicli hackernews search "AI agents" --limit 10
124
+
125
+ # Trending
126
+ unicli weibo hot
127
+ unicli bilibili hot --limit 20
128
+
129
+ # Finance
130
+ unicli xueqiu hot-stock --limit 10 -f json
131
+
132
+ # Desktop control
133
+ unicli blender render scene.blend output.png
134
+ unicli ffmpeg compress video.mp4 -o compressed.mp4
135
+
136
+ # macOS system
137
+ unicli macos volume 60
138
+ unicli macos screenshot ~/Desktop/capture.png
139
+ ```
140
+
141
+ ### Pagination
142
+
143
+ ```bash
144
+ # First page
145
+ unicli reddit hot --limit 25 -f json | jq '.meta.pagination.next_cursor'
146
+
147
+ # Next page (use cursor from previous response)
148
+ unicli reddit hot --limit 25 --cursor <token> -f json
149
+ ```
150
+
151
+ ---
152
+
153
+ ## Step 3 — Read the Output
154
+
155
+ Every command emits a **v2 AgentEnvelope**. Learn the shape once; it applies to
156
+ all 3,319 commands.
157
+
158
+ ### JSON structure
159
+
160
+ ```json
161
+ {
162
+ "ok": true,
163
+ "schema_version": "2",
164
+ "command": "hackernews.top",
165
+ "meta": {
166
+ "duration_ms": 2805,
167
+ "count": 5,
168
+ "surface": "web",
169
+ "pagination": { "next_cursor": "...", "has_more": true }
170
+ },
171
+ "data": [{ "rank": 1, "title": "...", "score": 80, "url": "..." }],
172
+ "error": null,
173
+ "next_actions": [
174
+ { "command": "unicli describe hackernews top", "description": "..." }
175
+ ]
176
+ }
177
+ ```
178
+
179
+ ### Key fields
180
+
181
+ | Field | Meaning |
182
+ | ----------------- | ------------------------------------------------------------ |
183
+ | `ok` | `true` = success, `false` = failure — **always check first** |
184
+ | `schema_version` | Always `"2"` — confirms v2 envelope |
185
+ | `meta.count` | Rows returned |
186
+ | `meta.pagination` | Non-null when more pages exist; use `.next_cursor` |
187
+ | `data` | Payload array or object |
188
+ | `error` | `null` on success; structured on failure (see Step 5) |
189
+ | `next_actions` | HATEOAS hints — valid commands to run next, trust these |
190
+
191
+ ### Markdown format (default)
192
+
193
+ When piped or called by an agent, the default format is `md` — YAML frontmatter
194
+ followed by formatted sections. Use `-f json` for programmatic parsing.
195
+
196
+ ### Parse with jq
197
+
198
+ ```bash
199
+ unicli hackernews top -f json | jq '.[].title' # WRONG: data is nested
200
+ unicli hackernews top -f json | jq '.data[].title' # correct
201
+ unicli hackernews top -f json | jq '.data[] | {title, url}'
202
+ unicli xueqiu hot -f json | jq '.data[] | select(.change | tonumber > 5)'
203
+ ```
204
+
205
+ ---
206
+
207
+ ## Step 4 — Authentication
208
+
209
+ unicli uses a **strategy cascade** that auto-probes on first run. Most sites need
210
+ no manual setup — the cascade promotes from `public` → `cookie` → `header`
211
+ automatically.
212
+
213
+ ### Strategy ladder
214
+
215
+ | Strategy | Auth needed | How to set up |
216
+ | ----------- | --------------------- | ------------------------------------------------------ |
217
+ | `public` | None | Works out of the box |
218
+ | `cookie` | Browser login | `unicli auth setup <site>` → log in once in browser |
219
+ | `header` | Cookie + CSRF | Same as `cookie`; auto-extracted per request |
220
+ | `intercept` | Browser session | `unicli browser start` then `unicli auth setup <site>` |
221
+ | `ui` | Browser + interaction | Same; unicli clicks through login flow |
222
+
223
+ ### Auth setup workflow
224
+
225
+ ```bash
226
+ # First time — unicli guides you through browser login
227
+ unicli auth setup twitter
228
+
229
+ # Verify credentials are stored
230
+ unicli auth status twitter
231
+
232
+ # List all authenticated sites
233
+ unicli auth list
234
+
235
+ # Re-authenticate when cookies expire (exit code 77)
236
+ unicli auth setup <site>
237
+ ```
238
+
239
+ Cookie files live at `~/.unicli/cookies/<site>.json` — never read or edit these
240
+ directly; use `unicli auth`.
241
+
242
+ ---
243
+
244
+ ## Step 5 — Handle Errors
245
+
246
+ ### Exit code → action (primary decision tree)
247
+
248
+ | Code | Meaning | Action |
249
+ | ---- | ---------------------- | -------------------------------------------------- |
250
+ | 0 | Success | Read `data` |
251
+ | 1 | Generic error | Read `error.reason` + `error.suggestion` |
252
+ | 2 | Usage error | Fix arg syntax; run `unicli describe <site> <cmd>` |
253
+ | 66 | Empty result | Try different query terms or `--limit` |
254
+ | 69 | Service unavailable | `unicli browser start` then retry |
255
+ | 75 | Temp failure / timeout | Retry once; if persists → load `unicli-repair` |
256
+ | 77 | Auth required | `unicli auth setup <site>` then retry |
257
+ | 78 | Config error | Read `error.suggestion`; check `~/.unicli/` config |
258
+
259
+ ### Failure envelope fields
260
+
261
+ ```json
262
+ {
263
+ "ok": false,
264
+ "error": {
265
+ "code": "auth_required",
266
+ "exit_code": 77,
267
+ "message": "No cookie file found for twitter",
268
+ "adapter_path": "adapters/twitter/search.yaml",
269
+ "step": 1,
270
+ "retryable": true,
271
+ "suggestion": "Run `unicli auth setup twitter` to authenticate",
272
+ "remedy": {
273
+ "command": "unicli auth setup twitter",
274
+ "message": "Open browser to complete login"
275
+ }
276
+ }
277
+ }
278
+ ```
279
+
280
+ ### Hard rules
281
+
282
+ - **ALWAYS check `ok` first** before reading `data`.
283
+ - **NEVER retry on exit 2** (usage error — fix the args, not the adapter).
284
+ - **Follow `error.remedy.command`** exactly — it is generated from the adapter schema.
285
+ - **Load `unicli-repair` skill** when the same command fails twice after following
286
+ `remedy` — the adapter likely needs structural repair, not just a retry.
287
+
288
+ ---
289
+
290
+ ## Browser Mode (Escalation Path)
291
+
292
+ Use browser mode when: a site requires JavaScript rendering, login-gated access,
293
+ interaction (click/type/scroll), or the API adapter returns exit 69.
294
+
295
+ ```bash
296
+ unicli browser start # launch Chrome with CDP (required first)
297
+ unicli browser status # confirm CDP is alive + session state
298
+ unicli browser open <url> # navigate to page
299
+ unicli browser state # DOM accessibility tree with [ref] IDs
300
+ unicli browser find --css h2 # query specific elements
301
+ unicli browser click <ref> # interact
302
+ unicli browser type <ref> "text" # fill input
303
+ unicli browser extract # extract full page text
304
+ unicli browser screenshot # capture to file
305
+ ```
306
+
307
+ For a guided browser automation workflow, load skill `unicli-browser`.
308
+
309
+ ---
310
+
311
+ ## Composition Patterns
312
+
313
+ ### Multi-source research
314
+
315
+ ```bash
316
+ # Tech trends: query 3 sources
317
+ unicli hackernews top --limit 10 -f json | jq '.data[].title'
318
+ unicli reddit hot --limit 10 -f json | jq '.data[].title'
319
+ unicli github-trending daily --limit 10 -f json | jq '.data[].name'
320
+ ```
321
+
322
+ ### Cross-platform topic search
323
+
324
+ ```bash
325
+ for site in hackernews reddit twitter; do
326
+ echo "=== $site ===" && unicli $site search "AI agents" --limit 5
327
+ done
328
+ ```
329
+
330
+ ### Data pipeline (pipe to jq)
331
+
332
+ ```bash
333
+ unicli bilibili hot -f json \
334
+ | jq '.data[] | select(.view | tonumber > 1000000) | {title, view, up}'
335
+ ```
336
+
337
+ ### Budget rule: 1–2 primary sources + 1 supplementary per user question. Never
338
+
339
+ query the same site twice in one turn.
340
+
341
+ ---
342
+
343
+ ## Skill Routing
344
+
345
+ | Scenario | Load skill |
346
+ | -------------------------------------------- | --------------------- |
347
+ | Adapter fails with structured error envelope | `unicli-repair` |
348
+ | Search queries across platforms | `unicli-smart-search` |
349
+ | Browser automation, CDP sessions | `unicli-browser` |
350
+ | Creating a new adapter from scratch | `unicli-explorer` |
351
+ | One-shot URL → adapter generation | `unicli-oneshot` |
352
+ | Claude / Claude.ai commands | `unicli-claude` |
353
+ | Claude Code commands | `unicli-claude-code` |
354
+ | Hermes integration | `unicli-hermes` |
355
+ | Detailed command reference | `unicli-usage` |
356
+
357
+ ---
358
+
359
+ ## Efficiency Rules
360
+
361
+ 1. Default output is `md` (Markdown). Use `-f json` for programmatic parsing.
362
+ 2. Always set `--limit` — default varies per command (5–50); unset = potentially 100+.
363
+ 3. MCP server (`unicli mcp serve`) wraps all commands as tools; 4 default tools,
364
+ `--expanded` adds all 3,319 (costs tokens: use only in MCP-only environments).
365
+ 4. Adapter user overlay: fixes go to `~/.unicli/adapters/<site>/<cmd>.yaml`
366
+ and survive `npm update`.
367
+ 5. `unicli doctor` checks runtime health (Node version, Chrome, auth files,
368
+ adapter index). Run it when unexplained failures occur.
369
+ 6. `UNICLI_OUTPUT=json unicli <cmd>` sets JSON globally without `-f json` per call.
370
+
371
+ ---
372
+
373
+ ## Reference Index
374
+
375
+ | Reference | Load when |
376
+ | ---------------------------------------------- | ---------------------------------------- |
377
+ | [`references/sites.md`](references/sites.md) | Browsing the site catalog by category |
378
+ | [`references/output.md`](references/output.md) | Parsing AgentEnvelope v2 fields in depth |
379
+ | [`references/auth.md`](references/auth.md) | Auth setup per site, cookie management |
380
+
381
+ ---
382
+
383
+ ## MCP Server
384
+
385
+ ```bash
386
+ unicli mcp serve # 4 tools: run, list, search, explore
387
+ unicli mcp serve --expanded # all 3,319 commands as individual tools
388
+ unicli mcp serve --profile browser # browser + CDP tools only
389
+ ```