@zenalexa/unicli 0.217.3 → 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.
Files changed (149) hide show
  1. package/AGENTS.md +51 -194
  2. package/README.md +2 -2
  3. package/README.zh-CN.md +2 -2
  4. package/dist/bin/unicli-mcp.d.ts +10 -0
  5. package/dist/bin/unicli-mcp.d.ts.map +1 -0
  6. package/dist/bin/unicli-mcp.js +10 -0
  7. package/dist/bin/unicli-mcp.js.map +1 -0
  8. package/dist/cli.d.ts.map +1 -1
  9. package/dist/cli.js +12 -1
  10. package/dist/cli.js.map +1 -1
  11. package/dist/commands/auth.d.ts +1 -0
  12. package/dist/commands/auth.d.ts.map +1 -1
  13. package/dist/commands/auth.js +250 -0
  14. package/dist/commands/auth.js.map +1 -1
  15. package/dist/commands/dev.js +1 -0
  16. package/dist/commands/dev.js.map +1 -1
  17. package/dist/commands/health.d.ts.map +1 -1
  18. package/dist/commands/health.js +1 -0
  19. package/dist/commands/health.js.map +1 -1
  20. package/dist/commands/lint.d.ts.map +1 -1
  21. package/dist/commands/lint.js +15 -6
  22. package/dist/commands/lint.js.map +1 -1
  23. package/dist/commands/repair.d.ts +1 -0
  24. package/dist/commands/repair.d.ts.map +1 -1
  25. package/dist/commands/repair.js +103 -61
  26. package/dist/commands/repair.js.map +1 -1
  27. package/dist/engine/chromium-cookies-platform.d.ts +69 -0
  28. package/dist/engine/chromium-cookies-platform.d.ts.map +1 -0
  29. package/dist/engine/chromium-cookies-platform.js +315 -0
  30. package/dist/engine/chromium-cookies-platform.js.map +1 -0
  31. package/dist/engine/chromium-cookies-types.d.ts +26 -0
  32. package/dist/engine/chromium-cookies-types.d.ts.map +1 -0
  33. package/dist/engine/chromium-cookies-types.js +16 -0
  34. package/dist/engine/chromium-cookies-types.js.map +1 -0
  35. package/dist/engine/chromium-cookies.d.ts +56 -0
  36. package/dist/engine/chromium-cookies.d.ts.map +1 -0
  37. package/dist/engine/chromium-cookies.js +361 -0
  38. package/dist/engine/chromium-cookies.js.map +1 -0
  39. package/dist/engine/cookies.d.ts +13 -5
  40. package/dist/engine/cookies.d.ts.map +1 -1
  41. package/dist/engine/cookies.js +55 -9
  42. package/dist/engine/cookies.js.map +1 -1
  43. package/dist/engine/executor.d.ts +8 -0
  44. package/dist/engine/executor.d.ts.map +1 -1
  45. package/dist/engine/executor.js +1 -1
  46. package/dist/engine/executor.js.map +1 -1
  47. package/dist/engine/kernel/execute.d.ts.map +1 -1
  48. package/dist/engine/kernel/execute.js +1 -0
  49. package/dist/engine/kernel/execute.js.map +1 -1
  50. package/dist/engine/repair/quarantine-discovery.d.ts +25 -0
  51. package/dist/engine/repair/quarantine-discovery.d.ts.map +1 -0
  52. package/dist/engine/repair/quarantine-discovery.js +78 -0
  53. package/dist/engine/repair/quarantine-discovery.js.map +1 -0
  54. package/dist/engine/steps/navigate.d.ts +1 -1
  55. package/dist/engine/steps/navigate.d.ts.map +1 -1
  56. package/dist/engine/steps/navigate.js +5 -1
  57. package/dist/engine/steps/navigate.js.map +1 -1
  58. package/dist/engine/template.d.ts +14 -4
  59. package/dist/engine/template.d.ts.map +1 -1
  60. package/dist/engine/template.js +93 -65
  61. package/dist/engine/template.js.map +1 -1
  62. package/dist/engine/verify-row-shape.d.ts +17 -0
  63. package/dist/engine/verify-row-shape.d.ts.map +1 -0
  64. package/dist/engine/verify-row-shape.js +36 -0
  65. package/dist/engine/verify-row-shape.js.map +1 -0
  66. package/dist/fast-path/handlers/adapter.d.ts +15 -0
  67. package/dist/fast-path/handlers/adapter.d.ts.map +1 -0
  68. package/dist/fast-path/handlers/adapter.js +169 -0
  69. package/dist/fast-path/handlers/adapter.js.map +1 -0
  70. package/dist/fast-path/handlers/discovery.d.ts +14 -0
  71. package/dist/fast-path/handlers/discovery.d.ts.map +1 -0
  72. package/dist/fast-path/handlers/discovery.js +280 -0
  73. package/dist/fast-path/handlers/discovery.js.map +1 -0
  74. package/dist/fast-path/manifest.d.ts +47 -0
  75. package/dist/fast-path/manifest.d.ts.map +1 -0
  76. package/dist/fast-path/manifest.js +32 -0
  77. package/dist/fast-path/manifest.js.map +1 -0
  78. package/dist/fast-path/parsed-argv.d.ts +16 -0
  79. package/dist/fast-path/parsed-argv.d.ts.map +1 -0
  80. package/dist/fast-path/parsed-argv.js +6 -0
  81. package/dist/fast-path/parsed-argv.js.map +1 -0
  82. package/dist/fast-path/policy.d.ts +25 -0
  83. package/dist/fast-path/policy.d.ts.map +1 -0
  84. package/dist/fast-path/policy.js +96 -0
  85. package/dist/fast-path/policy.js.map +1 -0
  86. package/dist/fast-path/render.d.ts +26 -0
  87. package/dist/fast-path/render.d.ts.map +1 -0
  88. package/dist/fast-path/render.js +200 -0
  89. package/dist/fast-path/render.js.map +1 -0
  90. package/dist/fast-path.d.ts +8 -10
  91. package/dist/fast-path.d.ts.map +1 -1
  92. package/dist/fast-path.js +66 -810
  93. package/dist/fast-path.js.map +1 -1
  94. package/dist/manifest.json +7 -6
  95. package/dist/transport/adapters/cdp-browser.d.ts +6 -6
  96. package/dist/transport/adapters/cdp-browser.js +7 -7
  97. package/dist/transport/adapters/cdp-browser.js.map +1 -1
  98. package/dist/transport/adapters/subprocess.d.ts +4 -4
  99. package/dist/transport/adapters/subprocess.js +4 -4
  100. package/package.json +22 -8
  101. package/server.json +44 -0
  102. package/skills/README.md +39 -0
  103. package/skills/talk-normal/SKILL.md +25 -0
  104. package/skills/talk-normal/prompt.md +35 -0
  105. package/skills/unicli/SKILL.md +389 -0
  106. package/skills/unicli/references/auth.md +188 -0
  107. package/skills/unicli/references/output.md +238 -0
  108. package/skills/unicli/references/sites.md +259 -0
  109. package/skills/unicli-browser/SKILL.md +99 -0
  110. package/skills/unicli-claude-code/SKILL.md +172 -0
  111. package/skills/unicli-explorer/SKILL.md +90 -0
  112. package/skills/unicli-hermes/SKILL.md +83 -0
  113. package/skills/unicli-oneshot/SKILL.md +59 -0
  114. package/skills/unicli-operate/SKILL.md +113 -0
  115. package/skills/unicli-repair/SKILL.md +209 -0
  116. package/skills/unicli-repair/references/error-codes.md +149 -0
  117. package/skills/unicli-repair/references/yaml-patches.md +321 -0
  118. package/skills/unicli-smart-search/SKILL.md +80 -0
  119. package/skills/unicli-usage/SKILL.md +65 -0
  120. package/src/adapters/adguardhome/rules.yaml +1 -1
  121. package/src/adapters/adguardhome/stats.yaml +1 -1
  122. package/src/adapters/adguardhome/status.yaml +1 -1
  123. package/src/adapters/apple-music/rate-album.yaml +1 -2
  124. package/src/adapters/arxiv/trending.yaml +1 -1
  125. package/src/adapters/az/account.yaml +1 -1
  126. package/src/adapters/coupang/hot.yaml +2 -1
  127. package/src/adapters/ctrip/hot.yaml +2 -1
  128. package/src/adapters/ctrip/search.yaml +2 -1
  129. package/src/adapters/douban/top250.yaml +1 -1
  130. package/src/adapters/figma/export-selected.yaml +1 -2
  131. package/src/adapters/gcloud/projects.yaml +1 -1
  132. package/src/adapters/github-trending/developers.yaml +1 -1
  133. package/src/adapters/github-trending/weekly.yaml +1 -1
  134. package/src/adapters/homebrew/search.yaml +1 -1
  135. package/src/adapters/imdb/top.yaml +1 -1
  136. package/src/adapters/itch-io/popular.yaml +1 -1
  137. package/src/adapters/itch-io/top.yaml +1 -1
  138. package/src/adapters/mastodon/timeline.yaml +1 -1
  139. package/src/adapters/openrouter/search.yaml +1 -1
  140. package/src/adapters/pypi/search.yaml +2 -1
  141. package/src/adapters/sspai/hot.yaml +4 -1
  142. package/src/adapters/sspai/latest.yaml +3 -3
  143. package/src/adapters/tieba/hot.yaml +1 -1
  144. package/src/adapters/wikipedia/today.yaml +1 -1
  145. package/src/adapters/zoom/toggle-mute.yaml +1 -2
  146. package/dist/engine/yaml-runner.d.ts +0 -11
  147. package/dist/engine/yaml-runner.d.ts.map +0 -1
  148. package/dist/engine/yaml-runner.js +0 -18
  149. package/dist/engine/yaml-runner.js.map +0 -1
