@bastani/atomic 0.8.26-alpha.1 → 0.8.26-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +79 -0
- package/README.md +5 -5
- package/dist/builtin/intercom/CHANGELOG.md +60 -0
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/CHANGELOG.md +60 -0
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/subagents/CHANGELOG.md +61 -0
- package/dist/builtin/subagents/agents/codebase-analyzer.md +1 -1
- package/dist/builtin/subagents/agents/codebase-locator.md +1 -1
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +9 -9
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +1 -1
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +1 -1
- package/dist/builtin/subagents/agents/codebase-research-locator.md +1 -1
- package/dist/builtin/subagents/agents/debugger.md +6 -6
- package/dist/builtin/subagents/package.json +4 -4
- package/dist/builtin/subagents/prompts/parallel-handoff-plan.md +1 -1
- package/dist/builtin/subagents/skills/browser/EXAMPLES.md +151 -0
- package/dist/builtin/subagents/skills/browser/LICENSE.txt +21 -0
- package/dist/builtin/subagents/skills/browser/REFERENCE.md +451 -0
- package/dist/builtin/subagents/skills/browser/SKILL.md +170 -0
- package/dist/builtin/subagents/skills/subagent/SKILL.md +4 -4
- package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +55 -12
- package/dist/builtin/subagents/src/runs/foreground/execution.ts +71 -12
- package/dist/builtin/subagents/src/runs/shared/acceptance.ts +2 -1
- package/dist/builtin/subagents/src/runs/shared/final-drain.ts +34 -0
- package/dist/builtin/subagents/src/runs/shared/model-fallback.ts +416 -7
- package/dist/builtin/subagents/src/runs/shared/worktree.ts +2 -2
- package/dist/builtin/web-access/CHANGELOG.md +60 -0
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +72 -0
- package/dist/builtin/workflows/README.md +10 -8
- package/dist/builtin/workflows/builtin/deep-research-codebase.ts +11 -8
- package/dist/builtin/workflows/builtin/goal.ts +137 -109
- package/dist/builtin/workflows/builtin/index.d.ts +2 -0
- package/dist/builtin/workflows/builtin/open-claude-design.ts +228 -151
- package/dist/builtin/workflows/builtin/ralph.d.ts +2 -0
- package/dist/builtin/workflows/builtin/ralph.ts +452 -279
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/create-spec/SKILL.md +14 -0
- package/dist/builtin/workflows/skills/research-codebase/SKILL.md +29 -10
- package/dist/builtin/workflows/src/extension/index.ts +10 -2
- package/dist/builtin/workflows/src/extension/runtime.ts +35 -3
- package/dist/builtin/workflows/src/extension/wiring.ts +13 -1
- package/dist/builtin/workflows/src/runs/background/status.ts +52 -6
- package/dist/builtin/workflows/src/runs/foreground/executor.ts +453 -21
- package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +77 -11
- package/dist/builtin/workflows/src/runs/shared/model-fallback.ts +402 -8
- package/dist/builtin/workflows/src/runs/shared/worktree.ts +2 -2
- package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +2 -2
- package/dist/builtin/workflows/src/shared/persistence-restore.ts +182 -6
- package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +76 -6
- package/dist/builtin/workflows/src/shared/stage-prompt.ts +33 -2
- package/dist/builtin/workflows/src/shared/store-types.ts +31 -0
- package/dist/builtin/workflows/src/shared/store.ts +160 -18
- package/dist/builtin/workflows/src/shared/types.ts +3 -3
- package/dist/builtin/workflows/src/shared/workflow-failures.ts +758 -132
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +39 -3
- package/dist/builtin/workflows/src/tui/store-widget-installer.ts +74 -74
- package/dist/core/agent-session.d.ts +33 -6
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +157 -182
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/atomic-guide-command.d.ts.map +1 -1
- package/dist/core/atomic-guide-command.js +11 -9
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +6 -3
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +23 -10
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/context-compaction.d.ts +175 -0
- package/dist/core/compaction/context-compaction.d.ts.map +1 -0
- package/dist/core/compaction/context-compaction.js +1636 -0
- package/dist/core/compaction/context-compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +1 -0
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.js +1 -0
- package/dist/core/compaction/index.js.map +1 -1
- package/dist/core/extensions/types.d.ts +3 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +3 -0
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +14 -7
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/session-manager.d.ts +41 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +146 -7
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/format-answer.d.ts +5 -5
- package/dist/core/tools/ask-user-question/tool/format-answer.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/tool/format-answer.js +5 -5
- package/dist/core/tools/ask-user-question/tool/format-answer.js.map +1 -1
- package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts +16 -3
- package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/tool/response-envelope.js +21 -3
- package/dist/core/tools/ask-user-question/tool/response-envelope.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/modes/index.d.ts +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +17 -0
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/context-compaction-summary-message.d.ts +17 -0
- package/dist/modes/interactive/components/context-compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/context-compaction-summary-message.js +83 -0
- package/dist/modes/interactive/components/context-compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +4 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +75 -10
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +13 -8
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +8 -1
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +4 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +14 -3
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/git-env.d.ts +10 -0
- package/dist/utils/git-env.d.ts.map +1 -0
- package/dist/utils/git-env.js +33 -0
- package/dist/utils/git-env.js.map +1 -0
- package/docs/compaction.md +185 -50
- package/docs/custom-provider.md +11 -9
- package/docs/extensions.md +46 -42
- package/docs/index.md +13 -6
- package/docs/json.md +15 -12
- package/docs/packages.md +2 -0
- package/docs/providers.md +4 -1
- package/docs/quickstart.md +18 -11
- package/docs/rpc.md +38 -23
- package/docs/sdk.md +17 -8
- package/docs/session-format.md +26 -13
- package/docs/sessions.md +3 -3
- package/docs/settings.md +2 -2
- package/docs/skills.md +1 -15
- package/docs/termux.md +9 -10
- package/docs/themes.md +2 -2
- package/docs/tmux.md +3 -3
- package/docs/tui.md +19 -32
- package/docs/usage.md +2 -2
- package/docs/workflows.md +60 -16
- package/package.json +6 -12
- package/dist/builtin/subagents/skills/browser-use/SKILL.md +0 -234
- package/dist/builtin/subagents/skills/browser-use/references/cdp-python.md +0 -76
- package/dist/builtin/subagents/skills/browser-use/references/multi-session.md +0 -92
- package/node_modules/@earendil-works/pi-tui/README.md +0 -779
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +0 -54
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +0 -632
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +0 -22
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js +0 -104
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts +0 -22
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js +0 -35
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +0 -249
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +0 -1857
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts +0 -28
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js +0 -89
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +0 -37
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +0 -378
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +0 -31
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +0 -69
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +0 -96
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +0 -644
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +0 -50
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +0 -159
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +0 -50
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +0 -185
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts +0 -12
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js +0 -23
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +0 -19
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js +0 -89
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts +0 -13
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js +0 -51
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts +0 -39
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.js +0 -2
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +0 -16
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +0 -110
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +0 -23
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +0 -32
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +0 -193
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +0 -174
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts +0 -184
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/keys.js +0 -1173
- package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts +0 -28
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js +0 -44
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +0 -3
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +0 -53
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +0 -50
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +0 -361
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +0 -90
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +0 -366
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +0 -113
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +0 -472
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +0 -227
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +0 -1106
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts +0 -17
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js +0 -25
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +0 -84
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +0 -1029
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts +0 -25
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js +0 -96
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/package.json +0 -47
- package/node_modules/get-east-asian-width/index.d.ts +0 -60
- package/node_modules/get-east-asian-width/index.js +0 -30
- package/node_modules/get-east-asian-width/license +0 -9
- package/node_modules/get-east-asian-width/lookup-data.js +0 -21
- package/node_modules/get-east-asian-width/lookup.js +0 -138
- package/node_modules/get-east-asian-width/package.json +0 -71
- package/node_modules/get-east-asian-width/readme.md +0 -65
- package/node_modules/get-east-asian-width/utilities.js +0 -24
- package/node_modules/marked/LICENSE.md +0 -44
- package/node_modules/marked/README.md +0 -106
- package/node_modules/marked/bin/main.js +0 -282
- package/node_modules/marked/bin/marked.js +0 -15
- package/node_modules/marked/lib/marked.cjs +0 -2211
- package/node_modules/marked/lib/marked.cjs.map +0 -7
- package/node_modules/marked/lib/marked.d.cts +0 -728
- package/node_modules/marked/lib/marked.d.ts +0 -728
- package/node_modules/marked/lib/marked.esm.js +0 -2189
- package/node_modules/marked/lib/marked.esm.js.map +0 -7
- package/node_modules/marked/lib/marked.umd.js +0 -2213
- package/node_modules/marked/lib/marked.umd.js.map +0 -7
- package/node_modules/marked/man/marked.1 +0 -111
- package/node_modules/marked/man/marked.1.md +0 -92
- package/node_modules/marked/marked.min.js +0 -69
- package/node_modules/marked/package.json +0 -111
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Browser Automation Examples
|
|
2
|
+
|
|
3
|
+
Common browser automation workflows using the `browse` CLI. Each example demonstrates a distinct pattern using real commands.
|
|
4
|
+
|
|
5
|
+
For localhost and other local dev flows, start with `browse open <url> --local` for a clean isolated browser. Use `browse open <url> --auto-connect` only when the agent should attach to an existing debuggable Chrome session for cookies or login state.
|
|
6
|
+
|
|
7
|
+
## Example 1: Extract Data from a Page
|
|
8
|
+
|
|
9
|
+
**User request**: "Get the product details from example.com/product/123"
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
browse open https://example.com/product/123
|
|
13
|
+
browse snapshot # read page structure + element refs
|
|
14
|
+
browse get text "body" # extract all visible text content
|
|
15
|
+
browse stop
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Parse the text output to extract structured data (name, price, description, etc.).
|
|
19
|
+
|
|
20
|
+
For a specific section, use a CSS selector:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
browse get text ".product-details" # text from a specific container
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Note**: `browse get text` requires a CSS selector — use `"body"` for all page text.
|
|
27
|
+
|
|
28
|
+
## Example 2: Fill and Submit a Form
|
|
29
|
+
|
|
30
|
+
**User request**: "Fill out the contact form on example.com with my information"
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
browse open https://example.com/contact
|
|
34
|
+
browse snapshot # find form fields and their refs
|
|
35
|
+
browse click @0-3 # click the Name input (ref from snapshot)
|
|
36
|
+
browse type "John Doe"
|
|
37
|
+
browse press Tab # move to next field
|
|
38
|
+
browse type "john@example.com"
|
|
39
|
+
browse fill "#message" "I would like to inquire about your services"
|
|
40
|
+
browse snapshot # verify fields are filled
|
|
41
|
+
browse click @0-8 # click Submit button (ref from snapshot)
|
|
42
|
+
browse snapshot # confirm submission result
|
|
43
|
+
browse stop
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Key pattern**: Use `browse snapshot` before interacting to discover element refs, then `browse click <ref>` and `browse type` to interact.
|
|
47
|
+
|
|
48
|
+
## Example 3: Multi-Step Navigation
|
|
49
|
+
|
|
50
|
+
**User request**: "Get headlines from the first 3 pages of results on example.com/news"
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
browse open https://example.com/news
|
|
54
|
+
browse snapshot # read page 1 content
|
|
55
|
+
browse get text ".headline" # extract headlines
|
|
56
|
+
|
|
57
|
+
browse snapshot # find "Next" button ref
|
|
58
|
+
browse click @0-12 # click Next (ref from snapshot)
|
|
59
|
+
browse wait load # wait for page 2 to load
|
|
60
|
+
browse get text ".headline" # extract page 2 headlines
|
|
61
|
+
|
|
62
|
+
browse snapshot # find Next again (ref may change)
|
|
63
|
+
browse click @0-15 # click Next
|
|
64
|
+
browse wait load
|
|
65
|
+
browse get text ".headline" # extract page 3 headlines
|
|
66
|
+
|
|
67
|
+
browse stop
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Key pattern**: Re-run `browse snapshot` after each navigation because element refs change when the page updates.
|
|
71
|
+
|
|
72
|
+
## Example 4: Escalate to Remote Mode
|
|
73
|
+
|
|
74
|
+
**User request**: "Scrape pricing from competitor.com" (a site with Cloudflare protection)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Attempt 1: local mode
|
|
78
|
+
browse open https://competitor.com/pricing --local
|
|
79
|
+
browse snapshot
|
|
80
|
+
# Output shows: "Checking your browser..." (Cloudflare interstitial)
|
|
81
|
+
# or: page content is empty / access denied
|
|
82
|
+
browse stop
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The agent detects bot protection and tells the user:
|
|
86
|
+
|
|
87
|
+
> This site has Cloudflare bot detection. Browserbase remote mode can use Browserbase Identity with a Verified browser and residential proxies. Want me to set it up?
|
|
88
|
+
|
|
89
|
+
If the user agrees:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Set Browserbase credentials
|
|
93
|
+
export BROWSERBASE_API_KEY="bb_live_..."
|
|
94
|
+
|
|
95
|
+
# Retry in remote mode
|
|
96
|
+
browse open https://competitor.com/pricing --remote
|
|
97
|
+
browse snapshot # full page content now accessible
|
|
98
|
+
browse get text ".pricing-table"
|
|
99
|
+
browse stop
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Example 5: Persist Login with Context ID
|
|
103
|
+
|
|
104
|
+
**User request**: "Log into my dashboard and save the session so I don't have to log in again next time"
|
|
105
|
+
|
|
106
|
+
This uses Browserbase contexts to persist cookies and storage across sessions. Requires remote mode.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Session 1: Log in and persist state
|
|
110
|
+
SESSION_JSON="$(browse cloud sessions create --context-id ctx_abc123 --persist --keep-alive)"
|
|
111
|
+
SESSION_ID="$(echo "$SESSION_JSON" | jq -r .id)"
|
|
112
|
+
CONNECT_URL="$(echo "$SESSION_JSON" | jq -r .connectUrl)"
|
|
113
|
+
|
|
114
|
+
browse open https://app.example.com/login --cdp "$CONNECT_URL"
|
|
115
|
+
browse snapshot # find login form fields
|
|
116
|
+
browse click @0-3 # click email input
|
|
117
|
+
browse type "user@example.com"
|
|
118
|
+
browse press Tab
|
|
119
|
+
browse type "my-password"
|
|
120
|
+
browse click @0-7 # click Sign In button
|
|
121
|
+
browse wait load
|
|
122
|
+
browse snapshot # confirm logged-in dashboard
|
|
123
|
+
browse stop
|
|
124
|
+
browse cloud sessions update "$SESSION_ID" --status REQUEST_RELEASE # state is saved back to ctx_abc123
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
In a later session, reuse the same context — already authenticated:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Session 2: Resume with saved state (already logged in)
|
|
131
|
+
SESSION_JSON="$(browse cloud sessions create --context-id ctx_abc123 --keep-alive)"
|
|
132
|
+
SESSION_ID="$(echo "$SESSION_JSON" | jq -r .id)"
|
|
133
|
+
CONNECT_URL="$(echo "$SESSION_JSON" | jq -r .connectUrl)"
|
|
134
|
+
|
|
135
|
+
browse open https://app.example.com/dashboard --cdp "$CONNECT_URL"
|
|
136
|
+
browse snapshot # dashboard loads — no login needed
|
|
137
|
+
browse get text ".welcome-message"
|
|
138
|
+
browse stop
|
|
139
|
+
browse cloud sessions update "$SESSION_ID" --status REQUEST_RELEASE
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Key pattern**: Use `browse cloud sessions create --context-id <id> --persist` for the first Browserbase session to save auth state, then attach with `browse open ... --cdp "$CONNECT_URL"`. On subsequent sessions, create with the same `--context-id` and omit `--persist` if you don't want changes saved back.
|
|
143
|
+
|
|
144
|
+
## Tips
|
|
145
|
+
|
|
146
|
+
- **Snapshot first**: Always run `browse snapshot` before interacting — it gives you the accessibility tree with element refs
|
|
147
|
+
- **Use refs to click**: `browse click @0-5` is more reliable than trying to describe elements
|
|
148
|
+
- **Re-snapshot after actions**: Element refs change when the page updates
|
|
149
|
+
- **`get text` for data extraction**: Use `browse get text [selector]` to pull text content from specific elements
|
|
150
|
+
- **`stop` when done**: Always `browse stop` to clean up the browser session
|
|
151
|
+
- **Prefer snapshot over screenshot**: Snapshot is fast and structured; screenshot is slow and uses vision tokens. Only screenshot when you need visual context (layout, images, debugging)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Browserbase, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
# Browser Automation CLI Reference
|
|
2
|
+
|
|
3
|
+
Technical reference for the `browse` CLI tool.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Architecture](#architecture)
|
|
8
|
+
- [Command Reference](#command-reference)
|
|
9
|
+
- [Navigation](#navigation)
|
|
10
|
+
- [Page State](#page-state)
|
|
11
|
+
- [Interaction](#interaction)
|
|
12
|
+
- [Session Management](#session-management)
|
|
13
|
+
- [JavaScript Evaluation](#javascript-evaluation)
|
|
14
|
+
- [Viewport](#viewport)
|
|
15
|
+
- [Network Capture](#network-capture)
|
|
16
|
+
- [Configuration](#configuration)
|
|
17
|
+
- [Global Flags](#global-flags)
|
|
18
|
+
- [Environment Variables](#environment-variables)
|
|
19
|
+
- [Error Messages](#error-messages)
|
|
20
|
+
|
|
21
|
+
## Architecture
|
|
22
|
+
|
|
23
|
+
The browse CLI is a **daemon-based** command-line tool:
|
|
24
|
+
|
|
25
|
+
- **Daemon process**: A background process manages the browser instance. Auto-starts on the first command (e.g., `browse open`), persists across commands, and stops with `browse stop`.
|
|
26
|
+
- **Local mode**: `browse open <url> --local` launches a clean isolated local browser. It is the default when `BROWSERBASE_API_KEY` is unset. Use `browse open <url> --auto-connect` to attach to an existing debuggable Chrome, or `browse open <url> --cdp <port|url>` to attach to a specific CDP target.
|
|
27
|
+
- **Remote mode** (Browserbase): Connects to a Browserbase cloud browser session when `BROWSERBASE_API_KEY` is set.
|
|
28
|
+
- **Accessibility-first**: Use `browse snapshot` to get the page's accessibility tree with element refs, then interact using those refs.
|
|
29
|
+
|
|
30
|
+
## Command Reference
|
|
31
|
+
|
|
32
|
+
### Navigation
|
|
33
|
+
|
|
34
|
+
#### `open <url>`
|
|
35
|
+
|
|
36
|
+
Navigate to a URL. Auto-starts the daemon if not running.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
browse open https://example.com
|
|
40
|
+
browse open https://example.com --wait networkidle # wait for all network requests to finish (useful for SPAs)
|
|
41
|
+
browse open https://example.com --wait domcontentloaded
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The `--wait` flag controls when navigation is considered complete. Values: `load` (default), `domcontentloaded`, `networkidle`. Use `networkidle` for JavaScript-heavy pages that fetch data after initial load.
|
|
45
|
+
|
|
46
|
+
##### Context persistence (remote mode only)
|
|
47
|
+
|
|
48
|
+
Create a Browserbase session with `browse cloud sessions create --context-id <id>`, then attach to its CDP endpoint with `browse open <url> --cdp <connectUrl>`. Add `--persist` to the cloud session if state changes should save back to the context.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
SESSION_JSON="$(browse cloud sessions create --context-id ctx_abc123 --persist --keep-alive)"
|
|
52
|
+
SESSION_ID="$(echo "$SESSION_JSON" | jq -r .id)"
|
|
53
|
+
CONNECT_URL="$(echo "$SESSION_JSON" | jq -r .connectUrl)"
|
|
54
|
+
|
|
55
|
+
browse open https://example.com --cdp "$CONNECT_URL"
|
|
56
|
+
# ...interact with the page...
|
|
57
|
+
browse stop
|
|
58
|
+
browse cloud sessions update "$SESSION_ID" --status REQUEST_RELEASE
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- `--context-id <id>` — Browserbase context ID to load when creating the cloud session.
|
|
62
|
+
- `--persist` — Save cookies/storage changes back to the context when the Browserbase session is released. Requires `--context-id`.
|
|
63
|
+
- `--keep-alive` — Keep the Browserbase session alive while the local browse daemon attaches and detaches.
|
|
64
|
+
- After `browse open ... --cdp "$CONNECT_URL"`, follow-up commands in that session do not repeat `--cdp`; the daemon remembers the attached target.
|
|
65
|
+
|
|
66
|
+
#### `reload`
|
|
67
|
+
|
|
68
|
+
Reload the current page.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
browse reload
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### `back` / `forward`
|
|
75
|
+
|
|
76
|
+
Navigate browser history.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
browse back
|
|
80
|
+
browse forward
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### Page State
|
|
86
|
+
|
|
87
|
+
#### `snapshot`
|
|
88
|
+
|
|
89
|
+
Get the accessibility tree with interactive element refs. This is the primary way to understand page structure.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
browse snapshot
|
|
93
|
+
browse snapshot --compact # tree only, no ref maps
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Returns a text representation of the page with refs like `@0-5` that can be passed to `click`. Use `--compact` for shorter output when you only need the tree.
|
|
97
|
+
|
|
98
|
+
#### `screenshot [path]`
|
|
99
|
+
|
|
100
|
+
Take a visual screenshot. Slower than snapshot and uses vision tokens.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
browse screenshot # print base64 JSON
|
|
104
|
+
browse screenshot --path ./capture.png # custom path
|
|
105
|
+
browse screenshot --full-page # capture entire scrollable page
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
#### `get <property> [selector]`
|
|
109
|
+
|
|
110
|
+
Get page properties. Available properties: `url`, `title`, `text`, `html`, `value`, `box`, `visible`, `checked`.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
browse get url # current URL
|
|
114
|
+
browse get title # page title
|
|
115
|
+
browse get text "body" # all visible text (selector required)
|
|
116
|
+
browse get text ".product-info" # text within a CSS selector
|
|
117
|
+
browse get html "#main" # inner HTML of an element
|
|
118
|
+
browse get value "#email-input" # value of a form field
|
|
119
|
+
browse get box "#header" # bounding box (centroid coordinates)
|
|
120
|
+
browse get visible ".modal" # check if element is visible
|
|
121
|
+
browse get checked "#agree" # check if checkbox/radio is checked
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Note**: `get text` requires a CSS selector argument — use `"body"` for full page text.
|
|
125
|
+
|
|
126
|
+
#### `refs`
|
|
127
|
+
|
|
128
|
+
Show the cached ref map from the last `browse snapshot`. Useful for looking up element refs without re-running a full snapshot.
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
browse refs
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### Interaction
|
|
137
|
+
|
|
138
|
+
#### `click <ref>`
|
|
139
|
+
|
|
140
|
+
Click an element by its ref from `browse snapshot` output.
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
browse click @0-5 # click element with ref 0-5
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
#### `click_xy <x> <y>`
|
|
147
|
+
|
|
148
|
+
Click at exact viewport coordinates.
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
browse click_xy 500 300
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### `hover <x> <y>`
|
|
155
|
+
|
|
156
|
+
Hover at viewport coordinates.
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
browse hover 500 300
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
#### `type <text>`
|
|
163
|
+
|
|
164
|
+
Type text into the currently focused element.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
browse type "Hello, world!"
|
|
168
|
+
browse type "slow typing" --delay 100 # 100ms between keystrokes
|
|
169
|
+
browse type "human-like" --mistakes # simulate human typing with typos
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
#### `fill <selector> <value>`
|
|
173
|
+
|
|
174
|
+
Fill an input element matching a CSS selector. Add `--press-enter` when Enter is needed.
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
browse fill "#search" "browser automation"
|
|
178
|
+
browse fill "input[name=email]" "user@example.com"
|
|
179
|
+
browse fill "#search" "query" --press-enter # fill and press Enter
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
#### `select <selector> <values...>`
|
|
183
|
+
|
|
184
|
+
Select option(s) from a dropdown.
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
browse select "#country" "United States"
|
|
188
|
+
browse select "#tags" "javascript" "typescript" # multi-select
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
#### `press <key>`
|
|
192
|
+
|
|
193
|
+
Press a keyboard key or key combination.
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
browse press Enter
|
|
197
|
+
browse press Tab
|
|
198
|
+
browse press Escape
|
|
199
|
+
browse press Cmd+A # select all (Mac)
|
|
200
|
+
browse press Ctrl+C # copy (Linux/Windows)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
#### `mouse scroll <x> <y> <deltaX> <deltaY>`
|
|
204
|
+
|
|
205
|
+
Scroll at a given position by a given amount.
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
browse mouse scroll 500 300 0 -300 # scroll up at (500, 300)
|
|
209
|
+
browse mouse scroll 500 300 0 500 # scroll down
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### `mouse drag <fromX> <fromY> <toX> <toY>`
|
|
213
|
+
|
|
214
|
+
Drag from one viewport coordinate to another.
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
browse mouse drag 80 80 310 100 # drag with default 10 steps
|
|
218
|
+
browse mouse drag 80 80 310 100 --steps 20 # more intermediate steps
|
|
219
|
+
browse mouse drag 80 80 310 100 --delay 50 # 50ms between steps
|
|
220
|
+
browse mouse drag 80 80 310 100 --button right # use right mouse button
|
|
221
|
+
browse mouse drag 80 80 310 100 --return-xpath # return source/target XPaths
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
#### `highlight <selector>`
|
|
225
|
+
|
|
226
|
+
Highlight an element on the page for visual debugging.
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
browse highlight "#submit-btn" # highlight for 2 seconds (default)
|
|
230
|
+
browse highlight ".nav" -d 5000 # highlight for 5 seconds
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
#### `is <check> <selector>`
|
|
234
|
+
|
|
235
|
+
Check element state. Available checks: `visible`, `checked`.
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
browse is visible ".modal" # returns { visible: true/false }
|
|
239
|
+
browse is checked "#agree" # returns { checked: true/false }
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
#### `wait <type> [arg]`
|
|
243
|
+
|
|
244
|
+
Wait for a condition.
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
browse wait load # wait for page load
|
|
248
|
+
browse wait "selector" ".results" # wait for element to appear
|
|
249
|
+
browse wait timeout 3000 # wait 3 seconds
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
### Session Management
|
|
255
|
+
|
|
256
|
+
#### `start`
|
|
257
|
+
|
|
258
|
+
Start the browser daemon manually. Usually not needed — the daemon auto-starts on first command.
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
browse start
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
#### `stop`
|
|
265
|
+
|
|
266
|
+
Stop the browser daemon and close the browser.
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
browse stop
|
|
270
|
+
browse stop --force # force kill if daemon is unresponsive
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
#### `status`
|
|
274
|
+
|
|
275
|
+
Check whether the daemon is running, its connection details, and current environment.
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
browse status
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
#### Starting sessions with a mode flag
|
|
282
|
+
|
|
283
|
+
Choose the browser target on the command that starts the session:
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
browse open https://example.com --local
|
|
287
|
+
browse open https://example.com --local --headed
|
|
288
|
+
browse open https://example.com --auto-connect
|
|
289
|
+
browse open https://example.com --cdp 9222
|
|
290
|
+
browse open https://example.com --cdp ws://localhost:9222/devtools/browser/...
|
|
291
|
+
browse open https://example.com --remote
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
- `browse status` shows the resolved mode and active target once the daemon is running.
|
|
295
|
+
- `browse stop` closes the current daemon session; the next `browse open` chooses mode from its flags or environment.
|
|
296
|
+
|
|
297
|
+
#### `tab new [url]`
|
|
298
|
+
|
|
299
|
+
Create a new tab, optionally navigating to a URL.
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
browse tab new # open blank tab
|
|
303
|
+
browse tab new https://example.com # open tab with URL
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
#### `tab list`
|
|
307
|
+
|
|
308
|
+
List all open tabs.
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
browse tab list
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
#### `tab switch <index-or-target-id>`
|
|
315
|
+
|
|
316
|
+
Switch to a tab by its index or target ID (from `browse tab list`).
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
browse tab switch 1
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
#### `tab close [index-or-target-id]`
|
|
323
|
+
|
|
324
|
+
Close a tab. Closes current tab if no index given. The CLI refuses to close the last remaining tab.
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
browse tab close # close current tab
|
|
328
|
+
browse tab close 2 # close tab at index 2
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
### JavaScript Evaluation
|
|
334
|
+
|
|
335
|
+
#### `eval <expression>`
|
|
336
|
+
|
|
337
|
+
Evaluate JavaScript in the page context.
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
browse eval "document.title"
|
|
341
|
+
browse eval "document.querySelectorAll('a').length"
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
### Viewport
|
|
347
|
+
|
|
348
|
+
#### `viewport <width> <height>`
|
|
349
|
+
|
|
350
|
+
Set the browser viewport size.
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
browse viewport 1920 1080
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
### Network Capture
|
|
359
|
+
|
|
360
|
+
Capture network requests to the filesystem for inspection.
|
|
361
|
+
|
|
362
|
+
#### `network on`
|
|
363
|
+
|
|
364
|
+
Enable network request capture. Creates a temp directory where requests and responses are saved as JSON files.
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
browse network on
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
#### `network off`
|
|
371
|
+
|
|
372
|
+
Disable network capture.
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
browse network off
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
#### `network path`
|
|
379
|
+
|
|
380
|
+
Show the capture directory path.
|
|
381
|
+
|
|
382
|
+
```bash
|
|
383
|
+
browse network path
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
#### `network clear`
|
|
387
|
+
|
|
388
|
+
Clear all captured requests.
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
browse network clear
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## Configuration
|
|
397
|
+
|
|
398
|
+
### Common Flags
|
|
399
|
+
|
|
400
|
+
#### `--session <name>`
|
|
401
|
+
|
|
402
|
+
Run commands against a named session, enabling multiple concurrent browsers.
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
browse open https://a.com --session work
|
|
406
|
+
browse open https://b.com --session personal
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
Context flags such as `--context-id` and `--persist` live on `browse cloud sessions create`; attach to the resulting `connectUrl` with `browse open ... --cdp <connectUrl>`.
|
|
410
|
+
|
|
411
|
+
### Environment Variables
|
|
412
|
+
|
|
413
|
+
| Variable | Required | Description |
|
|
414
|
+
|----------|----------|-------------|
|
|
415
|
+
| `BROWSE_SESSION` | No | Default session name (alternative to `--session`) |
|
|
416
|
+
| `BROWSERBASE_API_KEY` | For remote mode | API key from https://browserbase.com/settings; makes Browserbase the default desired mode when no override is set |
|
|
417
|
+
| `BROWSERBASE_PROJECT_ID` | No | Passed through to Browserbase when set |
|
|
418
|
+
|
|
419
|
+
Without an override, setting `BROWSERBASE_API_KEY` makes Browserbase the default desired mode. Otherwise the default desired mode is local. Use `--local`, `--remote`, `--auto-connect`, or `--cdp <port|url>` on `browse open` when you need an explicit target.
|
|
420
|
+
|
|
421
|
+
### Setting credentials
|
|
422
|
+
|
|
423
|
+
```bash
|
|
424
|
+
export BROWSERBASE_API_KEY="bb_live_..."
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
Get these values from https://browserbase.com/settings.
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## Error Messages
|
|
432
|
+
|
|
433
|
+
**"No active page"**
|
|
434
|
+
- The daemon is running but has no page open.
|
|
435
|
+
- Fix: Run `browse open <url>`. If the issue persists, run `browse stop` and retry. For zombie daemons: `pkill -f "browse.*daemon"`.
|
|
436
|
+
|
|
437
|
+
**"Chrome not found"** / **"Could not find local Chrome installation"**
|
|
438
|
+
- Chrome/Chromium is not installed or not in a standard location.
|
|
439
|
+
- Fix: Install Chrome, use `browse open <url> --auto-connect` if you already have a debuggable Chrome running, or switch to remote with `browse open <url> --remote` (no local browser needed).
|
|
440
|
+
|
|
441
|
+
**"Daemon not running"**
|
|
442
|
+
- No daemon process is active. Most commands auto-start the daemon, but `snapshot`, `click`, etc. require an active session.
|
|
443
|
+
- Fix: Run `browse open <url>` to start a session.
|
|
444
|
+
|
|
445
|
+
**Element ref not found (e.g., "@0-5")**
|
|
446
|
+
- The ref from a previous snapshot is no longer valid (page changed).
|
|
447
|
+
- Fix: Run `browse snapshot` again to get fresh refs.
|
|
448
|
+
|
|
449
|
+
**Timeout errors**
|
|
450
|
+
- The page took too long to load or an element didn't appear.
|
|
451
|
+
- Fix: Try `browse wait load` before interacting, or increase wait time.
|