技能版本 1.0.0
agent-browser
Use this skill when the user needs browser automation, including opening web pages, taking screenshots, extracting page content, clicking elements, filling forms, or testing web flows. This skill uses the open source vercel-labs/agent-browser CLI and supports macOS, Linux, and Windows x64.
价格
免费
- 安装:免费
在组织开通时一次性收取;再次读取清单或下载不重复收费。
以上为公开标价。你的组织可能有协议价,以控制台显示的价格为准。
如何使用
为组织安装
开通即安装:组织固定使用开通时的版本(当前为 1.0.0)。升级到新版本需要取消后重新开通。
创建凭证
客户端使用组织凭证读取;绑定到数字人后,数字人使用绑定凭证按需加载。请求中携带:
Authorization: Bearer $ZGI_MARKET_KEY读取清单与安装包
清单列出版本、文件和校验值;安装包是一个 zip 文件。
读取清单 curl "https://market-api.zgi.im/v1/market/skills/agent-browser-7930/manifest" \ -H "Authorization: Bearer $ZGI_MARKET_KEY"下载安装包 curl "https://market-api.zgi.im/v1/market/skills/agent-browser-7930/package" \ -H "Authorization: Bearer $ZGI_MARKET_KEY" \ -o agent-browser-7930.zip读取清单和下载安装包不计入用量。下载后请用响应头中的 SHA-256 校验文件。
技能说明
- 名称
- agent-browser
- 说明
- Use this skill when the user needs browser automation, including opening web pages, taking screenshots, extracting page content, clicking elements, filling forms, or testing web flows. This skill uses the open source vercel-labs/agent-browser CLI and supports macOS, Linux, and Windows x64.
会运行代码ShellPowerShell
技能包内含脚本文件,加载技能的运行时可能会执行它们,安装前请先阅读。
SKILL.md 节选
# Agent Browser
Use `agent-browser` CLI for full browser automation tasks. It is suitable when a page needs JavaScript rendering, real browser interaction, screenshots, or form automation.
Upstream project: https://github.com/vercel-labs/agent-browser
## Platform Support
`vercel-labs/agent-browser` provides native builds for:
- macOS ARM64 / x64
- Linux ARM64 / x64
- Windows x64
Windows support in this skill targets Windows 11 x64 with PowerShell and Node.js 18+.
## Prerequisites
- Node.js 18+
- npm available in PATH
- Network access to install `agent-browser` and download Chromium
- About 500 MB free disk space for Chromium
- **The `node` binary on PATH must actually execute code**, not just print a version. `agent-browser` spawns a Node child process internally; if that Node is broken, the daemon will crash with no useful output even when `agent-browser --version` works.
Quick check:
```bash
node -e "console.log('ok')"
```
If this does not print `ok` (SIGILL / exit 133 / any crash), the Node on PATH is unusable. Fix it, or run `agent-browser` with a known-good Node prepended to PATH for that command only:
```bash
PATH="/path/to/working-node/bin:$PATH" agent-browser open <url>
```
Inspect which Node would be picked up with `which -a node`.
## Installation
> Inside the CodeBuddy marketplace, `scripts/setup.sh` auto-runs these steps on first load. The commands below are for manual setup or reinstall.
### Windows PowerShell
```powershell
npm install -g agent-browser
agent-browser install
```
### macOS / Linux
```bash
npm install -g agent-browser
agent-browser install
```
### Linux missing dependencies
```bash
agent-browser install --with-deps
```
## Required Command Sequence
The current upstream `agent-browser` CLI does not require a separate `launch` command. `agent-browser open <url>` starts or connects to the browser daemon automatically.
Always follow this order:
1. Open target URL.
2. Wait for page load when needed.
3. Inspect page with `snapshot` or `snapshot -i`.
4. Interact with the page.
5. Close browser when done.
```bash
agent-browser open https://example.com
agent-browser wait --load networkidle
agent-browser snapshot
agent-browser close
```
## Session Model
`agent-browser` runs a persistent background daemon. Understand this before planning multi-step tasks:
- The first `agent-browser open` starts a daemon; subsequent commands auto-connect to the same daemon.
- Within one session, cookies, localStorage and login state are preserved across commands.
- Multiple `open` calls in the same session navigate the existing browser (no need to close between URLs).
- `agent-browser close` ends the daemon. Only call it when the whole task is finished, not between steps of the same task.
Implication: for a task that visits N URLs, do **one** `open ... snapshot ...` chain per URL and **one** `close` at the very end, not N `open`/`close` pairs.
## Execution Principles
Apply these when running command sequences, especially in multi-step tasks:
- **`close` is mandatory in finally**: whether the task succeeds or fails midway, always run `agent-browser close` at the end to avoid zombie daemons and leaked Chromium processes.
- **`wait` is optional and degradable**: `wait --load networkidle` can hang on SPAs that never go idle. If a wait stalls, fall back to `wait --load load` or skip waiting and `snapshot` directly. Do not block the whole task on `wait`.
- **Reuse the daemon**: in the same task, do not `close` between intermediate steps. Open once, navigate/interact multiple times, close at the end.
- **Prefer `snapshot -i` for interaction**: when you need to click or type, get interactive element IDs first via `snapshot -i`, then act on them. Do not guess CSS selectors blindly.SKILL.md 不止这些内容,安装后可阅读全文。
技能包内容
共 7 个文件,合计 16.5 KiB
- README.md1.7 KiB
- SKILL.md8.0 KiB
- references/troubleshooting.md2.9 KiB
- references/windows-support.md1.1 KiB
- scripts/setup.sh1.5 KiB
- templates/install-unix.sh456 B
- templates/install-windows.ps1816 B
来源与审核
- 审核状态
- 尚未审核,内容来自上游来源
- 许可证
- 未说明
审核状态是平台对上架信息的记录,不构成对上游服务质量或可用性的担保。