@@ -0,0 +1,238 @@
1
+ # AgentEnvelope v2 — Output Format Reference
2
+
3
+ All unicli commands emit a **v2 AgentEnvelope**. This is the stable machine contract
4
+ since v0.215. This reference covers every field, error codes, parsing patterns, and
5
+ format-specific behavior.
6
+
7
+ ---
8
+
9
+ ## Complete Schema
10
+
11
+ ```typescript
12
+ // Success envelope
13
+ {
14
+ ok: true,
15
+ schema_version: "2", // always "2"
16
+ command: "site.command", // e.g. "hackernews.top"
17
+ meta: {
18
+ duration_ms: number, // wall-clock time in ms
19
+ count?: number, // rows in data[]
20
+ surface?: "web" | "desktop" | "system" | "mobile",
21
+ adapter_version?: string, // YAML/TS adapter version string
22
+ operator?: string, // browser operator handle if used
23
+ pagination?: {
24
+ next_cursor?: string, // opaque cursor; pass via --cursor
25
+ has_more?: boolean, // true when more pages exist
26
+ }
27
+ },
28
+ data: T[], // payload — array or object depending on adapter
29
+ error: null,
30
+ next_actions: AgentNextAction[]
31
+ }
32
+
33
+ // Failure envelope
34
+ {
35
+ ok: false,
36
+ schema_version: "2",
37
+ command: "site.command",
38
+ meta: { duration_ms: number },
39
+ data: null,
40
+ error: {
41
+ code: string, // see error code table below
42
+ exit_code: number, // sysexits.h aligned
43
+ message: string, // human-readable
44
+ adapter_path?: string, // YAML file to repair (if applicable)
45
+ step: number, // pipeline step index that failed (0-based)
46
+ retryable: boolean, // true = retry after fix; false = args/config issue
47
+ suggestion: string, // what to do next
48
+ remedy?: {
49
+ message: string,
50
+ command?: string, // exact CLI command to run as remedy
51
+ deeplink?: string,
52
+ doc?: string
53
+ },
54
+ diff_candidate?: string, // suggested YAML diff for repair
55
+ minimum_capability?: string // e.g. "browser.cdp" — needed transport
56
+ },
57
+ next_actions: AgentNextAction[]
58
+ }
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Error Code Reference
64
+
65
+ ### Transport / network (5 codes)
66
+
67
+ | Code | Exit | Meaning | Action |
68
+ | ------------------- | ---- | ----------------------------------- | --------------------------------------- |
69
+ | `network_error` | 75 | TCP/TLS/DNS failure, timeout | Retry once; check connectivity |
70
+ | `rate_limited` | 75 | 429 or upstream quota | Wait and retry; reduce `--limit` |
71
+ | `upstream_error` | 75 | 5xx or malformed body from upstream | Retry; if persists load `unicli-repair` |
72
+ | `api_error` | 1 | 4xx non-auth error | Read `message` + `suggestion` |
73
+ | `not_authenticated` | 77 | Credentials expired or missing | `unicli auth setup <site>` |
74
+
75
+ ### Input / validation (3 codes)
76
+
77
+ | Code | Exit | Meaning | Action |
78
+ | --------------- | ---- | ------------------------------ | ---------------------------------------- |
79
+ | `invalid_input` | 2 | Arg failed validation | Fix args; `unicli describe <site> <cmd>` |
80
+ | `selector_miss` | 1 | CSS/XPath matched nothing | Load `unicli-repair` — selector changed |
81
+ | `not_found` | 66 | HTTP 404 or "no such resource" | Check the resource ID or URL |
82
+
83
+ ### Authorization (2 codes)
84
+
85
+ | Code | Exit | Meaning | Action |
86
+ | ------------------- | ---- | ----------------------------- | -------------------------------------- |
87
+ | `auth_required` | 77 | Missing cookie file | `unicli auth setup <site>` |
88
+ | `permission_denied` | 77 | Authenticated but lacks scope | Different account or check permissions |
89
+
90
+ ### Runtime (2 codes)
91
+
92
+ | Code | Exit | Meaning | Action |
93
+ | ---------------- | ---- | ----------------------------------- | --------------------------------------------------- |
94
+ | `internal_error` | 1 | Uncaught exception in unicli | Report to GitHub issues |
95
+ | `quarantined` | 1 | Adapter gated by `quarantine:` flag | `unicli repair --quarantined`; load `unicli-repair` |
96
+
97
+ ### Ref-locator (3 codes, browser mode only)
98
+
99
+ | Code | Exit | Meaning | Action |
100
+ | --------------- | ---- | -------------------------------------- | -------------------------------------------- |
101
+ | `stale_ref` | 1 | Browser snapshot ref detached from DOM | Re-run `unicli browser state` for fresh refs |
102
+ | `ambiguous` | 1 | Ref maps to multiple elements | Use a more specific `--css` selector |
103
+ | `ref_not_found` | 1 | Ref not in current snapshot | Re-run `unicli browser state` |
104
+
105
+ ---
106
+
107
+ ## next_actions — HATEOAS Navigation
108
+
109
+ `next_actions` are generated from the adapter schema. **Trust them** — they are not
110
+ suggested by an LLM but computed from the command's type, args, and response context.
111
+
112
+ ```json
113
+ "next_actions": [
114
+ {
115
+ "command": "unicli describe hackernews top",
116
+ "description": "Inspect the command's JSON schema, channels, and example payload"
117
+ },
118
+ {
119
+ "command": "unicli hackernews top --args-file <path.json>",
120
+ "description": "Re-run with a JSON payload from file",
121
+ "params": {
122
+ "path": {
123
+ "description": "Absolute path to a JSON object file with command args"
124
+ }
125
+ }
126
+ },
127
+ {
128
+ "command": "unicli hackernews top --cursor <next_cursor>",
129
+ "description": "Fetch next page",
130
+ "params": {
131
+ "next_cursor": {
132
+ "value": "eyJwIjoyLCJsIjoyNX0=",
133
+ "description": "Pagination cursor from current response"
134
+ }
135
+ }
136
+ }
137
+ ]
138
+ ```
139
+
140
+ `params[].value` pre-fills the value from the current response (e.g. the cursor).
141
+ `params[].enum` constrains valid choices. `params[].default` shows the implicit default.
142
+
143
+ ---
144
+
145
+ ## Output Format Comparison
146
+
147
+ | Format | Flag | Use case |
148
+ | --------- | ----------------- | ------------------------------------------------------- |
149
+ | `md` | default / `-f md` | Display to user; agent-native Markdown with frontmatter |
150
+ | `json` | `-f json` | Programmatic parsing with jq or code |
151
+ | `yaml` | `-f yaml` | Config-style output |
152
+ | `csv` | `-f csv` | Spreadsheet export; array data only |
153
+ | `compact` | `-f compact` | One row per line, `\|` separator; array data only |
154
+
155
+ `UNICLI_OUTPUT=json` environment variable sets `json` globally without per-call flags.
156
+
157
+ ---
158
+
159
+ ## Parsing Patterns
160
+
161
+ ### Extract titles
162
+
163
+ ```bash
164
+ unicli hackernews top -f json | jq '.data[].title'
165
+ ```
166
+
167
+ ### Filter by field value
168
+
169
+ ```bash
170
+ unicli xueqiu hot -f json | jq '.data[] | select(.change | tonumber > 5)'
171
+ ```
172
+
173
+ ### Extract nested field
174
+
175
+ ```bash
176
+ unicli bilibili hot -f json | jq '.data[] | {title: .title, view: .stat.view}'
177
+ ```
178
+
179
+ ### Pagination loop
180
+
181
+ ```bash
182
+ cursor=""
183
+ while true; do
184
+ result=$(unicli reddit hot --limit 25 ${cursor:+--cursor $cursor} -f json)
185
+ echo "$result" | jq '.data[].title'
186
+ cursor=$(echo "$result" | jq -r '.meta.pagination.next_cursor // empty')
187
+ has_more=$(echo "$result" | jq -r '.meta.pagination.has_more // false')
188
+ [ "$has_more" = "true" ] || break
189
+ done
190
+ ```
191
+
192
+ ### Check success before parsing
193
+
194
+ ```bash
195
+ result=$(unicli hackernews top -f json)
196
+ if echo "$result" | jq -e '.ok' >/dev/null 2>&1; then
197
+ echo "$result" | jq '.data[].title'
198
+ else
199
+ echo "Error: $(echo "$result" | jq -r '.error.message')"
200
+ echo "Action: $(echo "$result" | jq -r '.error.suggestion')"
201
+ fi
202
+ ```
203
+
204
+ ### Error-first pattern (recommended)
205
+
206
+ ```bash
207
+ unicli twitter search "AI agents" -f json | jq '
208
+ if .ok then
209
+ .data[] | {title: .text, author: .author}
210
+ else
211
+ "ERROR[\(.error.code)]: \(.error.message) → \(.error.suggestion)"
212
+ end
213
+ '
214
+ ```
215
+
216
+ ---
217
+
218
+ ## Surface Field
219
+
220
+ `meta.surface` indicates the access method used:
221
+
222
+ | Value | Meaning |
223
+ | --------- | --------------------------------------------- |
224
+ | `web` | HTTP/REST API call |
225
+ | `desktop` | Local app via AppleScript / Accessibility API |
226
+ | `system` | macOS system call |
227
+ | `mobile` | Mobile device bridge |
228
+
229
+ ---
230
+
231
+ ## Schema Version History
232
+
233
+ | Version | Since | Notes |
234
+ | ------- | ----------- | --------------------------------- |
235
+ | `2` | v0.215 | Current. All agent-facing output. |
236
+ | `1` | v0.1–v0.214 | Legacy. Removed in v0.215. |
237
+
238
+ v2 is the only version. If you see `schema_version: "1"` in output, upgrade unicli.
@@ -0,0 +1,259 @@
1
+ # Site Catalog — Uni-CLI 237 Sites
2
+
3
+ Load this file when you need to find which site to query. Organized by category.
4
+ All commands: `unicli list --site <site>` · Full search: `unicli search "<topic>"`.
5
+
6
+ ---
7
+
8
+ ## News & Tech Media
9
+
10
+ | Site | Key commands |
11
+ | ------------- | ----------------------------------------------------------------- |
12
+ | `hackernews` | `top`, `new`, `ask`, `show`, `jobs`, `search`, `comments`, `user` |
13
+ | `bbc` | `hot`, `tech`, `world`, `business` |
14
+ | `cnn` | `top`, `tech` |
15
+ | `nytimes` | `top`, `tech` |
16
+ | `reuters` | `top`, `tech` |
17
+ | `36kr` | `hot`, `new`, `recommend`, `search` |
18
+ | `ithome` | `hot`, `new`, `search` |
19
+ | `infoq` | `hot`, `new` |
20
+ | `v2ex` | `hot`, `top`, `new`, `tab` |
21
+ | `linux-do` | `hot`, `new` |
22
+ | `devto` | `hot`, `trending`, `new`, `search` |
23
+ | `lobsters` | `hot`, `new` |
24
+ | `lesswrong` | `hot`, `new`, `search`, many more |
25
+ | `producthunt` | `hot`, `top`, `search` |
26
+
27
+ ---
28
+
29
+ ## Social & Community
30
+
31
+ | Site | Key commands |
32
+ | ----------- | ------------------------------------------------- |
33
+ | `twitter` | `search`, `trending`, `user`, `timeline`, `likes` |
34
+ | `bluesky` | `trending`, `search`, `user`, `feed`, many more |
35
+ | `reddit` | `hot`, `new`, `top`, `search`, `subreddit` |
36
+ | `weibo` | `hot`, `trending`, `search`, `user` |
37
+ | `zhihu` | `hot`, `trending`, `search`, `question`, `answer` |
38
+ | `jike` | `hot`, `search`, `user`, `topic` |
39
+ | `instagram` | `feed`, `search`, `user`, `stories`, many more |
40
+ | `facebook` | `feed`, `search`, `groups`, many more |
41
+ | `tieba` | `hot`, `search`, `posts` |
42
+ | `threads` | `hot`, `search`, `user` |
43
+
44
+ ---
45
+
46
+ ## Video & Streaming
47
+
48
+ | Site | Key commands |
49
+ | ---------- | ------------------------------------------------------------------ |
50
+ | `bilibili` | `hot`, `trending`, `search`, `user`, `video`, `bangumi`, many more |
51
+ | `youtube` | `search`, `trending`, `channel`, `comments` |
52
+ | `tiktok` | `search`, `trending`, `user` |
53
+ | `douyin` | `hot`, `search`, `user` |
54
+ | `kuaishou` | `hot`, `search` |
55
+ | `douyu` | `hot`, `new` |
56
+ | `hupu` | `hot`, `new`, `search`, `match` |
57
+
58
+ ---
59
+
60
+ ## Finance & Markets
61
+
62
+ | Site | Key commands |
63
+ | --------------- | ----------------------------------------------- |
64
+ | `xueqiu` | `hot`, `hot-stock`, `search`, `quote`, `news` |
65
+ | `eastmoney` | `hot`, `news`, `fund`, `stock`, many more |
66
+ | `bloomberg` | `markets`, `latest`, `search`, `tech`, `asia` |
67
+ | `binance` | `hot`, `price`, `kline`, `orderbook`, many more |
68
+ | `barchart` | `hot`, `movers`, `futures`, `currencies` |
69
+ | `coinbase` | `price`, `markets` |
70
+ | `futu` | `hot`, `news` |
71
+ | `yahoo-finance` | `search`, `quote`, `news` |
72
+ | `exchangerate` | `rate`, `convert` |
73
+
74
+ ---
75
+
76
+ ## E-commerce & Shopping
77
+
78
+ | Site | Key commands |
79
+ | ---------- | ------------------------------------------------- |
80
+ | `amazon` | `search`, `hot`, `deals`, `categories`, many more |
81
+ | `jd` | `search`, `hot`, `deals`, `flash-sale`, many more |
82
+ | `taobao` | `search`, `hot`, `new` |
83
+ | `xianyu` | `search`, `hot` |
84
+ | `smzdm` | `hot`, `new`, `deal` |
85
+ | `dangdang` | `hot`, `search` |
86
+ | `coupang` | `hot`, `search` |
87
+ | `boss` | `search`, `hot`, `company`, many more |
88
+ | `51job` | `search`, `hot` |
89
+ | `linkedin` | `search`, `jobs`, `people` |
90
+ | `maimai` | `hot`, `search` |
91
+
92
+ ---
93
+
94
+ ## AI Platforms
95
+
96
+ | Site | Key commands |
97
+ | ----------- | ----------------------------------------------------- |
98
+ | `claude` | `chat`, `vision`, `summarize`, `translate`, many more |
99
+ | `chatgpt` | `chat`, `image`, `vision`, many more |
100
+ | `deepseek` | `chat`, `code`, many more |
101
+ | `gemini` | `chat`, `vision`, `search` |
102
+ | `doubao` | `chat`, `image`, many more |
103
+ | `grok` | `chat` |
104
+ | `hf` | `search`, `model`, `dataset`, `spaces` |
105
+ | `codex` | `run`, `chat`, `code`, many more |
106
+ | `hermes` | `run`, `list`, `search` |
107
+ | `autoagent` | `run` |
108
+
109
+ ---
110
+
111
+ ## Developer Tools & Code
112
+
113
+ | Site | Key commands |
114
+ | ----------------------- | ------------------------------------------ |
115
+ | `github-trending` | `daily`, `weekly`, `monthly` |
116
+ | `gh` | `pr`, `issue`, `repo`, `search`, many more |
117
+ | `gitee` | `hot`, `search`, `trending` |
118
+ | `gitlab` | `hot`, `search` |
119
+ | `docker-hub` | `search`, `hot` |
120
+ | `docker` | `ps`, `images`, `logs` |
121
+ | `hackernews` | `search` (dev content is strong here) |
122
+ | `crates-io` | `search`, `hot`, `new` |
123
+ | `cocoapods` | `search`, `info` |
124
+ | `npm` (via bridge `gh`) | use `gh` or `docker` bridges |
125
+
126
+ ---
127
+
128
+ ## Academic & Research
129
+
130
+ | Site | Key commands |
131
+ | -------------------- | ------------------------ |
132
+ | `arxiv` | `search`, `hot`, `paper` |
133
+ | `huggingface-papers` | `hot`, `new` |
134
+ | `google-scholar` | `search`, `author` |
135
+ | `baidu-scholar` | `search` |
136
+ | `cnki` | `search` |
137
+ | `semanticscholar` | (via MCP, not unicli) |
138
+
139
+ ---
140
+
141
+ ## Reading & Content
142
+
143
+ | Site | Key commands |
144
+ | ------------ | --------------------------------------------------- |
145
+ | `douban` | `hot`, `top250`, `search`, `book`, `movie`, `music` |
146
+ | `weread` | `ranking`, `hot`, `new` |
147
+ | `wikipedia` | `search`, `article` |
148
+ | `dictionary` | `define`, `translate`, `synonym` |
149
+ | `itch-io` | `hot`, `new`, `search` |
150
+
151
+ ---
152
+
153
+ ## Travel & Lifestyle
154
+
155
+ | Site | Key commands |
156
+ | ---------- | -------------------------- |
157
+ | `ctrip` | `hot`, `search` |
158
+ | `dianping` | `hot`, `search` |
159
+ | `ele` | `hot`, `search` |
160
+ | `ke` | `search`, `hot`, many more |
161
+ | `band` | `hot`, `events` |
162
+
163
+ ---
164
+
165
+ ## Desktop Apps (macOS)
166
+
167
+ ### Productivity
168
+
169
+ | Site | Key commands |
170
+ | ---------------- | --------------------------------- |
171
+ | `cursor` | `open`, `edit`, `run`, many more |
172
+ | `chatwise` | `chat`, `create`, many more |
173
+ | `evernote-app` | `search`, `note`, many more |
174
+ | `apple-notes` | `search`, `create`, `list` |
175
+ | `apple-podcasts` | `search`, `play` |
176
+ | `insomnia` | `request`, `workspace`, many more |
177
+
178
+ ### Creative
179
+
180
+ | Site | Key commands |
181
+ | ------------- | -------------------------------------- |
182
+ | `blender` | `render`, `info`, `script`, many more |
183
+ | `gimp` | `open`, `resize`, `export`, many more |
184
+ | `figma` | `export`, `pages`, many more |
185
+ | `inkscape` | `export`, `info` |
186
+ | `krita` | `open`, `export`, many more |
187
+ | `kdenlive` | `render`, `export` |
188
+ | `imagemagick` | `resize`, `convert`, `info`, many more |
189
+
190
+ ### Development
191
+
192
+ | Site | Key commands |
193
+ | ---------------- | ------------------------------------- |
194
+ | `github-desktop` | `status`, `commit`, `push`, many more |
195
+ | `gitkraken` | `status`, `branch`, many more |
196
+
197
+ ### Communication
198
+
199
+ | Site | Key commands |
200
+ | ------------- | ------------------------------------- |
201
+ | `discord-app` | `send`, `read`, `channels`, many more |
202
+ | `imessage` | `send`, `read`, `search` |
203
+ | `dingtalk` | `send`, `read`, many more |
204
+ | `feishu` | `send`, `read`, many more |
205
+ | `lark` | `send`, `read`, many more |
206
+
207
+ ---
208
+
209
+ ## Local & System Services
210
+
211
+ | Site | Key commands |
212
+ | ------------- | ------------------------------------------------------- |
213
+ | `macos` | `volume`, `brightness`, `screenshot`, `wifi`, many more |
214
+ | `ffmpeg` | `compress`, `convert`, `info`, many more |
215
+ | `jq` | `filter`, `format` |
216
+ | `homebrew` | `install`, `search` |
217
+ | `comfyui` | `generate`, `workflow`, many more |
218
+ | `ollama` | (via service adapter) |
219
+ | `adguardhome` | `status`, `filter`, many more |
220
+ | `bitwarden` | `get`, `list`, many more |
221
+
222
+ ---
223
+
224
+ ## Cloud & Infrastructure
225
+
226
+ | Site | Key commands |
227
+ | -------- | ---------------------------- |
228
+ | `aws` | `run` (bridge to aws CLI) |
229
+ | `az` | `run` (bridge to az CLI) |
230
+ | `gcloud` | `run` (bridge to gcloud CLI) |
231
+ | `doctl` | `run` (bridge to doctl) |
232
+ | `flyctl` | `run` (bridge to fly CLI) |
233
+
234
+ ---
235
+
236
+ ## Chinese Platforms (Specialty)
237
+
238
+ | Site | Key commands |
239
+ | ------------- | ---------------------------- |
240
+ | `1688` | `search`, `hot`, many more |
241
+ | `chaoxing` | `courses`, `search` |
242
+ | `jianyu` | `search`, `hot` |
243
+ | `juejin` | `hot`, `trending` |
244
+ | `gov-law` | `search`, `hot` |
245
+ | `gov-policy` | `search`, `latest` |
246
+ | `jimeng` | `generate`, `hot`, many more |
247
+ | `antigravity` | many commands |
248
+
249
+ ---
250
+
251
+ ## Discover More
252
+
253
+ ```bash
254
+ unicli list # full list, 3,319 commands
255
+ unicli search "<topic>" # semantic search
256
+ unicli list --type desktop # 2,068 desktop app commands
257
+ unicli list --type service # 43 local service commands
258
+ unicli list --quarantined # adapters needing repair
259
+ ```
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: unicli-browser
3
+ description: >
4
+ Control browser automation sessions via unicli. The browser command now owns
5
+ lifecycle, interaction, introspection, and daemon diagnostics.
6
+ version: 1.0.0
7
+ triggers:
8
+ - "browser automation"
9
+ - "control chrome"
10
+ - "unicli browser"
11
+ - "launch chrome"
12
+ allowed-tools: [Bash]
13
+ protocol: 2.0
14
+ ---
15
+
16
+ ## When to Use
17
+
18
+ Use `unicli browser` for both browser lifecycle and direct page interaction.
19
+ `unicli operate` still exists, but it is now a compatibility alias over the same implementation.
20
+
21
+ ## Quick Start
22
+
23
+ ```bash
24
+ unicli browser start # Launch Chrome with CDP
25
+ unicli browser status # Check CDP + daemon/session status
26
+ unicli browser open <url> # Navigate to a page
27
+ unicli browser state # DOM accessibility tree with [ref] numbers
28
+ unicli browser screenshot # Visual capture to file
29
+ unicli browser find --css ... # Structured DOM query + ref allocation
30
+ unicli browser extract # Chunked long-form text extraction
31
+ ```
32
+
33
+ ## Browser Lifecycle
34
+
35
+ ```bash
36
+ unicli browser start # Spawn Chrome + daemon (port 19825)
37
+ unicli browser status # Connection health check
38
+ unicli daemon status # Daemon process info
39
+ unicli daemon stop # Stop daemon
40
+ unicli daemon restart # Restart daemon
41
+ ```
42
+
43
+ The daemon auto-exits after idle timeout. Chrome reuses your existing login sessions.
44
+
45
+ ## Authentication
46
+
47
+ ```bash
48
+ unicli auth setup <site> # Show required cookies + file template
49
+ unicli auth check <site> # Validate cookie file
50
+ unicli auth list # List configured sites
51
+ ```
52
+
53
+ Cookie files: `~/.unicli/cookies/<site>.json` with format `{ "KEY": "value" }`.
54
+
55
+ ## Strategies Requiring Browser
56
+
57
+ | Strategy | How it works |
58
+ | ----------- | ---------------------------------------------- |
59
+ | `cookie` | Injects cookies from file into request headers |
60
+ | `header` | Cookie + auto-extracted CSRF token |
61
+ | `intercept` | Navigate page, capture XHR/fetch responses |
62
+ | `ui` | Interact with page DOM (click, type, scroll) |
63
+
64
+ `public` strategy does NOT need a browser.
65
+
66
+ ## Architecture
67
+
68
+ There are two browser paths:
69
+
70
+ 1. `browser start` / `browser cookies` use local Chrome + CDP directly.
71
+ 2. `browser open/state/click/...` use:
72
+ CLI -> daemon-client -> HTTP/WS -> daemon -> Browser Bridge extension -> Chrome tabs
73
+
74
+ That means extension state, daemon port, workspace, focus/background mode, and tab binding are all part of the real runtime story.
75
+
76
+ Useful controls:
77
+
78
+ ```bash
79
+ unicli browser --daemon-port 19826 sessions
80
+ unicli browser --workspace profile-a bind --match-domain example.com
81
+ unicli browser --isolated open https://example.com
82
+ unicli browser --background open https://example.com
83
+ ```
84
+
85
+ ## Diagnostics
86
+
87
+ ```bash
88
+ unicli doctor # Full system health check
89
+ UNICLI_DIAGNOSTIC=1 unicli <site> <cmd> # Enhanced error context
90
+ ```
91
+
92
+ ## Troubleshooting
93
+
94
+ | Problem | Fix |
95
+ | ----------------------- | ------------------------------------- |
96
+ | "Browser not connected" | `unicli browser start` |
97
+ | Exit 69 (unavailable) | `unicli browser start` then retry |
98
+ | Exit 77 (auth) | `unicli auth setup <site>` then retry |
99
+ | CDP connection dropped | `unicli daemon restart` |