catalog/repos/agentgo-dev--agentgo-browser.md

59 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# AI代理云端浏览器技能
`浏览器自动化` `Claude Code` `Playwright` `云端浏览器` `AI代理`
# agentgo-browser
AgentGo 云端浏览器技能,适用于 AI 编程代理Claude Code、GitHub Copilot 等)。
使用 `playwright@1.51.0` 连接到 [AgentGo](https://app.agentgo.live/) 的分布式浏览器集群——无需本地浏览器。
## 获取 API 密钥
**https://app.agentgo.live/** 注册——包含免费额度,无需信用卡。
## 安装
```bash
npm install playwright@1.51.0
```
## 快速开始
```typescript
import { chromium } from "playwright"; // 必须使用 playwright@1.51.0
const options = { _apikey: process.env.AGENTGO_API_KEY };
const serverUrl = `wss://app.browsers.live?launch-options=${encodeURIComponent(JSON.stringify(options))}`;
const browser = await chromium.connect(serverUrl);
const page = await browser.newPage();
await page.goto("https://example.com");
console.log(await page.title());
await browser.close();
```
## AI 代理技能
`skills/agentgo-browser/` 目录包含一个与 Claude Code 及其他 AI 编程代理兼容的技能。
### 安装技能Claude Code
```bash
cp -r skills/agentgo-browser .claude/skills/agentgo-browser
```
安装完成后,你的 AI 代理将自动使用 AgentGo 的云端浏览器执行浏览器自动化任务。
## 目录结构
```
skills/agentgo-browser/
├── SKILL.md # 技能主入口
└── references/
├── connection.md # 连接与认证详情
├── session-management.md # 浏览器会话管理
└── running-code.md # playwright@1.51.0 API 示例
```