Files
openclaw/extensions/browser/src/cli/browser-cli-examples.ts
T
FMLS b88eeddeed feat(browser): add openclaw browser batch CLI subcommand (#111457)
* feat(browser): add `openclaw browser batch` CLI subcommand

Expose the existing `act:batch` runtime through a dedicated CLI subcommand so
users and scripts can run nested act requests in one call without going through
the agent tool.

- `--actions <json>` for inline JSON, `--actions-file <path>` for file input,
  `--actions-file -` for stdin (1MB cap to bound a runaway pipe)
- `--continue` sets `stopOnError=false`; default keeps the runtime fail-fast
  (stop on first error) behavior, matching the existing batch contract
- `--target-id` forwards to the batch body
- Outer request timeout uses `resolveBrowserActExecutionBudgetMs` so the batch
  budget covers nested actions
- Docs (`docs/tools/browser-control.md` + bundled `browser-automation` skill)
  document the batch CLI, ref lifecycle, targetId conflict handling, and error
  summary format

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(browser): fail batch CLI on action errors

* fix(browser): keep batch stdin reader private

* docs(browser): refresh batch heading map

* test(browser): assert batch JSON via runtime mock

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Mason Huang <masonxhuang@icloud.com>
Co-authored-by: Mason Huang <masonxhuang@proton.me>
2026-07-24 11:33:45 +08:00

47 lines
1.9 KiB
TypeScript

/**
* Help examples shown by the Browser CLI root command.
*/
/** Core Browser CLI examples for lifecycle and inspection commands. */
export const browserCoreExamples = [
"openclaw browser status",
"openclaw browser start",
"openclaw browser start --headless",
"openclaw browser stop",
"openclaw browser tabs",
"openclaw browser open https://example.com",
"openclaw browser focus abcd1234",
"openclaw browser close abcd1234",
"openclaw browser screenshot",
"openclaw browser screenshot --full-page",
"openclaw browser screenshot --ref 12",
"openclaw browser snapshot",
"openclaw browser snapshot --format aria --limit 200",
"openclaw browser snapshot --efficient",
"openclaw browser snapshot --labels",
];
/** Browser CLI examples for interaction/action commands. */
export const browserActionExamples = [
"openclaw browser navigate https://example.com",
"openclaw browser resize 1280 720",
"openclaw browser click 12 --double",
"openclaw browser click-coords 120 340",
'openclaw browser type 23 "hello" --submit',
"openclaw browser press Enter",
"openclaw browser hover 44",
"openclaw browser drag 10 11",
"openclaw browser select 9 OptionA OptionB",
"openclaw browser upload /tmp/openclaw/uploads/file.pdf",
"openclaw browser upload media://inbound/file.pdf",
'openclaw browser fill --fields \'[{"ref":"1","value":"Ada"}]\'',
"openclaw browser dialog --accept",
'openclaw browser wait --text "Done"',
"openclaw browser evaluate --fn '(el) => el.textContent' --ref 7",
"openclaw browser evaluate --fn 'const title = document.title; return title;'",
"openclaw browser console --level error",
"openclaw browser pdf",
"openclaw browser batch --actions-file plan.json",
'openclaw browser batch --actions \'[{"kind":"wait","timeMs":500},{"kind":"click","ref":"12"},{"kind":"type","ref":"23","text":"hello"}]\'',
"openclaw browser batch --actions-file plan.json --continue",
];