mirror of
https://github.com/stablyai/orca.git
synced 2026-11-03 10:37:35 +00:00
* fix(browser): turn on touch when an agent sets a mobile device or viewport * docs(orca-cli): say every page load resets agent device emulation
3.2 KiB
3.2 KiB
Built-in browser commands
Use a snapshot-interact-re-snapshot loop:
ORCA goto --url https://example.com --json
ORCA snapshot --json
ORCA click --element @e3 --json
ORCA snapshot --json
Common commands:
ORCA goto --url <url> --json
ORCA back --json
ORCA reload --json
ORCA snapshot --json
ORCA screenshot --json
ORCA full-screenshot --json
ORCA pdf --json
ORCA click --element <ref> --json
ORCA fill --element <ref> --value <text> --json
ORCA type --input <text> --json
ORCA select --element <ref> --value <value> --json
ORCA check --element <ref> --json
ORCA scroll --direction down --amount 1000 --json
ORCA hover --element <ref> --json
ORCA focus --element <ref> --json
ORCA keypress --key Enter --json
ORCA upload --element <ref> --files <paths> --json
ORCA wait --text <text> --json
ORCA wait --url <substring> --json
ORCA wait --selector <css> --json
ORCA wait --load networkidle --json
ORCA eval --expression <js> --json
ORCA set device --name "iPhone 15" --json
ORCA viewport --width 390 --height 844 --scale 3 --mobile --json
ORCA tab list --json
ORCA tab create --url <url> --json
ORCA tab switch --index <n> --json
ORCA tab close --index <n> --json
ORCA cookie get --json
ORCA capture start --json
ORCA console --limit 50 --json
ORCA network --limit 50 --json
ORCA exec --command "help" --json
Browser rules:
- Re-snapshot after navigation, tab switches, clicks that change the page, and any
browser_stale_ref. - Refs like
@e1are assigned bysnapshot, scoped to one tab, and invalidated by navigation or tab switch. - Browser commands default to the current worktree and its active tab. Use
--worktree allonly intentionally. - For concurrent browser work, run
ORCA tab list --json, readtabs[].browserPageId, and pass--page <browserPageId>on later commands. - Use typed tab commands (
ORCA tab list/create/close/switch), notORCA exec --command "tab ...", so Orca keeps UI state synchronized. - Use
ORCA set deviceorORCA viewport --mobile, notORCA exec --command "set device ...", so the page also gets touch input andpointer: coarse. Each page load (reload,goto, link click) resets it, so run it again after navigating. - Prefer
wait --text,--url,--selector, or--loadafter async page changes instead of bare timeouts. - Anything not listed above goes through
ORCA exec --command "<agent-browser command>". - If
fillortypefails on a custom input, tryORCA focus --element @e1 --jsonthenORCA inserttext --text "text" --json. - A client-hosted page renders in the paired desktop's browser engine, so every command against it needs that desktop online and returns
browser_host_unavailablewhile it is closed, asleep, or disconnected. Server-hosted pages run with no desktop attached; prefer them for long or unattended automation.
Common recoveries:
browser_no_tab: open a tab withORCA tab create --url <url> --json.browser_stale_ref: runORCA snapshot --jsonand retry with fresh refs.browser_tab_not_found: runORCA tab list --jsonbefore switching or closing.browser_host_unavailable: the desktop hosting the page is offline. Bring it back, or recreate the page with server placement if the work must outlive the desktop session.