{"id":"7e39d79b-1790-46b2-b84c-764a7a7e5936","entityType":"agent","slug":"clawhub-liberalchang-opencli-browser","name":"opencli-browser","canonicalUrl":"https://www.xpersona.co/agent/clawhub-liberalchang-opencli-browser","canonicalPath":"/agent/clawhub-liberalchang-opencli-browser","generatedAt":"2026-10-11T10:47:19.082Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T07:31:31.449Z","emptyReason":null},"description":"Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers... Skill: opencli-browser Owner: liberalchang Summary: Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-22T08:19:58.713Z | user opencli-browser 1.0.0 – Initial release - Enables structured control of a live Chrome window via opencli for agents. - Provides se","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s1711a251cb269zj1bjvwcffxh83kcjh:opencli-browser","sourceUrl":"https://clawhub.ai/liberalchang/opencli-browser","homepage":"https://clawhub.ai/liberalchang/skills/opencli-browser","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/liberalchang/opencli-browser","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/liberalchang/skills/opencli-browser","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":61,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T07:31:31.449Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T07:31:31.449Z","emptyReason":null},"stars":null,"forks":null,"downloads":1123,"packageName":null,"latestVersion":"1.0.0","tractionLabel":"1.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T07:31:31.392Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T07:31:31.449Z","lastCrawledAt":"2026-10-11T07:31:31.392Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T07:31:31.392Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.0","createdAt":"2026-04-22T08:19:58.713Z","changelog":"opencli-browser 1.0.0 – Initial release - Enables structured control of a live Chrome window via opencli for agents. - Provides selector-first target contract, compound form field support, and resilient element references. - Handles stale reference recovery, structured error reporting, and network/API capture. - Outputs machine-readable envelopes describing confidence and match quality for every action. - Includes safety and robustness rules for agents: always inspect first, chain context-aware actions, and verify critical writes. - Not intended for adapter development—use opencli-adapter-author for that workflow.","fileCount":3,"zipByteSize":10050}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s1711a251cb269zj1bjvwcffxh83kcjh:opencli-browser","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-liberalchang-opencli-browser/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-liberalchang-opencli-browser/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-liberalchang-opencli-browser/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-liberalchang-opencli-browser/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-liberalchang-opencli-browser/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-liberalchang-opencli-browser/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T10:47:19.071Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-liberalchang-opencli-browser/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-liberalchang-opencli-browser/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-liberalchang-opencli-browser/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-liberalchang-opencli-browser/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T07:31:31.449Z","emptyReason":null},"readme":"Skill: opencli-browser\n\nOwner: liberalchang\n\nSummary: Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers...\n\nTags: latest:1.0.0\n\nVersion history:\n\nv1.0.0 | 2026-04-22T08:19:58.713Z | user\n\nopencli-browser 1.0.0 – Initial release\n\n- Enables structured control of a live Chrome window via opencli for agents.\n- Provides selector-first target contract, compound form field support, and resilient element references.\n- Handles stale reference recovery, structured error reporting, and network/API capture.\n- Outputs machine-readable envelopes describing confidence and match quality for every action.\n- Includes safety and robustness rules for agents: always inspect first, chain context-aware actions, and verify critical writes.\n- Not intended for adapter development—use opencli-adapter-author for that workflow.\n\nArchive index:\n\nArchive v1.0.0: 3 files, 10050 bytes\n\nFiles: skill-card.md (2364b), SKILL.md (20739b), _meta.json (134b)\n\nFile v1.0.0:SKILL.md\n\n---\r\nname: opencli-browser\r\ndescription: Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers the selector-first target contract, compound form fields, stale-ref handling, network capture, and the agent-native envelopes the CLI returns. Not for writing adapters — see opencli-adapter-author for that.\r\nallowed-tools: Bash(opencli:*), Read, Edit, Write\r\n---\r\n\r\n# opencli-browser\r\n\r\nThe first reader of this CLI is an agent, not a human. Every subcommand returns a structured envelope that tells you exactly what matched, how confident the match is, and what to do if it didn't. Lean on those envelopes — do not guess.\r\n\r\nThis skill is for **driving a live browser** to accomplish an agent task. If you are building a reusable adapter under `~/.opencli/clis/<site>/` use `opencli-adapter-author` instead.\r\n\r\n---\r\n\r\n## Prerequisites\r\n\r\n```bash\r\nopencli doctor\r\n```\r\n\r\nUntil `doctor` is green, nothing else will work. Typical failures: Chrome not running, extension not installed, debug port blocked by 1Password / other extensions. The doctor output tells you which.\r\n\r\n---\r\n\r\n## Window lifecycle\r\n\r\n- `opencli browser *` commands already keep the automation session alive between calls. The window stays open until you run `opencli browser close` or the idle timeout expires.\r\n- `--focus` (or `OPENCLI_WINDOW_FOCUSED=1`) opens the automation window in the foreground. Use it when you want to watch the page live.\r\n- `--live` (or `OPENCLI_LIVE=1`) is mainly for browser-backed adapter commands such as `opencli xiaohongshu note ...`. It keeps the adapter's automation window open after the command returns so you can inspect the final page state.\r\n\r\n---\r\n\r\n## Mental model\r\n\r\n1. **Selector-first target contract.** Every interaction command (`click`, `type`, `select`, `get text/value/attributes`) takes one `<target>`, which is *either* a numeric ref from `state`/`find` *or* a CSS selector. Use `--nth <n>` to disambiguate multiple CSS matches.\r\n2. **Every envelope reports `matches_n` and `match_level`.** `match_level` is `exact`, `stable`, or `reidentified` — the CLI already rescued moderate DOM drift for you, but the level tells you how confident to be.\r\n3. **Compact output first, full payload on demand.** `state` is a budget-aware snapshot; `get html --as json` supports `--depth/--children-max/--text-max`; `network` returns shape previews and you re-fetch a single body with `--detail <key>`. If you emit a giant payload you are burning context you did not need to burn.\r\n4. **Structured errors are machine-readable.** On failure the CLI emits `{error: {code, message, hint?, candidates?}}`. Branch on `code`, not on message strings.\r\n\r\n---\r\n\r\n## Critical rules\r\n\r\n1. **Always inspect before you act.** Run `state` or `find` first. Never hard-code a ref or selector from memory across sessions — indices are per-snapshot.\r\n2. **Prefer numeric ref over CSS once you have it.** Numeric refs survive mild DOM shifts because the CLI fingerprints each tagged element. A CSS selector written by hand will break the first time the site re-renders.\r\n3. **Read `match_level` after every write.** `exact` = all good. `stable` = the element is the same but some soft attrs drifted — your action still applied. `reidentified` = the original ref was gone and the CLI found a unique replacement; double-check you hit the right element.\r\n4. **Use the `compound` field for form controls.** Do not regex-guess a date format, do not `state` twice to get the full `<select>` options list. The compound envelope has the format string, full option list up to 50, `options_total` for overflow, and `accept`/`multiple` for `<input type=file>`.\r\n5. **Verify writes that matter.** After `type <target> <text>`, run `get value <target>`. After `select`, run `get value`. Autocomplete widgets, React controlled inputs, and masked fields all silently eat characters. The CLI cannot detect this for you.\r\n6. **`state` → action → `state` after a page change.** Navigations, form submits, and SPA route changes invalidate refs. Take a fresh snapshot. Do not reuse refs from before the transition.\r\n7. **Chain with `&&`.** A chained sequence runs in one shell so refs acquired by the first command stay live for the second. Separate shell invocations lose the session context you just set up.\r\n8. **`eval` is read-only.** Wrap the JS in an IIFE and return JSON. If you need to *change* the page, use the structured `click` / `type` / `select` / `keys` commands instead — they produce structured output and fingerprints, `eval` does not.\r\n9. **Prefer `network` to screen-scraping.** If a page you care about fetches its data from a JSON API, the API is almost always more reliable than scraping the rendered DOM. Capture once, inspect the shape, then `--detail <key>` the body you need.\r\n\r\n---\r\n\r\n## Target contract (`<target>` for click / type / select / get text|value|attributes)\r\n\r\n```\r\n<target> ::= <numeric-ref> | <css-selector>\r\n```\r\n\r\n- **Numeric ref** — the `[N]` index from `state` or `find`. Cheap, resilient to soft DOM drift.\r\n- **CSS selector** — anything `querySelectorAll` accepts. Must be unambiguous on write ops, or pair with `--nth <n>`.\r\n\r\n### Envelope on success\r\n\r\n```json\r\n{ \"clicked\": true, \"target\": \"3\", \"matches_n\": 1, \"match_level\": \"exact\" }\r\n```\r\n\r\n```json\r\n{ \"value\": \"kalevin@example.com\", \"matches_n\": 1, \"match_level\": \"stable\" }\r\n```\r\n\r\n### match_level\r\n\r\n| level | meaning | you should |\r\n|-------|---------|------------|\r\n| `exact` | Fingerprint agreed on tag + strong IDs with at most one soft drift | Proceed. |\r\n| `stable` | Tag + strong IDs still agree, soft signals (aria-label, role, text) drifted | Proceed, but if *what* you typed/clicked matters, re-check with `get value` or `state`. |\r\n| `reidentified` | Original ref was gone; a unique live element matched the fingerprint and was re-tagged with the old ref | Double-check you hit the right element before chaining more writes. |\r\n\r\n### Structured error codes\r\n\r\nBranch on these, not on the human message:\r\n\r\n| code | meaning |\r\n|------|---------|\r\n| `not_found` | Numeric ref is no longer in the DOM. Re-`state`. |\r\n| `stale_ref` | Ref exists but the element at that ref changed identity. Re-`state`. |\r\n| `invalid_selector` | CSS was rejected by `querySelectorAll`. Fix the selector. |\r\n| `selector_not_found` | CSS matches 0 elements. Try `find` with a looser selector. |\r\n| `selector_ambiguous` | CSS matches >1 and no `--nth`. Add `--nth` or narrow the selector. |\r\n| `selector_nth_out_of_range` | `--nth` beyond match count. |\r\n| `option_not_found` | `select` couldn't find an option matching that label/value. Error envelope includes `available: string[]` of the real option labels. |\r\n| `not_a_select` | `select` was called on a non-`<select>` element. |\r\n\r\nError envelope always includes `error.code` and `error.message`. Target errors (`selector_not_found`, `selector_ambiguous`, etc.) often add `error.candidates: string[]` with suggested selectors. `option_not_found` adds `error.available: string[]` instead.\r\n\r\n---\r\n\r\n## Command reference\r\n\r\n### Inspect\r\n\r\n| command | purpose |\r\n|---------|---------|\r\n| `browser state` | Snapshot: text tree with `[N]` refs, scroll hints, hidden-interactive hints, `compounds (N):` sidecar for date/select/file refs. |\r\n| `browser find --css <sel> [--limit N] [--text-max N]` | Run a CSS query and return one entry per match with `{nth, ref, tag, role, text, attrs, visible, compound?}`. Allocates refs for matches the prior snapshot didn't tag. Cheap alternative to `state` when you already know the selector. |\r\n| `browser frames` | List cross-origin iframe targets. Pass the index to `--frame` on `eval`. |\r\n| `browser screenshot [path]` | Viewport PNG. No path → base64 to stdout. Prefer `state` when you just need structure. |\r\n\r\n### Get (read-only)\r\n\r\n| command | returns |\r\n|---------|---------|\r\n| `browser get title` | plain text |\r\n| `browser get url` | plain text |\r\n| `browser get text <target> [--nth N]` | `{value, matches_n, match_level}` |\r\n| `browser get value <target> [--nth N]` | `{value, matches_n, match_level}` |\r\n| `browser get attributes <target> [--nth N]` | `{value: {attr: val, ...}, matches_n, match_level}` |\r\n| `browser get html [--selector <css>] [--as html\\|json] [--depth N] [--children-max N] [--text-max N] [--max N]` | Raw HTML, or structured tree. JSON tree nodes have `{tag, attrs, text, children[], compound?}`. Truncation reported via `truncated: {depth?, children_dropped?, text_truncated?}`. |\r\n\r\n### Interact\r\n\r\n| command | notes |\r\n|---------|-------|\r\n| `browser click <target> [--nth N]` | Returns `{clicked, target, matches_n, match_level}`. |\r\n| `browser type <target> <text> [--nth N]` | Clicks first, then types. Returns `{typed, text, target, matches_n, match_level, autocomplete}`. `autocomplete: true` means a combobox/datalist popup appeared after typing — you almost always need `keys Enter` or a follow-up `click` on the suggestion to commit the value. |\r\n| `browser select <target> <option> [--nth N]` | Matches option by label first, then value. Use `compound` from `find`/`state` to see exactly what labels are available. |\r\n| `browser keys <key>` | `Enter`, `Escape`, `Tab`, `Control+a`, etc. Runs against the focused element. |\r\n| `browser scroll <direction> [--amount px]` | `up` / `down`. Default amount `500`. |\r\n\r\n### Wait\r\n\r\n```bash\r\nbrowser wait selector \"<css>\" [--timeout ms]    # wait until the selector matches\r\nbrowser wait text \"<substring>\" [--timeout ms]  # wait until the text appears\r\nbrowser wait time <seconds>                     # hard sleep, last resort\r\n```\r\n\r\nDefault timeout `10000` ms. SPA routes, login redirects, and lazy-loaded lists need `wait` before `state`/`get`.\r\n\r\n### Extract\r\n\r\n- **`browser eval <js> [--frame N]`** — Run an expression in the page (or in a cross-origin frame via `--frame`). Wrap in an IIFE and return JSON. Read-only: no `document.forms[0].submit()`, no clicks, no navigations. If the result is a string, stdout is the raw string; otherwise it's JSON.\r\n- **`browser extract [--selector <css>] [--chunk-size N] [--start N]`** — Markdown extraction of long-form content with a continuation cursor. Returns `{url, title, selector, total_chars, chunk_size, start, end, next_start_char, content}`. Loop on `next_start_char` until it is `null`. Auto-scopes to `<main>`/`<article>`/`<body>` if you don't pass `--selector`.\r\n\r\n### Network\r\n\r\n```bash\r\nbrowser network                        # shape preview + cache key list\r\nbrowser network --detail <key>         # full body for one cached entry\r\nbrowser network --filter \"field1,field2\"  # keep only entries whose body shape contains ALL fields as path segments\r\nbrowser network --all                  # include static resources (usually noise)\r\nbrowser network --raw                  # full bodies inline — large; use sparingly\r\nbrowser network --ttl <ms>             # cache TTL (default 24h)\r\n```\r\n\r\nList entries look like `{key, method, status, url, ct, size, shape, body_truncated?}`. Detail envelope is `{key, url, method, status, ct, size, shape, body, body_truncated?, body_full_size?, body_truncation_reason}`. Cache lives in `~/.opencli/cache/browser-network/` so you can re-inspect without re-triggering the request.\r\n\r\n### Tabs & session\r\n\r\n| command | purpose |\r\n|---------|---------|\r\n| `browser tab list` | JSON array of `{index, page, url, title, active}`. The `page` string is the tab identity you pass as `<targetId>` to `tab select` / `tab close`, or to `--tab <targetId>` on any subcommand. (`--tab`'s placeholder is historical — the value is always `page`.) |\r\n| `browser tab new [url]` | Open a new tab. Prints the new `page` string. |\r\n| `browser tab select [targetId]` | Make a tab the default. All subcommands accept `--tab <targetId>` to target one without changing the default. |\r\n| `browser tab close [targetId]` | Close by `page`. |\r\n| `browser back` | History back on the active tab. |\r\n| `browser close` | Close the automation window when done. |\r\n\r\n---\r\n\r\n## Compound form controls\r\n\r\nEvery date/time, select, and file input carries a `compound` field. Use it — do not regex attributes.\r\n\r\n### Date family\r\n\r\n```json\r\n{\r\n  \"control\": \"date\",\r\n  \"format\": \"YYYY-MM-DD\",\r\n  \"current\": \"2026-04-21\",\r\n  \"min\": \"2026-01-01\",\r\n  \"max\": \"2026-12-31\"\r\n}\r\n```\r\n\r\n`control` is one of `date | time | datetime-local | month | week`. `format` is a concrete template string — type into the field using that exact format, or `select` by label if the site wraps the native input in a custom widget.\r\n\r\n### Select\r\n\r\n```json\r\n{\r\n  \"control\": \"select\",\r\n  \"multiple\": false,\r\n  \"current\": \"United States\",\r\n  \"options\": [\r\n    { \"label\": \"United States\", \"value\": \"us\", \"selected\": true },\r\n    { \"label\": \"Canada\", \"value\": \"ca\" }\r\n  ],\r\n  \"options_total\": 137\r\n}\r\n```\r\n\r\n`options[]` is capped at 50 entries. **`current` is always correct** even when the selected option is past the cap — it's computed by scanning every option, not from the truncated list. If `options_total > options.length` and you need an option that isn't in `options[]`, call `browser select <target> \"<label>\"` directly — the CLI matches against the live DOM, not the truncated list.\r\n\r\n### File\r\n\r\n```json\r\n{\r\n  \"control\": \"file\",\r\n  \"multiple\": true,\r\n  \"current\": [\"report.pdf\", \"cover.png\"],\r\n  \"accept\": \"application/pdf,image/*\"\r\n}\r\n```\r\n\r\nDo not invent file paths. Upload is done via the normal click flow — respect `accept` when telling the user what to upload.\r\n\r\n### Where compounds show up\r\n\r\n- `browser find --css <sel>` entries: inline on each match.\r\n- `browser get html --as json` tree nodes: inline on matching nodes.\r\n- `browser state` snapshot: in a `compounds (N):` sidecar keyed by numeric ref, so you can tell at a glance which `[N]` entries have rich metadata.\r\n\r\n---\r\n\r\n## Cost guide\r\n\r\nThink about payload size per call. Budgets exist for a reason.\r\n\r\n| command | rough cost | when to use |\r\n|---------|-----------|-------------|\r\n| `state` | medium (bounded by internal budget) | First call on any page, after every nav, when you need refs. |\r\n| `find --css <sel>` | small | You already know the selector — one query, compact entries. |\r\n| `get title` / `get url` | tiny | Sanity checks between steps. |\r\n| `get text/value/attributes` | tiny per call | Verifying one specific field. |\r\n| `get html` (raw) | can be huge | Avoid on unbounded pages. Always pair with `--selector` and a budget. |\r\n| `get html --as json --depth 3 --children-max 20` | medium | When you need to reason about structure, not a specific field. |\r\n| `screenshot` | large | Only when the page is visual (CAPTCHA, charts). Prefer `state`. |\r\n| `extract` | medium per chunk | Long-form reading. Loop via `next_start_char`. |\r\n| `network` (default) | small | First look at APIs. |\r\n| `network --detail <key>` | varies | Pull one body. |\r\n| `network --raw` | huge | Only after `--filter` narrowed the candidate set. |\r\n| `eval \"JSON.stringify(...)\"` | controlled | Targeted extraction when none of the above fit. |\r\n\r\nRule of thumb: **one `state` per page transition, one `find` per follow-up query, one `get`/`click`/`type` per action.** If your plan involves >10 calls per page you are probably scraping instead of interacting — consider `extract` or `network`.\r\n\r\n---\r\n\r\n## Chaining rules\r\n\r\n**Good — one shell, live session:**\r\n\r\n```bash\r\nopencli browser open \"https://news.ycombinator.com\" \\\r\n  && opencli browser state \\\r\n  && opencli browser click 3\r\n```\r\n\r\n**Bad — each line is a fresh shell, refs from call 1 are already forgotten when call 2 runs.** (Only a problem if you rely on shell-scoped state; browser refs themselves persist in-page, but interleaving unrelated shells invites races.) Prefer `&&` when the steps are meant to be atomic.\r\n\r\n**Never** chain a write and then an immediate `state` without a `wait` if the action causes a network round-trip — you will snapshot the pre-response DOM and make bad decisions off stale data.\r\n\r\n---\r\n\r\n## Recipes\r\n\r\n### Fill a login form\r\n\r\n```bash\r\nopencli browser open \"https://example.com/login\"\r\nopencli browser state                          # find [N] for email, password, submit\r\nopencli browser type 4 \"me@example.com\"\r\nopencli browser type 5 \"hunter2\"\r\nopencli browser get value 4                    # verify (autocomplete can eat chars)\r\nopencli browser click 6                        # submit\r\nopencli browser wait selector \"[data-testid=account-menu]\" --timeout 15000\r\nopencli browser state                          # fresh refs on the logged-in page\r\n```\r\n\r\n### Pick from a long dropdown\r\n\r\n```bash\r\nopencli browser state                          # sidebar shows [12] <select name=country>\r\nopencli browser find --css \"select[name=country]\"\r\n# the compound.options_total is 137, but compound.current is \"\" — unselected.\r\nopencli browser select 12 \"Uruguay\"\r\nopencli browser get value 12                   # { value: \"uy\", match_level: \"exact\" }\r\n```\r\n\r\n### Scrape a list via network instead of DOM\r\n\r\n```bash\r\nopencli browser open \"https://news.ycombinator.com\"\r\nopencli browser network --filter \"title,score\"\r\n# -> find the /topstories entry, note its key\r\nopencli browser network --detail topstories-a1b2\r\n```\r\n\r\n### Read a long article in chunks\r\n\r\n```bash\r\nopencli browser open \"https://blog.example.com/long-post\"\r\nopencli browser extract --chunk-size 8000\r\n# -> content + next_start_char: 8000\r\nopencli browser extract --start 8000 --chunk-size 8000\r\n# ...until next_start_char is null\r\n```\r\n\r\n### Cross-origin iframe\r\n\r\n```bash\r\nopencli browser frames\r\n# -> [{\"index\": 0, \"url\": \"https://checkout.stripe.com/...\", ...}]\r\nopencli browser eval \"(() => document.querySelector('input[name=cardnumber]')?.value)()\" --frame 0\r\n```\r\n\r\n---\r\n\r\n## Pitfalls\r\n\r\n- **Do not submit forms via `eval \"document.forms[0].submit()\"`** — modern sites intercept with JS handlers and silently drop the call. Either `click` the submit button via its ref, or (if you know the GET URL) just `open` it directly.\r\n- **Do not reuse refs across a page transition.** `wait` for the new state, then re-`state`. Old refs will either 404 or (worse) `reidentify` onto a similarly-shaped element on the new page.\r\n- **`match_level: reidentified` is a warning, not an error.** The action went through, but if you are chaining 5 more writes that all depend on that being the right element, verify with a `get text` or `get value` before continuing.\r\n- **Budget-aware commands silently cap.** `get html --as json` with default budgets will return `truncated: {...}`. If your downstream logic needs the whole subtree, raise `--depth` / `--children-max` or tighten the selector.\r\n- **`autocomplete: true` on a `type` response is not an error.** It means a suggestion popup is open and your value isn't committed yet. Typically `keys Enter` to accept the first suggestion, or `click` the one you want.\r\n- **`network --filter` is AND-semantics on path segments.** `--filter \"title,score\"` keeps entries whose body shape contains *both* `title` and `score` as path segments, at any depth. It is not a regex.\r\n- **Screenshots are for humans, not for agents.** Use `state` + `find` unless the page is genuinely visual (captcha, chart). Screenshots burn tokens and rarely add signal an agent can act on.\r\n\r\n---\r\n\r\n## Troubleshooting\r\n\r\n| symptom | fix |\r\n|---------|-----|\r\n| `opencli doctor` red: \"Browser not connected\" | Start Chrome with `--remote-debugging-port=9222`, or rerun the extension install. |\r\n| `attach failed: chrome-extension://...` | Disable 1Password / other CDP-hungry extensions temporarily. |\r\n| `selector_not_found` right after `state` | Page mutated. `wait selector \"...\"` then retry. |\r\n| `stale_ref` across every command | You are reusing refs from a prior page. Re-`state`. |\r\n| `click` succeeds but nothing happens | The element is probably a decorative wrapper stealing clicks from the real target. `find --css \"...\"` with a narrower selector and retry on the inner element. |\r\n| `type` appears to finish but value is wrong | Autocomplete, masked input, or React controlled re-render. Verify with `get value`. Add `keys Enter` or re-type. |\r\n| Giant `get html` output | Pass `--selector` + `--as json --depth 3 --children-max 20 --text-max 200`. |\r\n| Network cache seems stale | Bump `--ttl` down, or let it expire. The cache lives at `~/.opencli/cache/browser-network/`. |\r\n\r\n---\r\n\r\n## See also\r\n\r\n- `opencli-adapter-author` — turning what you just figured out into a reusable `~/.opencli/clis/<site>/<command>.js`.\r\n- `opencli-autofix` — when an existing adapter breaks, this skill walks you through `OPENCLI_DIAGNOSTIC` and filing a fix.\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn75j29qyaahtzr82k3xvmgtkx80mk2w\",\n  \"slug\": \"opencli-browser\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1776845998713\n}\n\nFile v1.0.0:skill-card.md\n\n## Description:\n\nHelps an agent drive a real Chrome window via opencli to inspect pages, fill forms, click through logged-in flows, extract ad-hoc data, and handle selector-first targeting, compound fields, stale references, network capture, and structured CLI envelopes.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[liberalchang](https://clawhub.ai/user/liberalchang)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent operators use this skill to control a live Chrome browser through opencli for page inspection, form interaction, logged-in workflows, and ad-hoc data extraction. It is not intended for building reusable opencli adapters.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill enables an agent to drive a real browser session, including logged-in workflows and potentially sensitive form fields.\n\nMitigation: Use explicit approval for sensitive steps and avoid passwords, MFA codes, payment data, and high-impact account changes unless each action is reviewed.\n\nRisk: Browser automation can make real changes to pages, forms, or accounts if an agent acts on the wrong target.\n\nMitigation: Inspect before acting, prefer fresh refs from the current page state, and verify critical writes with read-back commands.\n\nRisk: Captured network responses may contain sensitive data and can remain available in the opencli network cache.\n\nMitigation: Close the browser session when finished and clear the opencli network cache after sensitive work.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/liberalchang/skills/opencli-browser)\n- [Publisher profile](https://clawhub.ai/user/liberalchang)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, shell commands, configuration]\n\n**Output Format:** [Markdown with inline bash command examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Guidance emphasizes structured command envelopes, selector or ref targeting, and verification after browser writes.]\n\n## Skill Version(s):\n\n1.0.0 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.","readmeExcerpt":"Skill: opencli-browser Owner: liberalchang Summary: Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-22T08:19:58.713Z | user opencli-browser 1.0.0 – Initial release - Enables structured control of a live Chrome window via opencli for agents. - Provides se","codeSnippets":[],"executableExamples":[],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\r\nname: opencli-browser\r\ndescription: Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers the selector-first target contract, compound form fields, stale-ref handling, network capture, and the agent-native envelopes the CLI returns. Not for writing adapters — see opencli-adapter-author for that.\r\nallowed-tools: Bash(opencli:*), Read, Edit, Write\r\n---\r\n\r\n# opencli-browser\r\n\r\nThe first reader of this CLI is an agent, not a human. Every subcommand returns a structured envelope that tells you exactly what matched, how confident the match is, and what to do if it didn't. Lean on those envelopes — do not guess.\r\n\r\nThis skill is for **driving a live browser** to accomplish an agent task. If you are building a reusable adapter under `~/.opencli/clis/<site>/` use `opencli-adapter-author` instead.\r\n\r\n---\r\n\r\n## Prerequisites\r\n\r\n```bash\r\nopencli doctor\r\n```\r\n\r\nUntil `doctor` is green, nothing else will work. Typical failures: Chrome not running, extension not installed, debug port blocked by 1Password / other extensions. The doctor output tells you which.\r\n\r\n---\r\n\r\n## Window lifecycle\r\n\r\n- `opencli browser *` commands already keep the automation session alive between calls. The window stays open until you run `opencli browser close` or the idle timeout expires.\r\n- `--focus` (or `OPENCLI_WINDOW_FOCUSED=1`) opens the automation window in the foreground. Use it when you want to watch the page live.\r\n- `--live` (or `OPENCLI_LIVE=1`) is mainly for browser-backed adapter commands such as `opencli xiaohongshu note ...`. It keeps the adapter's automation window open after the command returns so you can inspect the final page state.\r\n\r\n---\r\n\r\n## Mental model\r\n\r\n1. **Selector-first target contract.** Every interaction command (`click`, `type`, `select`, `get text/value/attributes`) takes one `<target>`, which is *either* a numeric ref from `state`/`find` *or* a CSS selector. Use `--nth <n>` to disambiguate multiple CSS matches.\r\n2. **Every envelope reports `matches_n` and `match_level`.** `match_level` is `exact`, `stable`, or `reidentified` — the CLI already rescued moderate DOM drift for you, but the level tells you how confident to be.\r\n3. **Compact output first, full payload on demand.** `state` is a budget-aware snapshot; `get html --as json` supports `--depth/--children-max/--text-max`; `network` returns shape previews and you re-fetch a single body with `--detail <key>`. If you emit a giant payload you are burning context you did not need to burn.\r\n4. **Structured errors are machine-readable.** On failure the CLI emits `{error: {code, message, hint?, candidates?}}`. Branch on `code`, not on message strings.\r\n\r\n---\r\n\r\n## Critical rules\r\n\r\n1. **Always inspect before you act.** Run `state` or `find` first. Never hard-code a ref or selector from memory across sessions — indices are per-snapshot.\r\n2. **Prefer numeric ref over CSS once you have it.** Numeric r"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn75j29qyaahtzr82k3xvmgtkx80mk2w\",\n  \"slug\": \"opencli-browser\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1776845998713\n}"},{"path":"skill-card.md","content":"## Description:\n\nHelps an agent drive a real Chrome window via opencli to inspect pages, fill forms, click through logged-in flows, extract ad-hoc data, and handle selector-first targeting, compound fields, stale references, network capture, and structured CLI envelopes.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[liberalchang](https://clawhub.ai/user/liberalchang)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent operators use this skill to control a live Chrome browser through opencli for page inspection, form interaction, logged-in workflows, and ad-hoc data extraction. It is not intended for building reusable opencli adapters.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill enables an agent to drive a real browser session, including logged-in workflows and potentially sensitive form fields.\n\nMitigation: Use explicit approval for sensitive steps and avoid passwords, MFA codes, payment data, and high-impact account changes unless each action is reviewed.\n\nRisk: Browser automation can make real changes to pages, forms, or accounts if an agent acts on the wrong target.\n\nMitigation: Inspect before acting, prefer fresh refs from the current page state, and verify critical writes with read-back commands.\n\nRisk: Captured network responses may contain sensitive data and can remain available in the opencli network cache.\n\nMitigation: Close the browser session when finished and clear the opencli network cache after sensitive work.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/liberalchang/skills/opencli-browser)\n- [Publisher profile](https://clawhub.ai/user/liberalchang)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, shell commands, configuration]\n\n**Output Format:** [Markdown with inline bash command examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Guidance emphasizes structured command envelopes, selector or ref targeting, and verification after browser writes.]\n\n## Skill Version(s):\n\n1.0.0 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers... Skill: opencli-browser Owner: liberalchang Summary: Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-22T08:19:58.713Z | user opencli-browser 1.0.0 – Initial release - Enables structured control of a live Chrome window via opencli for agents. - Provides se","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1216,"uniquenessScore":50,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T07:31:31.449Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T07:31:31.449Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T10:47:19.082Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}