| name | unicli-operate |
| description | Compatibility guide for `unicli operate`. Prefer `unicli browser`, which now exposes the same operator surface plus broker/session diagnostics.
|
| version | 1.0.0 |
| triggers | ["operate browser","click element","fill form","extract page data","unicli operate"] |
| allowed-tools | ["Bash"] |
| protocol | 2 |
When to Use
Prefer unicli browser for new work:
unicli browser open <url>
unicli browser state
unicli browser click <ref>
unicli browser type <ref> <text>
unicli browser find --css <selector>
unicli browser extract
unicli browser tabs
unicli browser frames
unicli operate ... still works, but it is now the compatibility path over the same implementation.
Core Workflow
open -> navigate to URL
state -> inspect DOM, get [ref] numbers for interactive elements
- interact ->
click, type, select, keys using ref numbers
- verify ->
state again or get value <ref> to confirm
- extract ->
eval for structured data
Always state before interacting. Never guess ref numbers.
All Operate Subcommands
unicli operate open <url>
unicli operate back
unicli operate scroll [direction]
unicli operate close
unicli operate state
unicli operate screenshot [path]
unicli operate get title|url
unicli operate get text <ref>
unicli operate get value <ref>
unicli operate get html [selector]
unicli operate get attributes <ref>
unicli operate click <ref>
unicli operate type <ref> <text>
unicli operate select <ref> <option>
unicli operate keys <key>
unicli operate upload <ref> <path>
unicli operate hover <ref>
unicli operate wait time <ms>
unicli operate wait selector <sel>
unicli operate wait text <str>
unicli operate eval <js>
unicli operate network [pattern]
unicli operate observe <query>
Patterns
unicli operate open "https://news.ycombinator.com" && unicli operate state
unicli operate eval "JSON.stringify([...document.querySelectorAll('.titleline a')].slice(0,5).map(a=>({title:a.textContent,url:a.href})))"
unicli operate type 3 "user@example.com" && unicli operate type 5 "pass" && unicli operate click 7
unicli operate open "https://example.com/feed" && unicli operate wait time 3000
unicli operate network
Rules
- Always
state first -- never guess refs
eval is read-only -- never eval "el.click()", use click <ref>
- Verify inputs with
get value <ref> after type
- Re-inspect after navigation -- run
state after open or link clicks
- Prefer API over DOM -- if
network reveals JSON APIs, use YAML adapters
Troubleshooting
| Problem | Fix |
|---|
| Browser not connected | unicli browser doctor --json; run its first failing next_step |
| Element not found | scroll down then state |
| Stale refs after click | state to refresh |
| eval returns undefined | Wrap: "(function(){ return ...; })()" |