@pasko70/pibo 1.9.13 → 1.10.0
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/README.md +183 -183
- package/context/codex-base-prompt.md +148 -148
- package/context/compute-worker.md +23 -23
- package/context/pibo-compaction-prompt.md +100 -100
- package/context/pibo-native-tooling.md +18 -18
- package/context/pibo-system-prompt.md +77 -77
- package/dist/apps/chat/agent-profiles.js +2 -2
- package/dist/apps/chat/agent-store.js +263 -250
- package/dist/apps/chat/chat-request-normalizers.js +10 -0
- package/dist/apps/chat/data/project-service.js +168 -168
- package/dist/apps/chat/data/read-state-service.js +18 -18
- package/dist/apps/chat/data/session-query-service.js +25 -25
- package/dist/apps/chat/data/timeline-query-service.js +19 -19
- package/dist/apps/chat/loop-api.js +176 -0
- package/dist/apps/chat/static-assets.js +854 -854
- package/dist/apps/chat/web-app.js +6 -6
- package/dist/apps/chat/workflow-manual-trigger-runtime.js +149 -46
- package/dist/apps/chat/workflow-persistence.js +255 -255
- package/dist/apps/chat-ui/assets/{dist-yCYNNb5d.js → dist-BwKObYnX.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-BCB6zezO.js → dist-CKtT8YGm.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-CnVsqwSG.js → dist-CS7wdk0Z.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-HqTN67dc.js → dist-D-cxLQO1.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-BNMu92bb.js → dist-DUlaXAk7.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-CzE6k3F3.js → dist-DlATLa-U.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-Dq4GxJi3.js → dist-GdEM8UW1.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-BZ2eTC4f.js → dist-LHRs1Nhr.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-D811wJeV.js → dist-Y-AA2omI.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-WyXdYl-w.js → dist-nOLTkZrJ.js} +1 -1
- package/dist/apps/chat-ui/assets/{dist-BHa-kcGl.js → dist-wE9nop9V.js} +1 -1
- package/dist/apps/chat-ui/assets/{index-DwHJfmiF.js → index-8W_yMHQI.js} +6 -6
- package/dist/apps/chat-ui/index.html +17 -17
- package/dist/apps/chat-ui/manifest.webmanifest +25 -25
- package/dist/apps/chat-ui/sw.js +47 -47
- package/dist/apps/chat-vscode-web/index.html +12 -12
- package/dist/apps/cli-ui/cliSessionsCommand.js +23 -23
- package/dist/apps/context-files-ui/index.html +11 -11
- package/dist/cli.js +61 -44
- package/dist/compute/cli.js +54 -54
- package/dist/core/routed-session.js +30 -1
- package/dist/core/runtime.js +6 -1
- package/dist/core/session-router.js +4 -2
- package/dist/cron/cli.js +15 -15
- package/dist/cron/store.js +49 -49
- package/dist/data/cli.js +23 -23
- package/dist/data/event-log.js +23 -23
- package/dist/data/message-store.js +27 -27
- package/dist/data/navigation-store.js +9 -9
- package/dist/data/observation-store.js +4 -4
- package/dist/data/payload-store.js +17 -17
- package/dist/data/schema.js +433 -433
- package/dist/data/session-store.js +4 -4
- package/dist/data/telemetry-queries.js +54 -54
- package/dist/data/telemetry.js +197 -197
- package/dist/debug/events.js +12 -12
- package/dist/debug/failures.js +6 -6
- package/dist/debug/index.js +227 -227
- package/dist/debug/messages.js +6 -6
- package/dist/debug/pty.js +124 -124
- package/dist/debug/session.js +29 -29
- package/dist/debug/tools.js +5 -5
- package/dist/debug/web-snapshot-browser-scripts.js +294 -294
- package/dist/debug/web-streaming-browser-library.js +925 -925
- package/dist/debug/web-streaming-browser-scripts.js +232 -232
- package/dist/debug/web-streaming-provider-telemetry.js +4 -4
- package/dist/debug/web.js +93 -93
- package/dist/gateway/cli.js +19 -19
- package/dist/gateway/server.js +4 -2
- package/dist/gateway/web.js +2 -2
- package/dist/loops/channel.js +8 -0
- package/dist/loops/cli.js +208 -0
- package/dist/loops/plugin.js +16 -0
- package/dist/loops/prompts.js +83 -0
- package/dist/loops/service.js +357 -0
- package/dist/loops/stopping.js +170 -0
- package/dist/loops/store.js +531 -0
- package/dist/loops/templates.js +232 -0
- package/dist/loops/tools.js +167 -0
- package/dist/loops/types.js +1 -0
- package/dist/mcp/config-command.js +53 -53
- package/dist/mcp/index.js +21 -21
- package/dist/mcp/registry.js +11 -11
- package/dist/pi-packages/cli.js +11 -11
- package/dist/plugins/builtin.js +8 -0
- package/dist/plugins/context-files-store.js +110 -110
- package/dist/plugins/context-files.js +4 -4
- package/dist/plugins/registry.js +23 -12
- package/dist/ralph/cli.js +18 -18
- package/dist/ralph/templates.js +140 -140
- package/dist/reliability/store.js +226 -226
- package/dist/sessions/pibo-data-store.js +16 -16
- package/dist/sessions/sqlite-store.js +53 -53
- package/dist/setup/cli.js +58 -58
- package/dist/tools/agent-browser-wrapper.js +80 -80
- package/dist/tools/browser-use-cdp.js +12 -12
- package/dist/tools/browser-use-wrapper.js +762 -762
- package/dist/tools/guides.js +589 -538
- package/dist/tools/index.js +122 -99
- package/dist/tools/registry.js +21 -3
- package/dist/tools/runtime/node-worker-source.js +205 -205
- package/dist/tools/runtime/python-worker-source.js +177 -177
- package/dist/vscode/cli.js +9 -9
- package/dist/web-annotations/cdp.js +900 -900
- package/dist/web-annotations/store.js +96 -96
- package/docs/README.md +23 -23
- package/docs/ops/install-developer-host.md +112 -112
- package/docs/ops/install-user-host.md +96 -96
- package/docs/ops/upgrade-user-to-developer-host.md +69 -69
- package/docs/ops/vscode-extension-release.md +160 -160
- package/package.json +98 -95
- package/skills/builtin/graphify/SKILL.md +52 -52
- package/skills/builtin/loop/SKILL.md +69 -0
- package/skills/builtin/pi-agent-harness/SKILL.md +319 -319
- package/skills/builtin/pi-agent-harness/agents/openai.yaml +4 -4
- package/skills/builtin/pibo-docker-system/SKILL.md +170 -170
- package/skills/builtin/pibo-spec-writing/SKILL.md +330 -330
- package/skills/builtin/prd/SKILL.md +143 -143
- package/skills/builtin/ralph-loop/SKILL.md +361 -359
- package/skills/builtin/ralph-prd-json/SKILL.md +123 -123
- package/skills/builtin/skill-creator/LICENSE.txt +201 -201
- package/skills/builtin/skill-creator/SKILL.md +513 -513
- package/skills/builtin/skill-creator/agents/analyzer.md +274 -274
- package/skills/builtin/skill-creator/agents/comparator.md +202 -202
- package/skills/builtin/skill-creator/agents/grader.md +223 -223
- package/skills/builtin/skill-creator/assets/eval_review.html +146 -146
- package/skills/builtin/skill-creator/eval-viewer/generate_review.py +471 -471
- package/skills/builtin/skill-creator/eval-viewer/viewer.html +1325 -1325
- package/skills/builtin/skill-creator/references/schemas.md +430 -430
- package/skills/builtin/skill-creator/scripts/aggregate_benchmark.py +401 -401
- package/skills/builtin/skill-creator/scripts/generate_report.py +326 -326
- package/skills/builtin/skill-creator/scripts/improve_description.py +247 -247
- package/skills/builtin/skill-creator/scripts/package_skill.py +136 -136
- package/skills/builtin/skill-creator/scripts/quick_validate.py +102 -102
- package/skills/builtin/skill-creator/scripts/run_eval.py +310 -310
- package/skills/builtin/skill-creator/scripts/run_loop.py +328 -328
- package/skills/builtin/skill-creator/scripts/utils.py +47 -47
- package/skills/builtin/web-annotations/SKILL.md +93 -93
- package/src/mcp/LICENSE.mcp-cli +21 -21
- package/dist/apps/vscode-artifacts/latest.vsix +0 -0
- package/dist/apps/vscode-artifacts/pibo-vscode-ext-1.9.13.vsix +0 -0
package/dist/tools/guides.js
CHANGED
|
@@ -1,563 +1,614 @@
|
|
|
1
|
+
export const LOOP_GUIDE = {
|
|
2
|
+
name: 'loop',
|
|
3
|
+
description: 'Create, inspect, and control Pibo Goal and legacy Ralph loops from the CLI.',
|
|
4
|
+
content: `---
|
|
5
|
+
name: loop
|
|
6
|
+
description: Creates and controls persistent Goal Loops and legacy fresh-session Ralph loops.
|
|
7
|
+
allowed-tools: Bash(pibo:*), Bash(npm:*)
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Loop CLI Tool
|
|
11
|
+
|
|
12
|
+
Use \`pibo loop\` as the standard continuous-work CLI. Goal mode is the default and continues one Pibo Session across turns. Use \`--mode ralph\` or \`pibo ralph\` only for legacy fresh-session runs.
|
|
13
|
+
|
|
14
|
+
## Discover
|
|
15
|
+
|
|
16
|
+
\`\`\`bash
|
|
17
|
+
pibo loop --help
|
|
18
|
+
pibo loop add --help
|
|
19
|
+
pibo loop templates --json
|
|
20
|
+
pibo loop conditions
|
|
21
|
+
\`\`\`
|
|
22
|
+
|
|
23
|
+
## Create a Goal Loop
|
|
24
|
+
|
|
25
|
+
\`\`\`bash
|
|
26
|
+
pibo loop add \\
|
|
27
|
+
--room <room-id> \\
|
|
28
|
+
--profile <profile> \\
|
|
29
|
+
--prompt "<complete objective>" \\
|
|
30
|
+
--token-budget <optional-positive-token-count> \\
|
|
31
|
+
--max-iterations <optional-run-fallback> \\
|
|
32
|
+
--start
|
|
33
|
+
\`\`\`
|
|
34
|
+
|
|
35
|
+
Goal-capable agents use native \`get_goal\`, \`create_goal\`, and \`update_goal\` tools. Agent Designer can disable the default-enabled \`pibo-goal-control\` package.
|
|
36
|
+
|
|
37
|
+
Use \`update_goal\` with \`complete\` only after current evidence proves every requirement. Use \`blocked\` only after the same impasse repeats for at least three consecutive Goal turns and progress requires user input or external change.
|
|
38
|
+
|
|
39
|
+
## Inspect and Control
|
|
40
|
+
|
|
41
|
+
\`\`\`bash
|
|
42
|
+
pibo loop list --all --json
|
|
43
|
+
pibo loop runs --job <job-id> --json
|
|
44
|
+
pibo loop start <job-id>
|
|
45
|
+
pibo loop stop <job-id>
|
|
46
|
+
pibo loop cancel <job-id>
|
|
47
|
+
\`\`\`
|
|
48
|
+
|
|
49
|
+
Token budgets count usage reported by completed assistant model messages. One request can overshoot because usage is known after the response returns.
|
|
50
|
+
`,
|
|
51
|
+
};
|
|
1
52
|
export const RALPH_GUIDE = {
|
|
2
53
|
name: 'ralph',
|
|
3
54
|
description: 'Create, inspect, and control Pibo Ralph jobs from the CLI.',
|
|
4
|
-
content: `---
|
|
5
|
-
name: ralph
|
|
6
|
-
description: Creates and controls continuous Pibo agent jobs for implementation loops, bug fixing, validation, and PRD/story execution.
|
|
7
|
-
allowed-tools: Bash(pibo:*), Bash(npm:*)
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Ralph CLI Tool
|
|
11
|
-
|
|
12
|
-
Ralph runs repeatable Pibo agent jobs. Use it when the user wants an implementation loop, PRD/story execution, bug fixing, validation, or a background job that can be started, stopped, inspected, and resumed.
|
|
13
|
-
|
|
14
|
-
## Required Context
|
|
15
|
-
|
|
16
|
-
Ralph jobs are app-global. Choose either:
|
|
17
|
-
|
|
18
|
-
- room target: \`--room <current-room-id>\`
|
|
19
|
-
- shared default target: \`--default-chat\`
|
|
20
|
-
|
|
21
|
-
Inside the Pibo source repo, use \`npm run --silent dev -- ralph ...\` for uninstalled local changes. For the installed CLI, use \`pibo ralph ...\`.
|
|
22
|
-
|
|
23
|
-
## Discover Templates
|
|
24
|
-
|
|
25
|
-
\`\`\`bash
|
|
26
|
-
pibo ralph templates
|
|
27
|
-
pibo ralph templates --json
|
|
28
|
-
pibo tools guide ralph ralph
|
|
29
|
-
\`\`\`
|
|
30
|
-
|
|
31
|
-
Good defaults:
|
|
32
|
-
|
|
33
|
-
- \`prd-single-story-standard\`: one failing PRD story per run; promise-complete stop policy.
|
|
34
|
-
- \`prd-batch-stories\`: multiple PRD stories in priority order; commit after each story.
|
|
35
|
-
- \`single-run-objective\`: one focused non-PRD objective; stops after one completed run attempt.
|
|
36
|
-
|
|
37
|
-
## Create Jobs
|
|
38
|
-
|
|
39
|
-
Create stopped, inspect, then start:
|
|
40
|
-
|
|
41
|
-
\`\`\`bash
|
|
42
|
-
pibo ralph add \\
|
|
43
|
-
--room "<room-id>" \\
|
|
44
|
-
--template prd-single-story-standard \\
|
|
45
|
-
--name "Implement story X" \\
|
|
46
|
-
--prompt "Implement exactly one failing PRD story, test it, and commit." \\
|
|
47
|
-
--json
|
|
48
|
-
|
|
49
|
-
pibo ralph start <job-id>
|
|
50
|
-
\`\`\`
|
|
51
|
-
|
|
52
|
-
Create and start immediately:
|
|
53
|
-
|
|
54
|
-
\`\`\`bash
|
|
55
|
-
pibo ralph add \\
|
|
56
|
-
--room "<room-id>" \\
|
|
57
|
-
--template single-run-objective \\
|
|
58
|
-
--name "Fix bug Y" \\
|
|
59
|
-
--prompt "Reproduce and fix bug Y, then run focused tests." \\
|
|
60
|
-
--start \\
|
|
61
|
-
--json
|
|
62
|
-
\`\`\`
|
|
63
|
-
|
|
64
|
-
Explicit options override template fields.
|
|
65
|
-
|
|
66
|
-
Runtime overrides are optional and apply to sessions created by the job:
|
|
67
|
-
|
|
68
|
-
\`\`\`bash
|
|
69
|
-
pibo ralph add \\
|
|
70
|
-
--room "<room-id>" \\
|
|
71
|
-
--prompt "Use a specific runtime." \\
|
|
72
|
-
--model openai/gpt-5 \\
|
|
73
|
-
--thinking high \\
|
|
74
|
-
--fast \\
|
|
75
|
-
--json
|
|
76
|
-
|
|
77
|
-
pibo ralph edit <job-id> --model openai/gpt-5 --thinking medium --no-fast --json
|
|
78
|
-
pibo ralph edit <job-id> --clear-model --clear-thinking --clear-fast --json
|
|
79
|
-
\`\`\`
|
|
80
|
-
|
|
81
|
-
Use \`--model <provider/model>\`, \`--thinking off|minimal|low|medium|high|xhigh|max\`, and \`--fast\`/\`--no-fast\` to set runtime options. Use the \`--clear-*\` flags on \`edit\` to return to profile/default runtime behavior.
|
|
82
|
-
|
|
83
|
-
## Inspect and Debug
|
|
84
|
-
|
|
85
|
-
\`\`\`bash
|
|
86
|
-
pibo ralph status --json
|
|
87
|
-
pibo ralph list --all --json
|
|
88
|
-
pibo ralph runs --job <job-id> --json
|
|
89
|
-
pibo ralph policy show <job-id> --json
|
|
90
|
-
\`\`\`
|
|
91
|
-
|
|
92
|
-
Use \`runs --json\` to debug failures, session ids, completion state, and recent activity. Prefer bounded JSON output when another agent will parse it.
|
|
93
|
-
|
|
94
|
-
## Control Jobs
|
|
95
|
-
|
|
96
|
-
\`\`\`bash
|
|
97
|
-
pibo ralph stop <job-id> # finish current session, then stop
|
|
98
|
-
pibo ralph cancel <job-id> # abort current session and stop
|
|
99
|
-
pibo ralph edit <job-id> --prompt "Updated objective" --json
|
|
100
|
-
pibo ralph remove <job-id>
|
|
101
|
-
\`\`\`
|
|
102
|
-
|
|
103
|
-
Prefer \`stop\` for normal shutdown and \`cancel\` only when the active run is stuck or unsafe.
|
|
104
|
-
|
|
105
|
-
## Safety
|
|
106
|
-
|
|
107
|
-
1. Do not start many Ralph jobs unless the user asked for parallel work.
|
|
108
|
-
2. Use templates first; avoid ad-hoc long prompts when a preset fits.
|
|
109
|
-
3. Inspect with \`list --json\` and \`runs --json\` before editing or canceling an unknown job.
|
|
110
|
-
4. If working in the source repo before install, use \`npm run --silent dev -- ralph ...\`.
|
|
55
|
+
content: `---
|
|
56
|
+
name: ralph
|
|
57
|
+
description: Creates and controls continuous Pibo agent jobs for implementation loops, bug fixing, validation, and PRD/story execution.
|
|
58
|
+
allowed-tools: Bash(pibo:*), Bash(npm:*)
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
# Ralph CLI Tool
|
|
62
|
+
|
|
63
|
+
Ralph runs repeatable Pibo agent jobs. Use it when the user wants an implementation loop, PRD/story execution, bug fixing, validation, or a background job that can be started, stopped, inspected, and resumed.
|
|
64
|
+
|
|
65
|
+
## Required Context
|
|
66
|
+
|
|
67
|
+
Ralph jobs are app-global. Choose either:
|
|
68
|
+
|
|
69
|
+
- room target: \`--room <current-room-id>\`
|
|
70
|
+
- shared default target: \`--default-chat\`
|
|
71
|
+
|
|
72
|
+
Inside the Pibo source repo, use \`npm run --silent dev -- ralph ...\` for uninstalled local changes. For the installed CLI, use \`pibo ralph ...\`.
|
|
73
|
+
|
|
74
|
+
## Discover Templates
|
|
75
|
+
|
|
76
|
+
\`\`\`bash
|
|
77
|
+
pibo ralph templates
|
|
78
|
+
pibo ralph templates --json
|
|
79
|
+
pibo tools guide ralph ralph
|
|
80
|
+
\`\`\`
|
|
81
|
+
|
|
82
|
+
Good defaults:
|
|
83
|
+
|
|
84
|
+
- \`prd-single-story-standard\`: one failing PRD story per run; promise-complete stop policy.
|
|
85
|
+
- \`prd-batch-stories\`: multiple PRD stories in priority order; commit after each story.
|
|
86
|
+
- \`single-run-objective\`: one focused non-PRD objective; stops after one completed run attempt.
|
|
87
|
+
|
|
88
|
+
## Create Jobs
|
|
89
|
+
|
|
90
|
+
Create stopped, inspect, then start:
|
|
91
|
+
|
|
92
|
+
\`\`\`bash
|
|
93
|
+
pibo ralph add \\
|
|
94
|
+
--room "<room-id>" \\
|
|
95
|
+
--template prd-single-story-standard \\
|
|
96
|
+
--name "Implement story X" \\
|
|
97
|
+
--prompt "Implement exactly one failing PRD story, test it, and commit." \\
|
|
98
|
+
--json
|
|
99
|
+
|
|
100
|
+
pibo ralph start <job-id>
|
|
101
|
+
\`\`\`
|
|
102
|
+
|
|
103
|
+
Create and start immediately:
|
|
104
|
+
|
|
105
|
+
\`\`\`bash
|
|
106
|
+
pibo ralph add \\
|
|
107
|
+
--room "<room-id>" \\
|
|
108
|
+
--template single-run-objective \\
|
|
109
|
+
--name "Fix bug Y" \\
|
|
110
|
+
--prompt "Reproduce and fix bug Y, then run focused tests." \\
|
|
111
|
+
--start \\
|
|
112
|
+
--json
|
|
113
|
+
\`\`\`
|
|
114
|
+
|
|
115
|
+
Explicit options override template fields.
|
|
116
|
+
|
|
117
|
+
Runtime overrides are optional and apply to sessions created by the job:
|
|
118
|
+
|
|
119
|
+
\`\`\`bash
|
|
120
|
+
pibo ralph add \\
|
|
121
|
+
--room "<room-id>" \\
|
|
122
|
+
--prompt "Use a specific runtime." \\
|
|
123
|
+
--model openai/gpt-5 \\
|
|
124
|
+
--thinking high \\
|
|
125
|
+
--fast \\
|
|
126
|
+
--json
|
|
127
|
+
|
|
128
|
+
pibo ralph edit <job-id> --model openai/gpt-5 --thinking medium --no-fast --json
|
|
129
|
+
pibo ralph edit <job-id> --clear-model --clear-thinking --clear-fast --json
|
|
130
|
+
\`\`\`
|
|
131
|
+
|
|
132
|
+
Use \`--model <provider/model>\`, \`--thinking off|minimal|low|medium|high|xhigh|max\`, and \`--fast\`/\`--no-fast\` to set runtime options. Use the \`--clear-*\` flags on \`edit\` to return to profile/default runtime behavior.
|
|
133
|
+
|
|
134
|
+
## Inspect and Debug
|
|
135
|
+
|
|
136
|
+
\`\`\`bash
|
|
137
|
+
pibo ralph status --json
|
|
138
|
+
pibo ralph list --all --json
|
|
139
|
+
pibo ralph runs --job <job-id> --json
|
|
140
|
+
pibo ralph policy show <job-id> --json
|
|
141
|
+
\`\`\`
|
|
142
|
+
|
|
143
|
+
Use \`runs --json\` to debug failures, session ids, completion state, and recent activity. Prefer bounded JSON output when another agent will parse it.
|
|
144
|
+
|
|
145
|
+
## Control Jobs
|
|
146
|
+
|
|
147
|
+
\`\`\`bash
|
|
148
|
+
pibo ralph stop <job-id> # finish current session, then stop
|
|
149
|
+
pibo ralph cancel <job-id> # abort current session and stop
|
|
150
|
+
pibo ralph edit <job-id> --prompt "Updated objective" --json
|
|
151
|
+
pibo ralph remove <job-id>
|
|
152
|
+
\`\`\`
|
|
153
|
+
|
|
154
|
+
Prefer \`stop\` for normal shutdown and \`cancel\` only when the active run is stuck or unsafe.
|
|
155
|
+
|
|
156
|
+
## Safety
|
|
157
|
+
|
|
158
|
+
1. Do not start many Ralph jobs unless the user asked for parallel work.
|
|
159
|
+
2. Use templates first; avoid ad-hoc long prompts when a preset fits.
|
|
160
|
+
3. Inspect with \`list --json\` and \`runs --json\` before editing or canceling an unknown job.
|
|
161
|
+
4. If working in the source repo before install, use \`npm run --silent dev -- ralph ...\`.
|
|
111
162
|
`,
|
|
112
163
|
};
|
|
113
164
|
export const AGENT_BROWSER_GUIDE = {
|
|
114
165
|
name: 'agent-browser',
|
|
115
166
|
description: 'Ref-based browser automation with the Agent Browser CLI.',
|
|
116
|
-
content: `---
|
|
117
|
-
name: agent-browser
|
|
118
|
-
description: Fast native browser automation CLI for AI agents. Use when you need to open pages, inspect snapshots, click refs, fill fields, and keep browser state under a Pibo-owned tool home.
|
|
119
|
-
allowed-tools: Bash(agent-browser:*)
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
# Browser Automation with Agent Browser
|
|
123
|
-
|
|
124
|
-
Agent Browser uses refs from interactive snapshots. Inspect first, act on refs, then inspect again after navigation or DOM changes.
|
|
125
|
-
|
|
126
|
-
## Prerequisites
|
|
127
|
-
|
|
128
|
-
Initialize one shell with the Pibo tool environment:
|
|
129
|
-
|
|
130
|
-
\`\`\`bash
|
|
131
|
-
eval "$(pibo tools env agent-browser)"
|
|
132
|
-
agent-browser doctor --offline --quick
|
|
133
|
-
\`\`\`
|
|
134
|
-
|
|
135
|
-
Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env agent-browser)"\`. The Pibo wrapper comes first on \`PATH\` and keeps state under \`AGENT_BROWSER_HOME\`, normally \`$PIBO_HOME/tools/agent-browser/home\`. For \`agent-browser@0.27.0\`, the wrapper also redirects \`HOME\` there by default so \`~/.agent-browser\` stays inside the tool home.
|
|
136
|
-
|
|
137
|
-
## Core Workflow
|
|
138
|
-
|
|
139
|
-
\`\`\`bash
|
|
140
|
-
agent-browser open <url>
|
|
141
|
-
agent-browser snapshot -i
|
|
142
|
-
agent-browser click @e1
|
|
143
|
-
agent-browser fill @e2 "text"
|
|
144
|
-
agent-browser snapshot -i
|
|
145
|
-
agent-browser get title
|
|
146
|
-
agent-browser close --all
|
|
147
|
-
\`\`\`
|
|
148
|
-
|
|
149
|
-
Re-run \`snapshot -i\` after navigation, submit, scroll, animation, or any DOM-changing action. Do not reuse stale refs.
|
|
150
|
-
|
|
151
|
-
## Sessions
|
|
152
|
-
|
|
153
|
-
Use sessions for separate browser tasks:
|
|
154
|
-
|
|
155
|
-
\`\`\`bash
|
|
156
|
-
agent-browser --session pibo-check open https://example.com
|
|
157
|
-
AGENT_BROWSER_SESSION=pibo-check agent-browser snapshot -i
|
|
158
|
-
agent-browser session list
|
|
159
|
-
\`\`\`
|
|
160
|
-
|
|
161
|
-
Keep mutating commands against the same session serial. Avoid parallel \`click\`, \`fill\`, \`open\`, or \`snapshot\` calls for one session.
|
|
162
|
-
|
|
163
|
-
## State and Profiles
|
|
164
|
-
|
|
165
|
-
The wrapper defaults browser-launching commands to a persistent Pibo profile:
|
|
166
|
-
|
|
167
|
-
\`\`\`bash
|
|
168
|
-
agent-browser open https://example.com
|
|
169
|
-
\`\`\`
|
|
170
|
-
|
|
171
|
-
Opt out when needed:
|
|
172
|
-
|
|
173
|
-
\`\`\`bash
|
|
174
|
-
agent-browser --fresh-profile open https://example.com
|
|
175
|
-
agent-browser --profile /path/to/profile open https://example.com
|
|
176
|
-
agent-browser --session-name saved-check open https://example.com
|
|
177
|
-
\`\`\`
|
|
178
|
-
|
|
179
|
-
Treat profiles, saved states, auth vaults, cookies, and headers as secrets. Do not print or copy their contents into chat.
|
|
180
|
-
|
|
181
|
-
## Authenticated Chat Web Work
|
|
182
|
-
|
|
183
|
-
Prefer isolated leases when more than one agent may use authenticated Chat Web:
|
|
184
|
-
|
|
185
|
-
\`\`\`bash
|
|
186
|
-
eval "$(pibo tools agent-browser lease acquire --app pibo-chat --holder "$USER")"
|
|
187
|
-
agent-browser open http://4788.192.168.0.204.sslip.io/apps/chat
|
|
188
|
-
agent-browser snapshot -i
|
|
189
|
-
\`\`\`
|
|
190
|
-
|
|
191
|
-
To prepare the reusable template profile:
|
|
192
|
-
|
|
193
|
-
\`\`\`bash
|
|
194
|
-
eval "$(pibo tools agent-browser auth-template env --app pibo-chat)"
|
|
195
|
-
agent-browser open http://4788.192.168.0.204.sslip.io/apps/chat
|
|
196
|
-
\`\`\`
|
|
197
|
-
|
|
198
|
-
Sign in once, close the browser, then acquire leases from the template.
|
|
199
|
-
|
|
200
|
-
For an already-open browser, inspect CDP targets:
|
|
201
|
-
|
|
202
|
-
\`\`\`bash
|
|
203
|
-
pibo tools agent-browser targets
|
|
204
|
-
pibo tools agent-browser attach-chat
|
|
205
|
-
\`\`\`
|
|
206
|
-
|
|
207
|
-
## Upstream Skills
|
|
208
|
-
|
|
209
|
-
Pibo keeps the full upstream skill out of default runtime context. Fetch it only when needed:
|
|
210
|
-
|
|
211
|
-
\`\`\`bash
|
|
212
|
-
agent-browser skills get core --full
|
|
213
|
-
\`\`\`
|
|
167
|
+
content: `---
|
|
168
|
+
name: agent-browser
|
|
169
|
+
description: Fast native browser automation CLI for AI agents. Use when you need to open pages, inspect snapshots, click refs, fill fields, and keep browser state under a Pibo-owned tool home.
|
|
170
|
+
allowed-tools: Bash(agent-browser:*)
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
# Browser Automation with Agent Browser
|
|
174
|
+
|
|
175
|
+
Agent Browser uses refs from interactive snapshots. Inspect first, act on refs, then inspect again after navigation or DOM changes.
|
|
176
|
+
|
|
177
|
+
## Prerequisites
|
|
178
|
+
|
|
179
|
+
Initialize one shell with the Pibo tool environment:
|
|
180
|
+
|
|
181
|
+
\`\`\`bash
|
|
182
|
+
eval "$(pibo tools env agent-browser)"
|
|
183
|
+
agent-browser doctor --offline --quick
|
|
184
|
+
\`\`\`
|
|
185
|
+
|
|
186
|
+
Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env agent-browser)"\`. The Pibo wrapper comes first on \`PATH\` and keeps state under \`AGENT_BROWSER_HOME\`, normally \`$PIBO_HOME/tools/agent-browser/home\`. For \`agent-browser@0.27.0\`, the wrapper also redirects \`HOME\` there by default so \`~/.agent-browser\` stays inside the tool home.
|
|
187
|
+
|
|
188
|
+
## Core Workflow
|
|
189
|
+
|
|
190
|
+
\`\`\`bash
|
|
191
|
+
agent-browser open <url>
|
|
192
|
+
agent-browser snapshot -i
|
|
193
|
+
agent-browser click @e1
|
|
194
|
+
agent-browser fill @e2 "text"
|
|
195
|
+
agent-browser snapshot -i
|
|
196
|
+
agent-browser get title
|
|
197
|
+
agent-browser close --all
|
|
198
|
+
\`\`\`
|
|
199
|
+
|
|
200
|
+
Re-run \`snapshot -i\` after navigation, submit, scroll, animation, or any DOM-changing action. Do not reuse stale refs.
|
|
201
|
+
|
|
202
|
+
## Sessions
|
|
203
|
+
|
|
204
|
+
Use sessions for separate browser tasks:
|
|
205
|
+
|
|
206
|
+
\`\`\`bash
|
|
207
|
+
agent-browser --session pibo-check open https://example.com
|
|
208
|
+
AGENT_BROWSER_SESSION=pibo-check agent-browser snapshot -i
|
|
209
|
+
agent-browser session list
|
|
210
|
+
\`\`\`
|
|
211
|
+
|
|
212
|
+
Keep mutating commands against the same session serial. Avoid parallel \`click\`, \`fill\`, \`open\`, or \`snapshot\` calls for one session.
|
|
213
|
+
|
|
214
|
+
## State and Profiles
|
|
215
|
+
|
|
216
|
+
The wrapper defaults browser-launching commands to a persistent Pibo profile:
|
|
217
|
+
|
|
218
|
+
\`\`\`bash
|
|
219
|
+
agent-browser open https://example.com
|
|
220
|
+
\`\`\`
|
|
221
|
+
|
|
222
|
+
Opt out when needed:
|
|
223
|
+
|
|
224
|
+
\`\`\`bash
|
|
225
|
+
agent-browser --fresh-profile open https://example.com
|
|
226
|
+
agent-browser --profile /path/to/profile open https://example.com
|
|
227
|
+
agent-browser --session-name saved-check open https://example.com
|
|
228
|
+
\`\`\`
|
|
229
|
+
|
|
230
|
+
Treat profiles, saved states, auth vaults, cookies, and headers as secrets. Do not print or copy their contents into chat.
|
|
231
|
+
|
|
232
|
+
## Authenticated Chat Web Work
|
|
233
|
+
|
|
234
|
+
Prefer isolated leases when more than one agent may use authenticated Chat Web:
|
|
235
|
+
|
|
236
|
+
\`\`\`bash
|
|
237
|
+
eval "$(pibo tools agent-browser lease acquire --app pibo-chat --holder "$USER")"
|
|
238
|
+
agent-browser open http://4788.192.168.0.204.sslip.io/apps/chat
|
|
239
|
+
agent-browser snapshot -i
|
|
240
|
+
\`\`\`
|
|
241
|
+
|
|
242
|
+
To prepare the reusable template profile:
|
|
243
|
+
|
|
244
|
+
\`\`\`bash
|
|
245
|
+
eval "$(pibo tools agent-browser auth-template env --app pibo-chat)"
|
|
246
|
+
agent-browser open http://4788.192.168.0.204.sslip.io/apps/chat
|
|
247
|
+
\`\`\`
|
|
248
|
+
|
|
249
|
+
Sign in once, close the browser, then acquire leases from the template.
|
|
250
|
+
|
|
251
|
+
For an already-open browser, inspect CDP targets:
|
|
252
|
+
|
|
253
|
+
\`\`\`bash
|
|
254
|
+
pibo tools agent-browser targets
|
|
255
|
+
pibo tools agent-browser attach-chat
|
|
256
|
+
\`\`\`
|
|
257
|
+
|
|
258
|
+
## Upstream Skills
|
|
259
|
+
|
|
260
|
+
Pibo keeps the full upstream skill out of default runtime context. Fetch it only when needed:
|
|
261
|
+
|
|
262
|
+
\`\`\`bash
|
|
263
|
+
agent-browser skills get core --full
|
|
264
|
+
\`\`\`
|
|
214
265
|
`,
|
|
215
266
|
};
|
|
216
267
|
export const BROWSER_USE_GUIDE = {
|
|
217
268
|
name: 'browser-use',
|
|
218
269
|
description: 'Local browser automation with the browser-use CLI.',
|
|
219
|
-
content: `---
|
|
220
|
-
name: browser-use
|
|
221
|
-
description: Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, or extract information from web pages.
|
|
222
|
-
allowed-tools: Bash(browser-use:*)
|
|
223
|
-
---
|
|
224
|
-
|
|
225
|
-
# Browser Automation with browser-use CLI
|
|
226
|
-
|
|
227
|
-
The browser-use command provides persistent browser automation. A background daemon keeps the browser open across commands, so repeated commands are fast.
|
|
228
|
-
|
|
229
|
-
## Prerequisites
|
|
230
|
-
|
|
231
|
-
Initialize one persistent browser-use shell by applying the Pibo tool environment once:
|
|
232
|
-
|
|
233
|
-
\`\`\`bash
|
|
234
|
-
eval "$(pibo tools env browser-use)"
|
|
235
|
-
browser-use doctor
|
|
236
|
-
\`\`\`
|
|
237
|
-
|
|
238
|
-
Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env browser-use)"\` instead. Keep running later \`browser-use\` commands in that same shell; a new shell needs the one-time initialization again. If command substitution is not available, run the env command and apply the printed exports manually. On Linux, it includes detected desktop variables such as \`DISPLAY\`, \`WAYLAND_DISPLAY\`, and \`XAUTHORITY\` when a local desktop is available.
|
|
239
|
-
|
|
240
|
-
The Pibo tool environment wraps \`browser-use\`: when a new browser daemon session is started, it starts a Pibo-managed persistent Chrome profile named \`PIBo\` with CDP and connects Browser Use to it. This avoids Browser Use's normal temporary profile copy, so sign-ins made in that profile stay on disk. Pass \`--fresh-profile\` to start a fresh temporary browser profile instead.
|
|
241
|
-
|
|
242
|
-
## Core Workflow
|
|
243
|
-
|
|
244
|
-
1. Navigate: \`browser-use --headed --session NAME open <url>\` when a desktop is available; otherwise use \`browser-use --session NAME open <url>\`
|
|
245
|
-
2. Inspect: \`browser-use state\`
|
|
246
|
-
3. Interact with indices from state: \`browser-use click 5\`, \`browser-use input 3 "text"\`
|
|
247
|
-
4. Verify: \`browser-use state\`, \`browser-use get value <index>\`, \`browser-use eval "js"\`, or \`browser-use screenshot\`
|
|
248
|
-
5. Repeat while the browser stays open
|
|
249
|
-
|
|
250
|
-
Run browser-mutating commands one at a time per session. Do not issue parallel \`click\`, \`input\`, \`open\`, \`eval\`, or \`screenshot\` calls against the same session.
|
|
251
|
-
|
|
252
|
-
If a command fails, run \`browser-use close\` first to clear the session, then retry.
|
|
253
|
-
|
|
254
|
-
After navigation, submit, keypress navigation, major DOM changes, or scroll on complex pages, run \`state\` again before reusing element indices.
|
|
255
|
-
|
|
256
|
-
## Browser Modes
|
|
257
|
-
|
|
258
|
-
\`\`\`bash
|
|
259
|
-
browser-use --headed open <url> # Starts Pibo-managed persistent PIBo Chrome via CDP
|
|
260
|
-
browser-use --fresh-profile open <url> # Starts a fresh temporary browser profile
|
|
261
|
-
browser-use --connect open <url> # Connect to local Chrome via CDP (requires --remote-debugging-port)
|
|
262
|
-
browser-use --profile "Default" open <url> # Upstream profile mode; Browser Use may copy it to a temp dir
|
|
263
|
-
\`\`\`
|
|
264
|
-
|
|
265
|
-
## Commands
|
|
266
|
-
|
|
267
|
-
\`\`\`bash
|
|
268
|
-
# Navigation
|
|
269
|
-
browser-use open <url>
|
|
270
|
-
browser-use back
|
|
271
|
-
browser-use scroll down
|
|
272
|
-
browser-use scroll up
|
|
273
|
-
browser-use switch <index>
|
|
274
|
-
browser-use close-tab [index]
|
|
275
|
-
|
|
276
|
-
# Page state
|
|
277
|
-
browser-use state
|
|
278
|
-
browser-use screenshot [path.png]
|
|
279
|
-
browser-use screenshot --full path.png
|
|
280
|
-
|
|
281
|
-
# Interactions
|
|
282
|
-
browser-use click <index>
|
|
283
|
-
browser-use click <x> <y>
|
|
284
|
-
browser-use type "text"
|
|
285
|
-
browser-use input <index> "text"
|
|
286
|
-
browser-use input <index> ""
|
|
287
|
-
browser-use keys "Enter"
|
|
288
|
-
browser-use keys "Control+a"
|
|
289
|
-
browser-use select <index> "option"
|
|
290
|
-
browser-use upload <index> <path>
|
|
291
|
-
browser-use hover <index>
|
|
292
|
-
browser-use dblclick <index>
|
|
293
|
-
browser-use rightclick <index>
|
|
294
|
-
|
|
295
|
-
# Data extraction
|
|
296
|
-
browser-use eval "js code"
|
|
297
|
-
browser-use get title
|
|
298
|
-
browser-use get html
|
|
299
|
-
browser-use get html --selector "h1"
|
|
300
|
-
browser-use get text <index>
|
|
301
|
-
browser-use get value <index>
|
|
302
|
-
browser-use get attributes <index>
|
|
303
|
-
browser-use get bbox <index>
|
|
304
|
-
|
|
305
|
-
# Wait
|
|
306
|
-
browser-use wait selector "css"
|
|
307
|
-
browser-use wait text "Success"
|
|
308
|
-
|
|
309
|
-
# Cookies
|
|
310
|
-
browser-use cookies get
|
|
311
|
-
browser-use cookies get --url <url>
|
|
312
|
-
browser-use cookies set <name> <value>
|
|
313
|
-
browser-use cookies clear
|
|
314
|
-
browser-use cookies export <file>
|
|
315
|
-
browser-use cookies import <file>
|
|
316
|
-
|
|
317
|
-
# Session
|
|
318
|
-
browser-use close
|
|
319
|
-
browser-use sessions
|
|
320
|
-
browser-use close --all
|
|
321
|
-
\`\`\`
|
|
322
|
-
|
|
323
|
-
## Authenticated Browsing
|
|
324
|
-
|
|
325
|
-
For the Pibo Chat Web App, prefer an isolated authenticated lease when multiple agents may use the browser at the same time:
|
|
326
|
-
|
|
327
|
-
\`\`\`bash
|
|
328
|
-
eval "$(pibo tools browser-use lease acquire --app pibo-chat --holder "$USER")"
|
|
329
|
-
browser-use state
|
|
330
|
-
\`\`\`
|
|
331
|
-
|
|
332
|
-
The lease exports \`BROWSER_USE_HOME\`, \`PIBO_BROWSER_USE_SESSION\`, \`PIBO_BROWSER_USE_CHROME_USER_DATA_DIR\`, and \`PIBO_BROWSER_USE_DEFAULT_PROFILE\`. The Pibo browser-use wrapper uses \`PIBO_BROWSER_USE_SESSION\` as the default session, so later commands can omit \`--session\` in that shell.
|
|
333
|
-
|
|
334
|
-
Before acquiring leases, prepare one authenticated template profile:
|
|
335
|
-
|
|
336
|
-
\`\`\`bash
|
|
337
|
-
eval "$(pibo tools browser-use auth-template env)"
|
|
338
|
-
browser-use --headed open http://4788.192.168.0.204.sslip.io/apps/chat
|
|
339
|
-
\`\`\`
|
|
340
|
-
|
|
341
|
-
Sign in once in that template browser, then close it before agents acquire leases. Inspect and clean up leases with:
|
|
342
|
-
|
|
343
|
-
\`\`\`bash
|
|
344
|
-
pibo tools browser-use lease list
|
|
345
|
-
pibo tools browser-use lease release <lease-id>
|
|
346
|
-
pibo tools browser-use lease reap-stale
|
|
347
|
-
\`\`\`
|
|
348
|
-
|
|
349
|
-
If a shared legacy session is already available, inspect it before navigating:
|
|
350
|
-
|
|
351
|
-
\`\`\`bash
|
|
352
|
-
browser-use --session pibo-auth state
|
|
353
|
-
\`\`\`
|
|
354
|
-
|
|
355
|
-
If \`pibo-auth\` is unavailable and must be recreated, the default wrapper behavior is enough:
|
|
356
|
-
|
|
357
|
-
\`\`\`bash
|
|
358
|
-
browser-use --headed --session pibo-auth open http://4788.192.168.0.204.sslip.io/apps/chat
|
|
359
|
-
\`\`\`
|
|
360
|
-
|
|
361
|
-
For low-level Chat Web debugging, prefer an already-open authenticated browser over launching a new profile. Start by listing CDP targets:
|
|
362
|
-
|
|
363
|
-
\`\`\`bash
|
|
364
|
-
npm run dev -- tools browser-use targets
|
|
365
|
-
npm run dev -- tools browser-use attach-chat
|
|
366
|
-
curl -s http://127.0.0.1:56663/json/list
|
|
367
|
-
\`\`\`
|
|
368
|
-
|
|
369
|
-
Inspect Chat Web targets and pick the one that is authenticated and has a composer textarea. \`attach-chat\` prints shell exports for the best existing authenticated Chat target. If Browser Use cannot attach cleanly or MCP resources are unavailable, use the target \`webSocketDebuggerUrl\` from \`targets\`, \`attach-chat\`, or \`/json/list\` and direct CDP \`Runtime.evaluate\`, \`Network\`, and DOM inspection.
|
|
370
|
-
|
|
371
|
-
For authenticated sites, the default Pibo wrapper path is the persistent path. Use \`profile list\` only to inspect available Chrome profiles:
|
|
372
|
-
|
|
373
|
-
\`\`\`bash
|
|
374
|
-
browser-use profile list
|
|
375
|
-
\`\`\`
|
|
376
|
-
|
|
377
|
-
To intentionally use a real local Chrome user data directory instead of the Pibo-managed one, set \`PIBO_BROWSER_USE_CHROME_USER_DATA_DIR\` before starting the session.
|
|
378
|
-
|
|
379
|
-
If \`browser-use --connect\` cannot find Chrome, ask the user whether they want to relaunch Chrome with remote debugging or use a managed Chromium profile.
|
|
380
|
-
|
|
381
|
-
## Tips
|
|
382
|
-
|
|
383
|
-
1. Apply \`eval "$(pibo tools env browser-use)"\` once per persistent shell before using the CLI from Pibo, then reuse that shell.
|
|
384
|
-
2. Always run \`state\` before using element indices.
|
|
385
|
-
3. Re-run \`state\` after navigation or large DOM changes because element indices can change.
|
|
386
|
-
4. For forms, verify inputs with \`get value <index>\`; \`state\` does not always show current text values.
|
|
387
|
-
5. For large pages, prefer \`get html --selector\`, \`get text <index>\`, or \`eval\` over dumping the full page with \`state\`.
|
|
388
|
-
6. Use \`--headed\` when debugging browser behavior if the env output includes a display.
|
|
389
|
-
7. Sessions persist until \`browser-use close\`.
|
|
390
|
-
8. Use \`--session NAME\` for separate browser sessions.
|
|
391
|
-
9. Wrap long waits or JavaScript-heavy mutations with an external timeout, for example \`timeout 30s browser-use --session NAME wait text "Success"\`.
|
|
392
|
-
10. Prefer \`--json\` for machine-readable \`get\` and \`sessions\` results.
|
|
393
|
-
11. \`select\` confirms the visible option text, while \`get value\` returns the underlying option value.
|
|
394
|
-
12. Avoid \`browser-use --version\`; this CLI does not support it.
|
|
395
|
-
13. Avoid \`extract\`; it is listed by the CLI but is not implemented in this version.
|
|
396
|
-
14. If Chrome fails to start with a "SingletonLock" error, the wrapper auto-detects and terminates stale Chrome processes holding the lock. Retry your command.
|
|
270
|
+
content: `---
|
|
271
|
+
name: browser-use
|
|
272
|
+
description: Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, or extract information from web pages.
|
|
273
|
+
allowed-tools: Bash(browser-use:*)
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
# Browser Automation with browser-use CLI
|
|
277
|
+
|
|
278
|
+
The browser-use command provides persistent browser automation. A background daemon keeps the browser open across commands, so repeated commands are fast.
|
|
279
|
+
|
|
280
|
+
## Prerequisites
|
|
281
|
+
|
|
282
|
+
Initialize one persistent browser-use shell by applying the Pibo tool environment once:
|
|
283
|
+
|
|
284
|
+
\`\`\`bash
|
|
285
|
+
eval "$(pibo tools env browser-use)"
|
|
286
|
+
browser-use doctor
|
|
287
|
+
\`\`\`
|
|
288
|
+
|
|
289
|
+
Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env browser-use)"\` instead. Keep running later \`browser-use\` commands in that same shell; a new shell needs the one-time initialization again. If command substitution is not available, run the env command and apply the printed exports manually. On Linux, it includes detected desktop variables such as \`DISPLAY\`, \`WAYLAND_DISPLAY\`, and \`XAUTHORITY\` when a local desktop is available.
|
|
290
|
+
|
|
291
|
+
The Pibo tool environment wraps \`browser-use\`: when a new browser daemon session is started, it starts a Pibo-managed persistent Chrome profile named \`PIBo\` with CDP and connects Browser Use to it. This avoids Browser Use's normal temporary profile copy, so sign-ins made in that profile stay on disk. Pass \`--fresh-profile\` to start a fresh temporary browser profile instead.
|
|
292
|
+
|
|
293
|
+
## Core Workflow
|
|
294
|
+
|
|
295
|
+
1. Navigate: \`browser-use --headed --session NAME open <url>\` when a desktop is available; otherwise use \`browser-use --session NAME open <url>\`
|
|
296
|
+
2. Inspect: \`browser-use state\`
|
|
297
|
+
3. Interact with indices from state: \`browser-use click 5\`, \`browser-use input 3 "text"\`
|
|
298
|
+
4. Verify: \`browser-use state\`, \`browser-use get value <index>\`, \`browser-use eval "js"\`, or \`browser-use screenshot\`
|
|
299
|
+
5. Repeat while the browser stays open
|
|
300
|
+
|
|
301
|
+
Run browser-mutating commands one at a time per session. Do not issue parallel \`click\`, \`input\`, \`open\`, \`eval\`, or \`screenshot\` calls against the same session.
|
|
302
|
+
|
|
303
|
+
If a command fails, run \`browser-use close\` first to clear the session, then retry.
|
|
304
|
+
|
|
305
|
+
After navigation, submit, keypress navigation, major DOM changes, or scroll on complex pages, run \`state\` again before reusing element indices.
|
|
306
|
+
|
|
307
|
+
## Browser Modes
|
|
308
|
+
|
|
309
|
+
\`\`\`bash
|
|
310
|
+
browser-use --headed open <url> # Starts Pibo-managed persistent PIBo Chrome via CDP
|
|
311
|
+
browser-use --fresh-profile open <url> # Starts a fresh temporary browser profile
|
|
312
|
+
browser-use --connect open <url> # Connect to local Chrome via CDP (requires --remote-debugging-port)
|
|
313
|
+
browser-use --profile "Default" open <url> # Upstream profile mode; Browser Use may copy it to a temp dir
|
|
314
|
+
\`\`\`
|
|
315
|
+
|
|
316
|
+
## Commands
|
|
317
|
+
|
|
318
|
+
\`\`\`bash
|
|
319
|
+
# Navigation
|
|
320
|
+
browser-use open <url>
|
|
321
|
+
browser-use back
|
|
322
|
+
browser-use scroll down
|
|
323
|
+
browser-use scroll up
|
|
324
|
+
browser-use switch <index>
|
|
325
|
+
browser-use close-tab [index]
|
|
326
|
+
|
|
327
|
+
# Page state
|
|
328
|
+
browser-use state
|
|
329
|
+
browser-use screenshot [path.png]
|
|
330
|
+
browser-use screenshot --full path.png
|
|
331
|
+
|
|
332
|
+
# Interactions
|
|
333
|
+
browser-use click <index>
|
|
334
|
+
browser-use click <x> <y>
|
|
335
|
+
browser-use type "text"
|
|
336
|
+
browser-use input <index> "text"
|
|
337
|
+
browser-use input <index> ""
|
|
338
|
+
browser-use keys "Enter"
|
|
339
|
+
browser-use keys "Control+a"
|
|
340
|
+
browser-use select <index> "option"
|
|
341
|
+
browser-use upload <index> <path>
|
|
342
|
+
browser-use hover <index>
|
|
343
|
+
browser-use dblclick <index>
|
|
344
|
+
browser-use rightclick <index>
|
|
345
|
+
|
|
346
|
+
# Data extraction
|
|
347
|
+
browser-use eval "js code"
|
|
348
|
+
browser-use get title
|
|
349
|
+
browser-use get html
|
|
350
|
+
browser-use get html --selector "h1"
|
|
351
|
+
browser-use get text <index>
|
|
352
|
+
browser-use get value <index>
|
|
353
|
+
browser-use get attributes <index>
|
|
354
|
+
browser-use get bbox <index>
|
|
355
|
+
|
|
356
|
+
# Wait
|
|
357
|
+
browser-use wait selector "css"
|
|
358
|
+
browser-use wait text "Success"
|
|
359
|
+
|
|
360
|
+
# Cookies
|
|
361
|
+
browser-use cookies get
|
|
362
|
+
browser-use cookies get --url <url>
|
|
363
|
+
browser-use cookies set <name> <value>
|
|
364
|
+
browser-use cookies clear
|
|
365
|
+
browser-use cookies export <file>
|
|
366
|
+
browser-use cookies import <file>
|
|
367
|
+
|
|
368
|
+
# Session
|
|
369
|
+
browser-use close
|
|
370
|
+
browser-use sessions
|
|
371
|
+
browser-use close --all
|
|
372
|
+
\`\`\`
|
|
373
|
+
|
|
374
|
+
## Authenticated Browsing
|
|
375
|
+
|
|
376
|
+
For the Pibo Chat Web App, prefer an isolated authenticated lease when multiple agents may use the browser at the same time:
|
|
377
|
+
|
|
378
|
+
\`\`\`bash
|
|
379
|
+
eval "$(pibo tools browser-use lease acquire --app pibo-chat --holder "$USER")"
|
|
380
|
+
browser-use state
|
|
381
|
+
\`\`\`
|
|
382
|
+
|
|
383
|
+
The lease exports \`BROWSER_USE_HOME\`, \`PIBO_BROWSER_USE_SESSION\`, \`PIBO_BROWSER_USE_CHROME_USER_DATA_DIR\`, and \`PIBO_BROWSER_USE_DEFAULT_PROFILE\`. The Pibo browser-use wrapper uses \`PIBO_BROWSER_USE_SESSION\` as the default session, so later commands can omit \`--session\` in that shell.
|
|
384
|
+
|
|
385
|
+
Before acquiring leases, prepare one authenticated template profile:
|
|
386
|
+
|
|
387
|
+
\`\`\`bash
|
|
388
|
+
eval "$(pibo tools browser-use auth-template env)"
|
|
389
|
+
browser-use --headed open http://4788.192.168.0.204.sslip.io/apps/chat
|
|
390
|
+
\`\`\`
|
|
391
|
+
|
|
392
|
+
Sign in once in that template browser, then close it before agents acquire leases. Inspect and clean up leases with:
|
|
393
|
+
|
|
394
|
+
\`\`\`bash
|
|
395
|
+
pibo tools browser-use lease list
|
|
396
|
+
pibo tools browser-use lease release <lease-id>
|
|
397
|
+
pibo tools browser-use lease reap-stale
|
|
398
|
+
\`\`\`
|
|
399
|
+
|
|
400
|
+
If a shared legacy session is already available, inspect it before navigating:
|
|
401
|
+
|
|
402
|
+
\`\`\`bash
|
|
403
|
+
browser-use --session pibo-auth state
|
|
404
|
+
\`\`\`
|
|
405
|
+
|
|
406
|
+
If \`pibo-auth\` is unavailable and must be recreated, the default wrapper behavior is enough:
|
|
407
|
+
|
|
408
|
+
\`\`\`bash
|
|
409
|
+
browser-use --headed --session pibo-auth open http://4788.192.168.0.204.sslip.io/apps/chat
|
|
410
|
+
\`\`\`
|
|
411
|
+
|
|
412
|
+
For low-level Chat Web debugging, prefer an already-open authenticated browser over launching a new profile. Start by listing CDP targets:
|
|
413
|
+
|
|
414
|
+
\`\`\`bash
|
|
415
|
+
npm run dev -- tools browser-use targets
|
|
416
|
+
npm run dev -- tools browser-use attach-chat
|
|
417
|
+
curl -s http://127.0.0.1:56663/json/list
|
|
418
|
+
\`\`\`
|
|
419
|
+
|
|
420
|
+
Inspect Chat Web targets and pick the one that is authenticated and has a composer textarea. \`attach-chat\` prints shell exports for the best existing authenticated Chat target. If Browser Use cannot attach cleanly or MCP resources are unavailable, use the target \`webSocketDebuggerUrl\` from \`targets\`, \`attach-chat\`, or \`/json/list\` and direct CDP \`Runtime.evaluate\`, \`Network\`, and DOM inspection.
|
|
421
|
+
|
|
422
|
+
For authenticated sites, the default Pibo wrapper path is the persistent path. Use \`profile list\` only to inspect available Chrome profiles:
|
|
423
|
+
|
|
424
|
+
\`\`\`bash
|
|
425
|
+
browser-use profile list
|
|
426
|
+
\`\`\`
|
|
427
|
+
|
|
428
|
+
To intentionally use a real local Chrome user data directory instead of the Pibo-managed one, set \`PIBO_BROWSER_USE_CHROME_USER_DATA_DIR\` before starting the session.
|
|
429
|
+
|
|
430
|
+
If \`browser-use --connect\` cannot find Chrome, ask the user whether they want to relaunch Chrome with remote debugging or use a managed Chromium profile.
|
|
431
|
+
|
|
432
|
+
## Tips
|
|
433
|
+
|
|
434
|
+
1. Apply \`eval "$(pibo tools env browser-use)"\` once per persistent shell before using the CLI from Pibo, then reuse that shell.
|
|
435
|
+
2. Always run \`state\` before using element indices.
|
|
436
|
+
3. Re-run \`state\` after navigation or large DOM changes because element indices can change.
|
|
437
|
+
4. For forms, verify inputs with \`get value <index>\`; \`state\` does not always show current text values.
|
|
438
|
+
5. For large pages, prefer \`get html --selector\`, \`get text <index>\`, or \`eval\` over dumping the full page with \`state\`.
|
|
439
|
+
6. Use \`--headed\` when debugging browser behavior if the env output includes a display.
|
|
440
|
+
7. Sessions persist until \`browser-use close\`.
|
|
441
|
+
8. Use \`--session NAME\` for separate browser sessions.
|
|
442
|
+
9. Wrap long waits or JavaScript-heavy mutations with an external timeout, for example \`timeout 30s browser-use --session NAME wait text "Success"\`.
|
|
443
|
+
10. Prefer \`--json\` for machine-readable \`get\` and \`sessions\` results.
|
|
444
|
+
11. \`select\` confirms the visible option text, while \`get value\` returns the underlying option value.
|
|
445
|
+
12. Avoid \`browser-use --version\`; this CLI does not support it.
|
|
446
|
+
13. Avoid \`extract\`; it is listed by the CLI but is not implemented in this version.
|
|
447
|
+
14. If Chrome fails to start with a "SingletonLock" error, the wrapper auto-detects and terminates stale Chrome processes holding the lock. Retry your command.
|
|
397
448
|
`,
|
|
398
449
|
};
|
|
399
450
|
export const GRAPHIFY_GUIDE = {
|
|
400
451
|
name: 'graphify',
|
|
401
452
|
description: 'Generate codebase knowledge graphs with the Graphify CLI.',
|
|
402
|
-
content: `---
|
|
403
|
-
name: graphify
|
|
404
|
-
description: Generates interactive codebase knowledge graphs and markdown reports from a workspace folder.
|
|
405
|
-
allowed-tools: Bash(graphify:*)
|
|
406
|
-
---
|
|
407
|
-
|
|
408
|
-
# Codebase Visualization with Graphify
|
|
409
|
-
|
|
410
|
-
Graphify turns a folder into derived artifacts under \`graphify-out/\`:
|
|
411
|
-
|
|
412
|
-
- \`graphify-out/graph.html\` — an interactive clickable graph;
|
|
413
|
-
- \`graphify-out/graph.json\` — machine-readable graph data;
|
|
414
|
-
- \`graphify-out/GRAPH_REPORT.md\` — a markdown summary with key concepts and suggested questions.
|
|
415
|
-
|
|
416
|
-
Use it when a user asks to graph, map, visualize, or quickly understand a repo/workspace shape.
|
|
417
|
-
|
|
418
|
-
## Prerequisites
|
|
419
|
-
|
|
420
|
-
Install and apply the Pibo tool environment:
|
|
421
|
-
|
|
422
|
-
\`\`\`bash
|
|
423
|
-
pibo tools install graphify
|
|
424
|
-
eval "$(pibo tools env graphify)"
|
|
425
|
-
graphify --help
|
|
426
|
-
\`\`\`
|
|
427
|
-
|
|
428
|
-
Inside the Pibo source repo, use \`npm run --silent dev -- tools ...\` while testing local changes:
|
|
429
|
-
|
|
430
|
-
\`\`\`bash
|
|
431
|
-
npm run --silent dev -- tools install graphify
|
|
432
|
-
eval "$(npm run --silent dev -- tools env graphify)"
|
|
433
|
-
\`\`\`
|
|
434
|
-
|
|
435
|
-
The installer uses the PyPI package \`graphifyy\` and runs \`graphify install --platform pi\` so the CLI is ready for Pi/Pibo workflows.
|
|
436
|
-
|
|
437
|
-
## Core Workflow
|
|
438
|
-
|
|
439
|
-
1. Choose the workspace path. Prefer the active Pibo Room or session workspace boundary when known.
|
|
440
|
-
2. Run Graphify from that folder or pass the target path explicitly. With \`graphifyy==0.9.x\`, \`graphify .\` writes extraction output under \`graphify-out/\`.
|
|
441
|
-
3. For a code-only workspace without an LLM key, run \`graphify cluster-only . --no-label\` after extraction to produce the HTML graph and markdown report.
|
|
442
|
-
4. Put generated artifacts in an ignored room/session artifact directory when possible; do not commit them unless the user explicitly asks.
|
|
443
|
-
5. Read \`graphify-out/GRAPH_REPORT.md\` first, then open \`graphify-out/graph.html\` when an interactive view is useful.
|
|
444
|
-
|
|
445
|
-
\`\`\`bash
|
|
446
|
-
cd /path/to/workspace
|
|
447
|
-
graphify .
|
|
448
|
-
graphify cluster-only . --no-label
|
|
449
|
-
ls graphify-out/graph.html graphify-out/graph.json graphify-out/GRAPH_REPORT.md
|
|
450
|
-
\`\`\`
|
|
451
|
-
|
|
452
|
-
## Pibo Usage Notes
|
|
453
|
-
|
|
454
|
-
- For Room-bound work, graph the Room workspace rather than the agent harness checkout unless the user asks otherwise.
|
|
455
|
-
- If generating inside a Git repo, check \`git status --short\` before and after so graph artifacts are not accidentally included in unrelated commits.
|
|
456
|
-
- Code-only extraction can run without an LLM API key. Including docs, README files, papers, images, or semantic-labeling steps may require a configured Graphify backend/API key; if no key is available, graph a code-only subdirectory or skip semantic labels with \`cluster-only . --no-label\`.
|
|
457
|
-
- For large monorepos, start with a subdirectory such as \`src/\`, a code package, or a docs folder only when the needed LLM backend is configured.
|
|
458
|
-
- Treat graph output as derived data. Recompute on demand when the branch or workspace changes.
|
|
459
|
-
|
|
460
|
-
## Next Commands
|
|
461
|
-
|
|
462
|
-
\`\`\`bash
|
|
463
|
-
pibo tools show graphify
|
|
464
|
-
pibo tools guide graphify graphify
|
|
465
|
-
pibo tools path graphify
|
|
466
|
-
pibo tools doctor graphify
|
|
467
|
-
\`\`\`
|
|
453
|
+
content: `---
|
|
454
|
+
name: graphify
|
|
455
|
+
description: Generates interactive codebase knowledge graphs and markdown reports from a workspace folder.
|
|
456
|
+
allowed-tools: Bash(graphify:*)
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
# Codebase Visualization with Graphify
|
|
460
|
+
|
|
461
|
+
Graphify turns a folder into derived artifacts under \`graphify-out/\`:
|
|
462
|
+
|
|
463
|
+
- \`graphify-out/graph.html\` — an interactive clickable graph;
|
|
464
|
+
- \`graphify-out/graph.json\` — machine-readable graph data;
|
|
465
|
+
- \`graphify-out/GRAPH_REPORT.md\` — a markdown summary with key concepts and suggested questions.
|
|
466
|
+
|
|
467
|
+
Use it when a user asks to graph, map, visualize, or quickly understand a repo/workspace shape.
|
|
468
|
+
|
|
469
|
+
## Prerequisites
|
|
470
|
+
|
|
471
|
+
Install and apply the Pibo tool environment:
|
|
472
|
+
|
|
473
|
+
\`\`\`bash
|
|
474
|
+
pibo tools install graphify
|
|
475
|
+
eval "$(pibo tools env graphify)"
|
|
476
|
+
graphify --help
|
|
477
|
+
\`\`\`
|
|
478
|
+
|
|
479
|
+
Inside the Pibo source repo, use \`npm run --silent dev -- tools ...\` while testing local changes:
|
|
480
|
+
|
|
481
|
+
\`\`\`bash
|
|
482
|
+
npm run --silent dev -- tools install graphify
|
|
483
|
+
eval "$(npm run --silent dev -- tools env graphify)"
|
|
484
|
+
\`\`\`
|
|
485
|
+
|
|
486
|
+
The installer uses the PyPI package \`graphifyy\` and runs \`graphify install --platform pi\` so the CLI is ready for Pi/Pibo workflows.
|
|
487
|
+
|
|
488
|
+
## Core Workflow
|
|
489
|
+
|
|
490
|
+
1. Choose the workspace path. Prefer the active Pibo Room or session workspace boundary when known.
|
|
491
|
+
2. Run Graphify from that folder or pass the target path explicitly. With \`graphifyy==0.9.x\`, \`graphify .\` writes extraction output under \`graphify-out/\`.
|
|
492
|
+
3. For a code-only workspace without an LLM key, run \`graphify cluster-only . --no-label\` after extraction to produce the HTML graph and markdown report.
|
|
493
|
+
4. Put generated artifacts in an ignored room/session artifact directory when possible; do not commit them unless the user explicitly asks.
|
|
494
|
+
5. Read \`graphify-out/GRAPH_REPORT.md\` first, then open \`graphify-out/graph.html\` when an interactive view is useful.
|
|
495
|
+
|
|
496
|
+
\`\`\`bash
|
|
497
|
+
cd /path/to/workspace
|
|
498
|
+
graphify .
|
|
499
|
+
graphify cluster-only . --no-label
|
|
500
|
+
ls graphify-out/graph.html graphify-out/graph.json graphify-out/GRAPH_REPORT.md
|
|
501
|
+
\`\`\`
|
|
502
|
+
|
|
503
|
+
## Pibo Usage Notes
|
|
504
|
+
|
|
505
|
+
- For Room-bound work, graph the Room workspace rather than the agent harness checkout unless the user asks otherwise.
|
|
506
|
+
- If generating inside a Git repo, check \`git status --short\` before and after so graph artifacts are not accidentally included in unrelated commits.
|
|
507
|
+
- Code-only extraction can run without an LLM API key. Including docs, README files, papers, images, or semantic-labeling steps may require a configured Graphify backend/API key; if no key is available, graph a code-only subdirectory or skip semantic labels with \`cluster-only . --no-label\`.
|
|
508
|
+
- For large monorepos, start with a subdirectory such as \`src/\`, a code package, or a docs folder only when the needed LLM backend is configured.
|
|
509
|
+
- Treat graph output as derived data. Recompute on demand when the branch or workspace changes.
|
|
510
|
+
|
|
511
|
+
## Next Commands
|
|
512
|
+
|
|
513
|
+
\`\`\`bash
|
|
514
|
+
pibo tools show graphify
|
|
515
|
+
pibo tools guide graphify graphify
|
|
516
|
+
pibo tools path graphify
|
|
517
|
+
pibo tools doctor graphify
|
|
518
|
+
\`\`\`
|
|
468
519
|
`,
|
|
469
520
|
};
|
|
470
521
|
export const REMOTE_BROWSER_GUIDE = {
|
|
471
522
|
name: 'remote-browser',
|
|
472
523
|
description: 'Browser automation workflow for sandboxed or remote agents.',
|
|
473
|
-
content: `---
|
|
474
|
-
name: remote-browser
|
|
475
|
-
description: Controls a browser from a sandboxed or remote machine. Use when the agent has no local GUI and needs to navigate websites, interact with web pages, take screenshots, or expose local dev servers via tunnels.
|
|
476
|
-
allowed-tools: Bash(browser-use:*)
|
|
477
|
-
---
|
|
478
|
-
|
|
479
|
-
# Browser Automation for Sandboxed Agents
|
|
480
|
-
|
|
481
|
-
This guide is for agents running in a sandbox, CI, cloud VM, or remote coding environment.
|
|
482
|
-
|
|
483
|
-
## Prerequisites
|
|
484
|
-
|
|
485
|
-
Initialize one persistent browser-use shell by applying the Pibo tool environment once:
|
|
486
|
-
|
|
487
|
-
\`\`\`bash
|
|
488
|
-
eval "$(pibo tools env browser-use)"
|
|
489
|
-
browser-use doctor
|
|
490
|
-
\`\`\`
|
|
491
|
-
|
|
492
|
-
Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env browser-use)"\` instead. Keep running later \`browser-use\` commands in that same shell; a new shell needs the one-time initialization again. If command substitution is not available, run the env command and apply the printed exports manually. On Linux, this lets Browser Use see a local desktop session when one exists.
|
|
493
|
-
|
|
494
|
-
## Core Workflow
|
|
495
|
-
|
|
496
|
-
1. Navigate: \`browser-use --headed --session NAME open <url>\` when a desktop is available; otherwise use \`browser-use --session NAME open <url>\`
|
|
497
|
-
2. Inspect: \`browser-use state\`
|
|
498
|
-
3. Interact with indices from state: \`browser-use click 5\`, \`browser-use input 3 "text"\`
|
|
499
|
-
4. Verify: \`browser-use state\`, \`browser-use get value <index>\`, \`browser-use eval "js"\`, or \`browser-use screenshot\`
|
|
500
|
-
5. Cleanup: \`browser-use close\`
|
|
501
|
-
|
|
502
|
-
Run browser-mutating commands one at a time per session. Use separate session names for parallel workflows.
|
|
503
|
-
After navigation, submit, keypress navigation, major DOM changes, or scroll on complex pages, run \`state\` again before reusing element indices.
|
|
504
|
-
|
|
505
|
-
## Browser Modes
|
|
506
|
-
|
|
507
|
-
\`\`\`bash
|
|
508
|
-
browser-use open <url>
|
|
509
|
-
browser-use --headed open <url>
|
|
510
|
-
browser-use --connect open <url>
|
|
511
|
-
browser-use --cdp-url ws://localhost:9222/devtools/browser/... open <url>
|
|
512
|
-
\`\`\`
|
|
513
|
-
|
|
514
|
-
## Commands
|
|
515
|
-
|
|
516
|
-
\`\`\`bash
|
|
517
|
-
browser-use open <url>
|
|
518
|
-
browser-use back
|
|
519
|
-
browser-use state
|
|
520
|
-
browser-use screenshot [path.png]
|
|
521
|
-
browser-use click <index>
|
|
522
|
-
browser-use input <index> "text"
|
|
523
|
-
browser-use keys "Enter"
|
|
524
|
-
browser-use wait selector "css"
|
|
525
|
-
browser-use wait text "Success"
|
|
526
|
-
browser-use get html
|
|
527
|
-
browser-use eval "document.title"
|
|
528
|
-
browser-use switch <index>
|
|
529
|
-
browser-use close-tab [index]
|
|
530
|
-
browser-use close
|
|
531
|
-
\`\`\`
|
|
532
|
-
|
|
533
|
-
## Exposing Local Dev Servers
|
|
534
|
-
|
|
535
|
-
\`\`\`bash
|
|
536
|
-
browser-use tunnel <port>
|
|
537
|
-
browser-use tunnel list
|
|
538
|
-
browser-use open <tunnel-url>
|
|
539
|
-
browser-use tunnel stop <port>
|
|
540
|
-
\`\`\`
|
|
541
|
-
|
|
542
|
-
Tunnels are independent from browser sessions and can persist after \`browser-use close\`.
|
|
543
|
-
|
|
544
|
-
## Multiple Sessions
|
|
545
|
-
|
|
546
|
-
\`\`\`bash
|
|
547
|
-
browser-use --session agent-a open https://example.com
|
|
548
|
-
browser-use --session agent-b open https://example.org
|
|
549
|
-
\`\`\`
|
|
550
|
-
|
|
551
|
-
Use named sessions when multiple agents or workflows need separate browsers.
|
|
552
|
-
|
|
553
|
-
## Troubleshooting
|
|
554
|
-
|
|
555
|
-
- Browser will not start: run \`browser-use close\`, then retry.
|
|
556
|
-
- Element not found: run \`browser-use scroll down\`, then \`browser-use state\`.
|
|
557
|
-
- Form value unclear: use \`browser-use get value <index>\`.
|
|
558
|
-
- Large page state is noisy: use \`get html --selector\`, \`get text <index>\`, or \`eval\`.
|
|
559
|
-
- Need to debug visually: use \`--headed\`.
|
|
560
|
-
- Long wait hangs: wrap the command with \`timeout 30s\`.
|
|
561
|
-
- Tunnel not working: run \`browser-use tunnel list\`.
|
|
524
|
+
content: `---
|
|
525
|
+
name: remote-browser
|
|
526
|
+
description: Controls a browser from a sandboxed or remote machine. Use when the agent has no local GUI and needs to navigate websites, interact with web pages, take screenshots, or expose local dev servers via tunnels.
|
|
527
|
+
allowed-tools: Bash(browser-use:*)
|
|
528
|
+
---
|
|
529
|
+
|
|
530
|
+
# Browser Automation for Sandboxed Agents
|
|
531
|
+
|
|
532
|
+
This guide is for agents running in a sandbox, CI, cloud VM, or remote coding environment.
|
|
533
|
+
|
|
534
|
+
## Prerequisites
|
|
535
|
+
|
|
536
|
+
Initialize one persistent browser-use shell by applying the Pibo tool environment once:
|
|
537
|
+
|
|
538
|
+
\`\`\`bash
|
|
539
|
+
eval "$(pibo tools env browser-use)"
|
|
540
|
+
browser-use doctor
|
|
541
|
+
\`\`\`
|
|
542
|
+
|
|
543
|
+
Inside the Pibo source repo, use \`eval "$(npm run --silent dev -- tools env browser-use)"\` instead. Keep running later \`browser-use\` commands in that same shell; a new shell needs the one-time initialization again. If command substitution is not available, run the env command and apply the printed exports manually. On Linux, this lets Browser Use see a local desktop session when one exists.
|
|
544
|
+
|
|
545
|
+
## Core Workflow
|
|
546
|
+
|
|
547
|
+
1. Navigate: \`browser-use --headed --session NAME open <url>\` when a desktop is available; otherwise use \`browser-use --session NAME open <url>\`
|
|
548
|
+
2. Inspect: \`browser-use state\`
|
|
549
|
+
3. Interact with indices from state: \`browser-use click 5\`, \`browser-use input 3 "text"\`
|
|
550
|
+
4. Verify: \`browser-use state\`, \`browser-use get value <index>\`, \`browser-use eval "js"\`, or \`browser-use screenshot\`
|
|
551
|
+
5. Cleanup: \`browser-use close\`
|
|
552
|
+
|
|
553
|
+
Run browser-mutating commands one at a time per session. Use separate session names for parallel workflows.
|
|
554
|
+
After navigation, submit, keypress navigation, major DOM changes, or scroll on complex pages, run \`state\` again before reusing element indices.
|
|
555
|
+
|
|
556
|
+
## Browser Modes
|
|
557
|
+
|
|
558
|
+
\`\`\`bash
|
|
559
|
+
browser-use open <url>
|
|
560
|
+
browser-use --headed open <url>
|
|
561
|
+
browser-use --connect open <url>
|
|
562
|
+
browser-use --cdp-url ws://localhost:9222/devtools/browser/... open <url>
|
|
563
|
+
\`\`\`
|
|
564
|
+
|
|
565
|
+
## Commands
|
|
566
|
+
|
|
567
|
+
\`\`\`bash
|
|
568
|
+
browser-use open <url>
|
|
569
|
+
browser-use back
|
|
570
|
+
browser-use state
|
|
571
|
+
browser-use screenshot [path.png]
|
|
572
|
+
browser-use click <index>
|
|
573
|
+
browser-use input <index> "text"
|
|
574
|
+
browser-use keys "Enter"
|
|
575
|
+
browser-use wait selector "css"
|
|
576
|
+
browser-use wait text "Success"
|
|
577
|
+
browser-use get html
|
|
578
|
+
browser-use eval "document.title"
|
|
579
|
+
browser-use switch <index>
|
|
580
|
+
browser-use close-tab [index]
|
|
581
|
+
browser-use close
|
|
582
|
+
\`\`\`
|
|
583
|
+
|
|
584
|
+
## Exposing Local Dev Servers
|
|
585
|
+
|
|
586
|
+
\`\`\`bash
|
|
587
|
+
browser-use tunnel <port>
|
|
588
|
+
browser-use tunnel list
|
|
589
|
+
browser-use open <tunnel-url>
|
|
590
|
+
browser-use tunnel stop <port>
|
|
591
|
+
\`\`\`
|
|
592
|
+
|
|
593
|
+
Tunnels are independent from browser sessions and can persist after \`browser-use close\`.
|
|
594
|
+
|
|
595
|
+
## Multiple Sessions
|
|
596
|
+
|
|
597
|
+
\`\`\`bash
|
|
598
|
+
browser-use --session agent-a open https://example.com
|
|
599
|
+
browser-use --session agent-b open https://example.org
|
|
600
|
+
\`\`\`
|
|
601
|
+
|
|
602
|
+
Use named sessions when multiple agents or workflows need separate browsers.
|
|
603
|
+
|
|
604
|
+
## Troubleshooting
|
|
605
|
+
|
|
606
|
+
- Browser will not start: run \`browser-use close\`, then retry.
|
|
607
|
+
- Element not found: run \`browser-use scroll down\`, then \`browser-use state\`.
|
|
608
|
+
- Form value unclear: use \`browser-use get value <index>\`.
|
|
609
|
+
- Large page state is noisy: use \`get html --selector\`, \`get text <index>\`, or \`eval\`.
|
|
610
|
+
- Need to debug visually: use \`--headed\`.
|
|
611
|
+
- Long wait hangs: wrap the command with \`timeout 30s\`.
|
|
612
|
+
- Tunnel not working: run \`browser-use tunnel list\`.
|
|
562
613
|
`,
|
|
563
614
|
};
|