跳到正文
Skillpedia
通用编程31k · #9334

opencli-browser

它能做什么

这项技能让你的智能体通过 OpenCLI 工具控制 Chrome。它可以打开页面、读取内容、与按钮和输入框交互,并管理标签页。

适用场景

  • ✓当你希望智能体在 Chrome 中打开并阅读某个网页时。
  • ✓当你希望为某项任务与已登录的网站进行交互时。
  • ✓当你在调查时需要捕获页面发送或接收的内容时。

技能链接

https://github.com/jackwener/OpenCLI/blob/main/skills/opencli-browser/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/jackwener/OpenCLI/blob/main/skills/opencli-browser/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“在 Chrome 中打开这个网站,找到价格表,并告诉我上面写了什么。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会打开一个指定名称的浏览器会话,通过元素引用读取页面状态,然后根据需要点击或输入。它会阅读每个结果,并在重试任何写入操作之前检查页面。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Browser tools for agents

Use the capability that fits the task. Discover commands with opencli list <query>; read exact arguments with opencli browser <command> --help -f json. Run opencli doctor when diagnosing a connection problem.

Scope and results

Page commands require --session <name>. Reuse that name across a task; different sessions isolate page work. --profile <name> selects a Chrome profile when needed. Options can follow command arguments:

opencli browser open https://example.com --session research
opencli browser state --session research
opencli browser click --role button --name Search --session research
opencli browser close --session research

Default output is one JSON value: { "ok": true, "data": ... }. Failures return { "ok": false, "error": { "code": "...", "message": "...", "hint": "..." } } and a nonzero exit code. Diagnostic logs go to stderr. network --follow and console --follow stream one envelope per line. Help, version and shell completion are inspection/export surfaces; structured help uses --help -f json.

Read the returned data and error fields. When error.outcome is unknown, inspect the affected state before retrying a write.

Page targets and interaction

  • state returns URL and interactive element refs. --diagnostics also reports page title and available initial-state globals; --source ax selects the AX tree.
  • find locates elements. Interaction targets accept a ref, CSS selector, or semantic flags such as --role, --name, --label, --text, --testid.
  • Use --nth to resolve deliberate multiple matches. On stale refs, read fresh state or locate the element again; refs describe the observed page.
  • fill replaces a field and verifies its value; type types text. Other actions include click, select, check, upload, drag, keys and dialog.
  • get text|value|attributes|html, extract, screenshot and eval expose page data. eval executes JavaScript in the page and can mutate state.
  • wait xhr|selector|text|download observes an expected condition. Consult help for timeouts and matching rules.
  • tab list|new|select|close manages session tabs. --tab accepts the page identity returned by these commands; these are different from numeric native Chrome IDs.
  • frames lists frame targets; eval --frame evaluates in a selected frame.

bind --session research attaches the current user tab. Bound sessions permit navigation but block tab creation, selection and closure. unbind releases the binding without closing the user tab. Owned sessions keep leased tabs until close or idle expiry. --window foreground|background controls owned windows.

Network and scripts

opencli browser network --session research
opencli browser network --detail RequestKey --session research
opencli browser network --static --session research

network returns captured request keys and response shapes. --detail reads a cached request; --filter selects shapes; --raw exposes response bodies. --static adds Acorn AST candidates from loaded scripts, with source locations, methods, query/body parameter names and observed request evidence. EXPR means an unresolved expression. Static candidates are not executed or proven APIs. Check analysisComplete, script errors, omitted scripts and networkSource. An empty live capture can reuse a recent cache; reported provenance distinguishes it.

Native Chrome management

Native calls need no session and do not attach a page:

opencli browser chrome describe
opencli browser chrome describe tabs.group
opencli browser chrome call tabs.query '[{}]'
opencli browser chrome call tabs.group '[{"tabIds":[123,456],"createProperties":{"windowId":10}}]'
opencli browser chrome call tabGroups.update '[789,{"title":"Research","color":"blue"}]'

Use numeric IDs returned by Chrome, replacing the example IDs. describe lists supported methods, signatures, live permissions and official documentation. Native-created tabs/windows persist. Mutations touching active OpenCLI session tabs or managed groups return managed_resource_conflict; ordinary groups can be created, renamed, recolored, moved and dissolved with tabs.ungroup.

常见问题

我需要会话名称吗?

需要。页面命令使用会话名称,以便将不同的任务分开。

如果某个操作的结果不清楚怎么办?

在重复写入操作之前,智能体会先检查页面状态。

它能使用我已登录的浏览器配置文件吗?

能。需要时可以选择 Chrome 配置文件。

详情

作者的原始描述

Drive Chrome with OpenCLI to inspect pages, interact with logged-in sites, capture API evidence, and manage native tabs, groups and windows. For reusable adapters, see opencli-adapter-author.

repo: jackwener/OpenCLI

热度

GitHub 星标
31k
排名
#9334
许可证
Apache-2.0
更新时间
2026/10/26

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能