feat: add batch command for multi-step workflows (#865)
Add `batch` command that reads a JSON array of commands from stdin and executes them sequentially against the daemon. This avoids per-command process startup overhead when AI agents run multi-step browser workflows. Supports --bail to stop on first error (default: continue all) and --json for structured output as an array of results. Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Matt Van Horn
Claude Opus 4.6
parent
a865dd56e0
commit
7734bb2702
@@ -187,6 +187,25 @@ agent-browser wait "#spinner" --state hidden
|
||||
|
||||
**Load states:** `load`, `domcontentloaded`, `networkidle`
|
||||
|
||||
### Batch Execution
|
||||
|
||||
Execute multiple commands in a single invocation by piping a JSON array of
|
||||
string arrays to `batch`. This avoids per-command process startup overhead
|
||||
when running multi-step workflows.
|
||||
|
||||
```bash
|
||||
# Pipe commands as JSON
|
||||
echo '[
|
||||
["open", "https://example.com"],
|
||||
["snapshot", "-i"],
|
||||
["click", "@e1"],
|
||||
["screenshot", "result.png"]
|
||||
]' | agent-browser batch --json
|
||||
|
||||
# Stop on first error
|
||||
agent-browser batch --bail < commands.json
|
||||
```
|
||||
|
||||
### Clipboard
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user