@zenalexa/unicli 0.223.0 → 0.223.2
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 +24 -1
- package/README.md +16 -5
- package/README.zh-CN.md +2 -2
- package/dist/browser/auth-sync.d.ts +32 -0
- package/dist/browser/auth-sync.d.ts.map +1 -0
- package/dist/browser/auth-sync.js +119 -0
- package/dist/browser/auth-sync.js.map +1 -0
- package/dist/browser/bridge.d.ts +2 -0
- package/dist/browser/bridge.d.ts.map +1 -1
- package/dist/browser/bridge.js +4 -3
- package/dist/browser/bridge.js.map +1 -1
- package/dist/browser/cdp-client.d.ts +5 -0
- package/dist/browser/cdp-client.d.ts.map +1 -1
- package/dist/browser/cdp-client.js +18 -3
- package/dist/browser/cdp-client.js.map +1 -1
- package/dist/browser/chrome-policy.d.ts +38 -0
- package/dist/browser/chrome-policy.d.ts.map +1 -0
- package/dist/browser/chrome-policy.js +261 -0
- package/dist/browser/chrome-policy.js.map +1 -0
- package/dist/browser/daemon-client.d.ts +3 -0
- package/dist/browser/daemon-client.d.ts.map +1 -1
- package/dist/browser/daemon-client.js +13 -15
- package/dist/browser/daemon-client.js.map +1 -1
- package/dist/browser/doctor.d.ts +147 -0
- package/dist/browser/doctor.d.ts.map +1 -0
- package/dist/browser/doctor.js +784 -0
- package/dist/browser/doctor.js.map +1 -0
- package/dist/browser/launcher.d.ts +17 -8
- package/dist/browser/launcher.d.ts.map +1 -1
- package/dist/browser/launcher.js +51 -11
- package/dist/browser/launcher.js.map +1 -1
- package/dist/browser/local-profiles.d.ts +55 -0
- package/dist/browser/local-profiles.d.ts.map +1 -0
- package/dist/browser/local-profiles.js +333 -0
- package/dist/browser/local-profiles.js.map +1 -0
- package/dist/commands/browser/index.d.ts +2 -2
- package/dist/commands/browser/index.d.ts.map +1 -1
- package/dist/commands/browser/index.js +195 -14
- package/dist/commands/browser/index.js.map +1 -1
- package/dist/engine/executor.d.ts +6 -1
- package/dist/engine/executor.d.ts.map +1 -1
- package/dist/engine/executor.js +2 -0
- package/dist/engine/executor.js.map +1 -1
- package/dist/engine/kernel/stages.d.ts.map +1 -1
- package/dist/engine/kernel/stages.js +4 -0
- package/dist/engine/kernel/stages.js.map +1 -1
- package/dist/engine/steps/browser-helpers.d.ts.map +1 -1
- package/dist/engine/steps/browser-helpers.js +29 -1
- package/dist/engine/steps/browser-helpers.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/docs/operate/focus-behavior.md +25 -0
- package/package.json +1 -1
- package/server.json +2 -2
- package/skills/unicli/SKILL.md +54 -38
- package/skills/unicli-browser/SKILL.md +56 -10
- package/skills/unicli-claude-code/SKILL.md +1 -1
- package/skills/unicli-hermes/SKILL.md +1 -1
- package/skills/unicli-operate/SKILL.md +1 -1
- package/skills/unicli-smart-search/SKILL.md +7 -5
- package/skills/unicli-usage/SKILL.md +39 -1
- package/src/hub/external-clis.yaml +6 -0
|
@@ -54,6 +54,7 @@ export async function acquirePage(ctx) {
|
|
|
54
54
|
const { injectStealth } = await import("../../browser/stealth.js");
|
|
55
55
|
const page = await BP.connect(port);
|
|
56
56
|
await injectStealth(page.sendCDP.bind(page));
|
|
57
|
+
await syncUserSessionCookies(page, ctx);
|
|
57
58
|
return page;
|
|
58
59
|
}
|
|
59
60
|
catch {
|
|
@@ -63,7 +64,7 @@ export async function acquirePage(ctx) {
|
|
|
63
64
|
const { launchChrome } = await import("../../browser/launcher.js");
|
|
64
65
|
const { BrowserPage: BP } = await import("../../browser/page.js");
|
|
65
66
|
const { injectStealth } = await import("../../browser/stealth.js");
|
|
66
|
-
await launchChrome(port);
|
|
67
|
+
await launchChrome(port, await launchOptionsForContext(ctx));
|
|
67
68
|
let page;
|
|
68
69
|
for (let attempt = 0; attempt < 5; attempt++) {
|
|
69
70
|
try {
|
|
@@ -78,12 +79,39 @@ export async function acquirePage(ctx) {
|
|
|
78
79
|
if (!page)
|
|
79
80
|
throw new Error("Chrome launched but no page target available");
|
|
80
81
|
await injectStealth(page.sendCDP.bind(page));
|
|
82
|
+
await syncUserSessionCookies(page, ctx);
|
|
81
83
|
return page;
|
|
82
84
|
}
|
|
83
85
|
catch (err) {
|
|
84
86
|
throw new Error(`Cannot connect to Chrome. Run "unicli browser start" first. (${err instanceof Error ? err.message : String(err)})`);
|
|
85
87
|
}
|
|
86
88
|
}
|
|
89
|
+
async function launchOptionsForContext(ctx) {
|
|
90
|
+
if (ctx.browserSession !== "user")
|
|
91
|
+
return undefined;
|
|
92
|
+
const { automationUserDataDirForProfile, resolvePreferredLocalBrowserProfile, } = await import("../../browser/local-profiles.js");
|
|
93
|
+
const profile = resolvePreferredLocalBrowserProfile();
|
|
94
|
+
if (!profile)
|
|
95
|
+
return undefined;
|
|
96
|
+
return {
|
|
97
|
+
...(profile.browser_path_exists
|
|
98
|
+
? { browserPath: profile.browser_path }
|
|
99
|
+
: {}),
|
|
100
|
+
userDataDir: automationUserDataDirForProfile(profile),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
async function syncUserSessionCookies(page, ctx) {
|
|
104
|
+
if (ctx.browserSession !== "user")
|
|
105
|
+
return;
|
|
106
|
+
const { syncLocalProfileCookiesToPage } = await import("../../browser/auth-sync.js");
|
|
107
|
+
const sync = await syncLocalProfileCookiesToPage(page, {
|
|
108
|
+
site: ctx.site,
|
|
109
|
+
domain: ctx.domain,
|
|
110
|
+
});
|
|
111
|
+
if (sync.status === "failed") {
|
|
112
|
+
throw new Error(`Failed to bootstrap browser cookies for ${ctx.domain ?? ctx.site ?? "site"}: ${sync.reason}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
87
115
|
/**
|
|
88
116
|
* Wait until no new network requests occur for quietMs.
|
|
89
117
|
* Uses polling — checks page.networkRequests() count stability.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-helpers.js","sourceRoot":"","sources":["../../../src/engine/steps/browser-helpers.ts"],"names":[],"mappings":"AAGA,KAAK,UAAU,iBAAiB,CAAC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AAY,CAAC;YACzB,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC3B,CAAC;aAAM,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,WAAW,IAAI,OAAO,EAAE,CAAC;YAC/C,OAAO;QACT,CAAC;QAED,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC"}
|
package/dist/manifest.json
CHANGED
|
@@ -5,6 +5,15 @@ verbs. Use `--focus` or `focus: true` only when the target app must be brought
|
|
|
5
5
|
forward before the action can succeed. The visual fallback is treated as
|
|
6
6
|
focus-taking when the cascade reaches it.
|
|
7
7
|
|
|
8
|
+
The browser bridge follows the same rule. Daemon commands send
|
|
9
|
+
`windowFocused: false` by default, extension session/doctor probes are
|
|
10
|
+
read-only and must not create `about:blank` placeholder tabs, and headed local
|
|
11
|
+
Chrome launches use `--no-startup-window` unless the caller explicitly opts
|
|
12
|
+
into foreground startup with `unicli browser --focus start`. Chrome/CDP
|
|
13
|
+
launches use Uni-CLI-owned automation profiles under `~/.unicli/`; logged-in
|
|
14
|
+
state is reused by importing cookies from the selected local browser profile
|
|
15
|
+
instead of launching CDP against Chrome's default user-data-dir.
|
|
16
|
+
|
|
8
17
|
## Defaults
|
|
9
18
|
|
|
10
19
|
| Verb | desktop-ax (macOS) | desktop-uia (Windows) | desktop-atspi (Linux) | cdp-browser | visual fallback |
|
|
@@ -20,6 +29,22 @@ focus-taking when the cascade reaches it.
|
|
|
20
29
|
- `compute click`, `compute type`, `compute press`, and `compute scroll` pass
|
|
21
30
|
`focus: false` to AX, UIA, AT-SPI, and CDP unless the caller sets `--focus`
|
|
22
31
|
or `focus: true`.
|
|
32
|
+
- `browser open`, `browser state`, `browser click`, `browser type`,
|
|
33
|
+
`browser screenshot`, and daemon-backed browser commands pass
|
|
34
|
+
`windowFocused: false` unless `--focus` or `UNICLI_WINDOW_FOCUSED=1` is set.
|
|
35
|
+
`browser doctor` and `browser sessions` inspect existing sessions without
|
|
36
|
+
allocating a placeholder window.
|
|
37
|
+
- Chrome 136+ disables remote debugging for the browser's default
|
|
38
|
+
user-data-dir. Treat a process with `--remote-debugging-port` but no listening
|
|
39
|
+
port as a default-profile launch defect, not a retryable CDP race. The
|
|
40
|
+
correct repair is an automation profile plus cookie import from
|
|
41
|
+
`unicli browser profiles --json`. `unicli browser doctor --json` reports this
|
|
42
|
+
as the `default profile CDP trap` check, and `unicli browser doctor --repair`
|
|
43
|
+
starts the safe Uni-CLI automation CDP profile when needed. The
|
|
44
|
+
`chrome_remote_debugging` section also reports `RemoteDebuggingAllowed`:
|
|
45
|
+
`false` blocks every local CDP path until the managed Chrome policy is
|
|
46
|
+
removed or set true, while `true` still does not bypass the Chrome 136+
|
|
47
|
+
default-directory restriction.
|
|
23
48
|
- macOS background input is not a global HID path. It resolves a running app
|
|
24
49
|
and on-screen window, installs per-process event taps for the previous and
|
|
25
50
|
target apps, sends an AppKit activation primer plus a center primer only when
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenalexa/unicli",
|
|
3
|
-
"version": "0.223.
|
|
3
|
+
"version": "0.223.2",
|
|
4
4
|
"description": "Operations substrate for agents that use real software: web, browsers, desktop apps, local tools, MCP, policy, evidence, and self-repair.",
|
|
5
5
|
"packageManager": "npm@11.14.0",
|
|
6
6
|
"type": "module",
|
package/server.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-29/server.schema.json",
|
|
3
3
|
"name": "io.github.olo-dot-io/Uni-CLI",
|
|
4
4
|
"description": "Self-repairing CLI catalog that exposes 282 websites, desktop apps, and external CLIs as one MCP server. 949 declarative YAML adapters and 1686 commands; structured error envelopes let agents fix failing adapters at runtime and retry.",
|
|
5
|
-
"version": "0.223.
|
|
5
|
+
"version": "0.223.2",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "https://github.com/olo-dot-io/Uni-CLI",
|
|
8
8
|
"source": "github"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
15
15
|
"identifier": "@zenalexa/unicli",
|
|
16
|
-
"version": "0.223.
|
|
16
|
+
"version": "0.223.2",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
},
|
package/skills/unicli/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: unicli
|
|
|
3
3
|
description: >
|
|
4
4
|
Comprehensive guide to using Uni-CLI — the universal CLI for AI agents.
|
|
5
5
|
Trigger when the user needs to fetch data from websites (Twitter, Bilibili,
|
|
6
|
-
HackerNews, GitHub, Reddit, Bloomberg, Zhihu, WeChat, and
|
|
6
|
+
HackerNews, GitHub, Reddit, Bloomberg, Zhihu, WeChat, and hundreds more);
|
|
7
7
|
interact with news, finance, social, academic, shopping, or video platforms;
|
|
8
8
|
control macOS desktop apps (Blender, GIMP, Figma, VS Code, Cursor, Terminal,
|
|
9
9
|
Discord, Slack, etc.) via AppleScript or Accessibility API; automate browser
|
|
@@ -11,7 +11,7 @@ description: >
|
|
|
11
11
|
major platform; run desktop workflows or system tasks; or when the user says
|
|
12
12
|
"unicli", "scrape", "fetch from", "get trending", "check [site]", "find on
|
|
13
13
|
[platform]", "获取", "查询", "抓取".
|
|
14
|
-
version: 0.223.
|
|
14
|
+
version: 0.223.2
|
|
15
15
|
category: core
|
|
16
16
|
depends-on:
|
|
17
17
|
- talk-normal
|
|
@@ -39,10 +39,12 @@ triggers:
|
|
|
39
39
|
|
|
40
40
|
# Uni-CLI — Agent Usage Guide
|
|
41
41
|
|
|
42
|
-
unicli
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
unicli is the default structured substrate before raw browser automation, legacy
|
|
43
|
+
OpenCLI, curl, or computer-use. It covers websites, logged-in browser sessions,
|
|
44
|
+
desktop apps, macOS system state, local tools, external CLIs, and MCP surfaces
|
|
45
|
+
through deterministic commands. Commands emit a v2 AgentEnvelope; when a command
|
|
46
|
+
breaks, read the structured error and run the repair path instead of inventing a
|
|
47
|
+
one-off workaround.
|
|
46
48
|
|
|
47
49
|
**Install** (once): `npm install -g @zenalexa/unicli`
|
|
48
50
|
|
|
@@ -51,7 +53,8 @@ error, edit the YAML adapter, and it stays fixed for all future calls.
|
|
|
51
53
|
## Five-Command Quick Start
|
|
52
54
|
|
|
53
55
|
```bash
|
|
54
|
-
unicli
|
|
56
|
+
unicli search "intent" # discover the right command
|
|
57
|
+
unicli list # browse all commands
|
|
55
58
|
unicli list --site hackernews # commands for one site
|
|
56
59
|
unicli hackernews top --limit 5 # run a command
|
|
57
60
|
unicli hackernews top --limit 5 -f json # machine-readable JSON envelope
|
|
@@ -64,26 +67,21 @@ unicli describe hackernews top # full schema + example payload
|
|
|
64
67
|
|
|
65
68
|
### Find by site
|
|
66
69
|
|
|
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
70
|
```bash
|
|
75
71
|
unicli search "trending" # semantic search across all commands
|
|
76
72
|
unicli search "hot stock" # natural language
|
|
73
|
+
unicli list --site <site> # all commands for a site
|
|
74
|
+
unicli describe <site> <command> # args, output columns, example
|
|
77
75
|
```
|
|
78
76
|
|
|
79
77
|
### Browse by type
|
|
80
78
|
|
|
81
79
|
```bash
|
|
82
|
-
unicli list --type web-api # REST API adapters
|
|
83
|
-
unicli list --type desktop # desktop app control
|
|
84
|
-
unicli list --type browser # browser automation
|
|
85
|
-
unicli list --type service # local/remote services
|
|
86
|
-
unicli list --type bridge # passthrough CLI bridges
|
|
80
|
+
unicli list --type web-api # REST API adapters
|
|
81
|
+
unicli list --type desktop # desktop app control
|
|
82
|
+
unicli list --type browser # browser automation
|
|
83
|
+
unicli list --type service # local/remote services
|
|
84
|
+
unicli list --type bridge # passthrough CLI bridges
|
|
87
85
|
```
|
|
88
86
|
|
|
89
87
|
### Check if a site exists
|
|
@@ -153,7 +151,7 @@ unicli reddit hot --limit 25 --cursor <token> -f json
|
|
|
153
151
|
## Step 3 — Read the Output
|
|
154
152
|
|
|
155
153
|
Every command emits a **v2 AgentEnvelope**. Learn the shape once; it applies to
|
|
156
|
-
|
|
154
|
+
every command.
|
|
157
155
|
|
|
158
156
|
### JSON structure
|
|
159
157
|
|
|
@@ -212,13 +210,23 @@ automatically.
|
|
|
212
210
|
|
|
213
211
|
### Strategy ladder
|
|
214
212
|
|
|
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
|
|
221
|
-
| `ui` | Browser + interaction | Same; unicli clicks through login flow
|
|
213
|
+
| Strategy | Auth needed | How to set up |
|
|
214
|
+
| ----------- | --------------------- | ----------------------------------------------------------------------------------- |
|
|
215
|
+
| `public` | None | Works out of the box |
|
|
216
|
+
| `cookie` | Browser login | `unicli auth setup <site>` → log in once in browser |
|
|
217
|
+
| `header` | Cookie + CSRF | Same as `cookie`; auto-extracted per request |
|
|
218
|
+
| `intercept` | Browser session | `unicli browser doctor --repair` then `unicli auth import <site> --domain <domain>` |
|
|
219
|
+
| `ui` | Browser + interaction | Same; unicli clicks through login flow |
|
|
220
|
+
|
|
221
|
+
For robust logged-in reuse, prefer the explicit current browser paths:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
unicli browser profiles --json
|
|
225
|
+
unicli auth import <site> --domain <domain>
|
|
226
|
+
unicli browser cookies <domain> --profile-id <id>
|
|
227
|
+
unicli browser doctor --json
|
|
228
|
+
unicli browser doctor --repair
|
|
229
|
+
```
|
|
222
230
|
|
|
223
231
|
### Auth setup workflow
|
|
224
232
|
|
|
@@ -245,16 +253,16 @@ directly; use `unicli auth`.
|
|
|
245
253
|
|
|
246
254
|
### Exit code → action (primary decision tree)
|
|
247
255
|
|
|
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
|
|
255
|
-
| 75 | Temp failure / timeout | Retry once; if persists → load `unicli-repair`
|
|
256
|
-
| 77 | Auth required | `unicli auth
|
|
257
|
-
| 78 | Config error | Read `error.suggestion`; check `~/.unicli/` config
|
|
256
|
+
| Code | Meaning | Action |
|
|
257
|
+
| ---- | ---------------------- | ------------------------------------------------------ |
|
|
258
|
+
| 0 | Success | Read `data` |
|
|
259
|
+
| 1 | Generic error | Read `error.reason` + `error.suggestion` |
|
|
260
|
+
| 2 | Usage error | Fix arg syntax; run `unicli describe <site> <cmd>` |
|
|
261
|
+
| 66 | Empty result | Try different query terms or `--limit` |
|
|
262
|
+
| 69 | Service unavailable | `unicli browser doctor --json`, then `doctor --repair` |
|
|
263
|
+
| 75 | Temp failure / timeout | Retry once; if persists → load `unicli-repair` |
|
|
264
|
+
| 77 | Auth required | `unicli auth import` or explicit browser cookies |
|
|
265
|
+
| 78 | Config error | Read `error.suggestion`; check `~/.unicli/` config |
|
|
258
266
|
|
|
259
267
|
### Failure envelope fields
|
|
260
268
|
|
|
@@ -293,7 +301,10 @@ Use browser mode when: a site requires JavaScript rendering, login-gated access,
|
|
|
293
301
|
interaction (click/type/scroll), or the API adapter returns exit 69.
|
|
294
302
|
|
|
295
303
|
```bash
|
|
296
|
-
unicli browser
|
|
304
|
+
unicli browser doctor --json # read default_path/checks/self_repair
|
|
305
|
+
unicli browser doctor --repair # safe local CDP self-repair
|
|
306
|
+
unicli browser start # launch Chrome with CDP without foreground startup
|
|
307
|
+
unicli browser --focus start # opt into foreground only for interactive login
|
|
297
308
|
unicli browser status # confirm CDP is alive + session state
|
|
298
309
|
unicli browser open <url> # navigate to page
|
|
299
310
|
unicli browser state # DOM accessibility tree with [ref] IDs
|
|
@@ -306,6 +317,11 @@ unicli browser screenshot # capture to file
|
|
|
306
317
|
|
|
307
318
|
For a guided browser automation workflow, load skill `unicli-browser`.
|
|
308
319
|
|
|
320
|
+
Browser commands are background-first on macOS and desktop systems:
|
|
321
|
+
daemon-backed commands send `windowFocused: false` by default, doctor/session
|
|
322
|
+
probes do not allocate `about:blank` placeholder tabs, and local headed Chrome
|
|
323
|
+
startup uses `--no-startup-window` unless `--focus` is explicit.
|
|
324
|
+
|
|
309
325
|
---
|
|
310
326
|
|
|
311
327
|
## Composition Patterns
|
|
@@ -21,8 +21,12 @@ Use `unicli browser` for both browser lifecycle and direct page interaction.
|
|
|
21
21
|
## Quick Start
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
unicli browser start # Launch Chrome with CDP
|
|
24
|
+
unicli browser start # Launch Chrome with CDP without a foreground startup window
|
|
25
|
+
unicli browser doctor --repair # Safe repair: start Uni-CLI automation CDP if needed
|
|
26
|
+
unicli browser --focus start # Foreground only for explicit interactive login
|
|
25
27
|
unicli browser status # Check CDP + daemon/session status
|
|
28
|
+
unicli browser doctor --json # Machine-readable reliability report
|
|
29
|
+
unicli browser profiles --json # Discover local logged-in profiles
|
|
26
30
|
unicli browser open <url> # Navigate to a page
|
|
27
31
|
unicli browser state # DOM accessibility tree with [ref] numbers
|
|
28
32
|
unicli browser screenshot # Visual capture to file
|
|
@@ -33,25 +37,50 @@ unicli browser extract # Chunked long-form text extraction
|
|
|
33
37
|
## Browser Lifecycle
|
|
34
38
|
|
|
35
39
|
```bash
|
|
36
|
-
unicli browser start # Spawn Chrome + daemon
|
|
40
|
+
unicli browser start # Spawn Chrome + daemon in background-safe mode
|
|
41
|
+
unicli browser doctor --repair # Safe self-repair for local automation CDP
|
|
42
|
+
unicli browser --focus start # Opt into a foreground startup window
|
|
37
43
|
unicli browser status # Connection health check
|
|
38
44
|
unicli daemon status # Daemon process info
|
|
39
45
|
unicli daemon stop # Stop daemon
|
|
40
46
|
unicli daemon restart # Restart daemon
|
|
41
47
|
```
|
|
42
48
|
|
|
43
|
-
The daemon auto-exits after idle timeout. Chrome
|
|
49
|
+
The daemon auto-exits after idle timeout. Chrome/CDP uses Uni-CLI-owned
|
|
50
|
+
automation profiles under `~/.unicli/` rather than the browser's default
|
|
51
|
+
user-data-dir. Logged-in state is reused by importing cookies from the selected
|
|
52
|
+
local profile into the automation profile. Browser commands default to
|
|
53
|
+
`windowFocused: false`; use `--focus` only when a real interactive login step
|
|
54
|
+
must bring Chrome forward.
|
|
44
55
|
|
|
45
56
|
## Authentication
|
|
46
57
|
|
|
47
58
|
```bash
|
|
48
59
|
unicli auth setup <site> # Show required cookies + file template
|
|
60
|
+
unicli auth import <site> --domain <domain> # Direct import from local browser DB
|
|
61
|
+
unicli browser profiles --json # Pick a logged-in Chrome/Arc/Brave/Edge profile
|
|
62
|
+
unicli browser cookies <domain> --profile-id <id> # Explicit cookie export
|
|
49
63
|
unicli auth check <site> # Validate cookie file
|
|
50
64
|
unicli auth list # List configured sites
|
|
51
65
|
```
|
|
52
66
|
|
|
53
67
|
Cookie files: `~/.unicli/cookies/<site>.json` with format `{ "KEY": "value" }`.
|
|
54
68
|
|
|
69
|
+
Chrome 136+ blocks remote debugging when Chrome is launched against its default
|
|
70
|
+
profile directory. Do not tell users to run CDP on
|
|
71
|
+
`~/Library/Application Support/Google/Chrome` or equivalent, and do not suggest
|
|
72
|
+
unstable feature-flag bypasses. `RemoteDebuggingAllowed=false` in
|
|
73
|
+
`chrome://policy` blocks local CDP entirely; removing that managed policy or
|
|
74
|
+
setting it true is a user/admin action. Even when the policy is true, it does
|
|
75
|
+
not make default-profile CDP supported again. Use the automation profile plus
|
|
76
|
+
cookie import path instead:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
unicli browser profiles --json
|
|
80
|
+
unicli auth import twitter --domain x.com
|
|
81
|
+
unicli twitter trending -f json
|
|
82
|
+
```
|
|
83
|
+
|
|
55
84
|
## Strategies Requiring Browser
|
|
56
85
|
|
|
57
86
|
| Strategy | How it works |
|
|
@@ -67,7 +96,9 @@ Cookie files: `~/.unicli/cookies/<site>.json` with format `{ "KEY": "value" }`.
|
|
|
67
96
|
|
|
68
97
|
There are two browser paths:
|
|
69
98
|
|
|
70
|
-
1. `browser start`
|
|
99
|
+
1. `browser start` uses local Chrome + CDP with a Uni-CLI automation profile.
|
|
100
|
+
`browser cookies` first tries direct local profile cookie import, then only
|
|
101
|
+
reuses a recorded CDP port if that port is already live.
|
|
71
102
|
2. `browser open/state/click/...` use:
|
|
72
103
|
CLI -> daemon-client -> HTTP/WS -> daemon -> Browser Bridge extension -> Chrome tabs
|
|
73
104
|
|
|
@@ -82,6 +113,21 @@ unicli browser --isolated open https://example.com
|
|
|
82
113
|
unicli browser --background open https://example.com
|
|
83
114
|
```
|
|
84
115
|
|
|
116
|
+
`unicli browser doctor --json` and `unicli browser sessions` are read-only
|
|
117
|
+
probes: they inspect daemon/session state without allocating an `about:blank`
|
|
118
|
+
placeholder tab.
|
|
119
|
+
|
|
120
|
+
The doctor report is the routing source of truth for agents:
|
|
121
|
+
|
|
122
|
+
- `default_path`: whether a command can run now, and which runtime mode will
|
|
123
|
+
carry it (`local-cdp-automation-profile`, `remote-cdp`, or daemon extension).
|
|
124
|
+
- `chrome_remote_debugging`: official Chrome 136+ default-directory truth and
|
|
125
|
+
`RemoteDebuggingAllowed` policy state.
|
|
126
|
+
- `checks[*].next_step`: exact next command for each missing capability.
|
|
127
|
+
- `self_repair.safe_command`: safe automated repair. Today this is
|
|
128
|
+
`unicli browser doctor --repair`, which starts only Uni-CLI's automation CDP
|
|
129
|
+
profile and never launches CDP against the user's default Chrome profile.
|
|
130
|
+
|
|
85
131
|
## Diagnostics
|
|
86
132
|
|
|
87
133
|
```bash
|
|
@@ -91,9 +137,9 @@ UNICLI_DIAGNOSTIC=1 unicli <site> <cmd> # Enhanced error context
|
|
|
91
137
|
|
|
92
138
|
## Troubleshooting
|
|
93
139
|
|
|
94
|
-
| Problem | Fix
|
|
95
|
-
| ----------------------- |
|
|
96
|
-
| "Browser not connected" | `unicli browser
|
|
97
|
-
| Exit 69 (unavailable) | `unicli browser
|
|
98
|
-
| Exit 77 (auth) | `unicli auth
|
|
99
|
-
| CDP connection dropped | `unicli daemon restart`
|
|
140
|
+
| Problem | Fix |
|
|
141
|
+
| ----------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
142
|
+
| "Browser not connected" | `unicli browser doctor --json`, then `unicli browser doctor --repair` |
|
|
143
|
+
| Exit 69 (unavailable) | `unicli browser doctor --repair` then retry |
|
|
144
|
+
| Exit 77 (auth) | `unicli auth import <site> --domain <domain>` or `unicli browser cookies <domain> --profile-id <id>` |
|
|
145
|
+
| CDP connection dropped | `unicli daemon restart` |
|
|
@@ -6,7 +6,7 @@ description: >
|
|
|
6
6
|
newlines, or inline JSON — shell-quoted invocations hit TC0 circuit
|
|
7
7
|
limits and drop to <50% success above ICS=4. Also covers --describe
|
|
8
8
|
introspection and next_actions-driven navigation.
|
|
9
|
-
version: 0.223.
|
|
9
|
+
version: 0.223.2
|
|
10
10
|
depends-on:
|
|
11
11
|
- talk-normal
|
|
12
12
|
triggers:
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Use Uni-CLI to interact with 237 websites, desktop apps, and system tools.
|
|
5
5
|
Trigger when: user asks to check a website, fetch data, control a desktop app,
|
|
6
6
|
or interact with social media, news, finance, or AI platforms.
|
|
7
|
-
version: 0.223.
|
|
7
|
+
version: 0.223.2
|
|
8
8
|
depends-on:
|
|
9
9
|
- talk-normal
|
|
10
10
|
triggers:
|
|
@@ -107,7 +107,7 @@ unicli operate network # See captured JSON APIs
|
|
|
107
107
|
|
|
108
108
|
| Problem | Fix |
|
|
109
109
|
| ---------------------- | --------------------------------------- |
|
|
110
|
-
| Browser not connected | `unicli browser
|
|
110
|
+
| Browser not connected | `unicli browser doctor --repair` |
|
|
111
111
|
| Element not found | `scroll down` then `state` |
|
|
112
112
|
| Stale refs after click | `state` to refresh |
|
|
113
113
|
| eval returns undefined | Wrap: `"(function(){ return ...; })()"` |
|
|
@@ -22,7 +22,8 @@ Commands return a v2 AgentEnvelope; pass `-f json` when you need JSON for parsin
|
|
|
22
22
|
## Pre-Check
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
unicli <
|
|
25
|
+
unicli search "<intent>" # Discover from live registry first
|
|
26
|
+
unicli list --site <site> # Verify subcommands exist
|
|
26
27
|
unicli <site> <command> --help # Check args and output columns
|
|
27
28
|
```
|
|
28
29
|
|
|
@@ -64,15 +65,16 @@ unicli hackernews search "startup" --limit 10
|
|
|
64
65
|
## Output Handling
|
|
65
66
|
|
|
66
67
|
```bash
|
|
67
|
-
unicli hackernews top --limit 5 | jq '.[].title'
|
|
68
|
-
unicli xueqiu hot | jq '.[] | {name, change}'
|
|
68
|
+
unicli hackernews top --limit 5 -f json | jq '.data[].title'
|
|
69
|
+
unicli xueqiu hot -f json | jq '.data[] | {name, change}'
|
|
69
70
|
```
|
|
70
71
|
|
|
71
72
|
## Fallback
|
|
72
73
|
|
|
73
|
-
- Exit 77 -> `unicli auth
|
|
74
|
-
- Exit 69 -> `unicli browser
|
|
74
|
+
- Exit 77 -> `unicli auth import <site> --domain <domain>` or `unicli browser cookies <domain> --profile-id <id>` then retry
|
|
75
|
+
- Exit 69 -> `unicli browser doctor --json`, `unicli browser doctor --repair`, then retry
|
|
75
76
|
- Exit 66 -> try different query terms
|
|
77
|
+
- Adapter failure -> read stderr envelope and run `unicli repair <site> <command>`
|
|
76
78
|
- Site down -> switch to alternative from routing table
|
|
77
79
|
|
|
78
80
|
## Budget
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
name: unicli-usage
|
|
3
3
|
description: >
|
|
4
4
|
Command reference and usage guide for unicli — the universal CLI for AI agents.
|
|
5
|
-
Use when you need to discover, run, or pipe unicli commands
|
|
5
|
+
Use when you need to discover, run, or pipe unicli commands; or before using
|
|
6
|
+
raw browser tools, legacy OpenCLI, curl, or computer-use for web, browser,
|
|
7
|
+
desktop, macOS, local-tool, external-CLI, or adapter-repair tasks.
|
|
6
8
|
---
|
|
7
9
|
|
|
8
10
|
# unicli Usage Guide
|
|
@@ -10,6 +12,7 @@ description: >
|
|
|
10
12
|
## Quick Reference
|
|
11
13
|
|
|
12
14
|
```bash
|
|
15
|
+
unicli search "intent" # Find the right command first
|
|
13
16
|
unicli list # List all available commands
|
|
14
17
|
unicli list --type web-api # Filter by adapter type
|
|
15
18
|
unicli list --site bilibili # Filter by site name
|
|
@@ -19,6 +22,10 @@ unicli hackernews top --limit 5 # Example: HN top stories
|
|
|
19
22
|
unicli hackernews search "AI agents" # Example: search HN
|
|
20
23
|
|
|
21
24
|
unicli doctor # System health check
|
|
25
|
+
unicli browser doctor --json # Browser/profile/CDP reliability report
|
|
26
|
+
unicli browser doctor --repair # Safe repair for local automation CDP
|
|
27
|
+
unicli browser start # Background-safe CDP startup
|
|
28
|
+
unicli browser --focus start # Foreground only for explicit login
|
|
22
29
|
```
|
|
23
30
|
|
|
24
31
|
## Output Formats
|
|
@@ -63,3 +70,34 @@ unicli hackernews top || echo "exit $?"
|
|
|
63
70
|
| 66 | Empty result |
|
|
64
71
|
| 69 | Service unavailable |
|
|
65
72
|
| 77 | Auth required |
|
|
73
|
+
|
|
74
|
+
## Auth and Browser Reuse
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
unicli browser profiles --json
|
|
78
|
+
unicli auth import <site> --domain <domain>
|
|
79
|
+
unicli browser cookies <domain> --profile-id <id>
|
|
80
|
+
unicli repair <site> <command>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Browser operations are backend/background-first. Daemon commands default to
|
|
84
|
+
`windowFocused: false`, doctor/session probes must not create placeholder tabs,
|
|
85
|
+
and `--focus` is the explicit escape hatch for a foreground login flow.
|
|
86
|
+
|
|
87
|
+
Chrome 136+ rejects CDP on the browser's default user-data-dir. Uni-CLI should
|
|
88
|
+
therefore launch CDP against its own automation profile under `~/.unicli/` and
|
|
89
|
+
reuse login state by importing cookies from `unicli browser profiles --json`.
|
|
90
|
+
If `chrome_remote_debugging.policy.state=disabled`, the user/admin must remove
|
|
91
|
+
`RemoteDebuggingAllowed=false` or set it true in Chrome policy, then restart
|
|
92
|
+
Chrome; that policy does not bypass the default-profile restriction. If a
|
|
93
|
+
browser command fails, diagnose the automation profile and cookie import path
|
|
94
|
+
before asking the user to foreground Chrome.
|
|
95
|
+
|
|
96
|
+
Agent loop for delivery:
|
|
97
|
+
|
|
98
|
+
1. Run `unicli browser doctor --json`.
|
|
99
|
+
2. If `default_path.ready` is true, run the requested command.
|
|
100
|
+
3. If false, run `self_repair.safe_command` or the first failing
|
|
101
|
+
`checks[*].next_step`.
|
|
102
|
+
4. If the command still fails with a structured adapter envelope, run
|
|
103
|
+
`unicli repair <site> <command>`.
|
|
@@ -56,6 +56,12 @@
|
|
|
56
56
|
install:
|
|
57
57
|
default: "npm install -g @openai/codex"
|
|
58
58
|
|
|
59
|
+
- name: browser-use-terminal
|
|
60
|
+
binary: browser
|
|
61
|
+
description: "Browser Use Terminal — Rust TUI browser agent with local, headless, and cloud CDP control"
|
|
62
|
+
homepage: "https://github.com/browser-use/terminal"
|
|
63
|
+
tags: [ai, agent, browser, automation, cdp, tui]
|
|
64
|
+
|
|
59
65
|
- name: opencode-cli
|
|
60
66
|
binary: opencode
|
|
61
67
|
description: "OpenCode — coding agent CLI with ACP and native TUI surfaces"
|