使用 agent-browser-cli 进行浏览器感知与控制。适用于标签页扫描/切换、页面 JS 执行、Cookie、CDP、contentSettings、截图、文件上传、下拉框点击、tmwd_cdp_bridge 初始化和 Web 工具排障
# Add to your Claude Code skills
git clone https://github.com/sleepinginsummer/agent-browser-cliGuides for using ai agents skills like agent-browser-cli.
See how agent-browser-cli compares with popular alternatives.
agent-browser-cli is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by sleepinginsummer. 使用 agent-browser-cli 进行浏览器感知与控制。适用于标签页扫描/切换、页面 JS 执行、Cookie、CDP、contentSettings、截图、文件上传、下拉框点击、tmwd_cdp_bridge 初始化和 Web 工具排障. It has 636 GitHub stars.
agent-browser-cli's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/sleepinginsummer/agent-browser-cli" and add it to your Claude Code skills directory (see the Installation section above).
agent-browser-cli is primarily written in Rust. It is open-source under sleepinginsummer on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh agent-browser-cli against similar tools.
No comments yet. Be the first to share your thoughts!
Available after the catalog security scan passes.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
面向 Agent 的浏览器感知与控制 CLI,把真实 Chrome 会话变成可复用的标签页扫描、页面 JS、Cookie、CDP 和截图能力。
浏览器感知 · 页面控制 · Chrome 登录态复用 · CDP · 条件等待 · Agent Skill 集成
AI 一句话安装 · 手动安装 · Chrome 扩展 · 更新 · 更新日志 · 卸载 · 友情链接
中文 | English
agent-browser-cli 是一个面向 Agent 的浏览器感知与控制工具。它通过 Chrome 扩展连接用户真实浏览器,保留登录态和 Cookie,提供标签页扫描、页面 JS 执行、Cookie 读取、CDP 控制、截图、文件上传、下拉框点击等能力。
本项目不是 Selenium / Playwright。它更适合在已有浏览器会话中辅助 Agent 精确读取页面和执行操作。
0.3.5assets/tmwd_cdp_bridgeWSL 2.0.0+,并建议在 Windows 11 22H2+ 下启用 networkingMode=mirrored,以便 WSL 连接宿主机 localhost 上的 Chrome 桥接服务本项目的浏览器控制能力提取并改造自 GenericAgent 项目中的 Web 工具链,包括 TMWebDriver、simphtml 和 tmwd_cdp_bridge 扩展相关思路与实现。
感谢 GenericAgent 项目提供的浏览器桥接、页面简化、CDP 控制和实践 SOP。本仓库在此基础上做了面向独立使用和 CLI 调用的整理与增强。
请阅读 https://github.com/sleepinginsummer/agent-browser-cli/blob/main/AI_INSTALL.md,按说明安装 CLI、加载 Chrome 扩展,并添加 `skills/agent-browser-cli/SKILL.md`。
skills/agent-browser-cli/SKILL.md,提供ai参考使用。.
├── Cargo.toml # Rust 工程配置
├── src/ # Rust CLI / 常驻服务 / bridge
├── assets/tmwd_cdp_bridge/ # Chrome MV3 扩展
├── assets/simphtml_opt.js # 页面简化脚本
├── assets/simphtml_find_list.js # 列表识别脚本
├── npm/ # npm 启动脚本
└── skills/agent-browser-cli/ # skill
npm install -g @sleepinsummer/agent-browser-cli
agent-browser-cli tabs
cargo build --release
./target/release/agent-browser-cli tabs
推荐从 最新 Release 下载 chrome-extensions.zip,下载后解压,Chrome 打开 chrome://extensions,开启“开发者模式”,点击“加载已解压的扩展程序”,选择解压后的 tmwd_cdp_bridge 目录。
本地源码构建时,也可以直接加载扩展目录:
assets/tmwd_cdp_bridge
about:blank 或 chrome:// 页面。本次隐藏 手动隐藏,本次服务连接周期内不再显示,约 300 秒服务断开并下次重连后恢复。18765:默认插件 WebSocket 端口,Chrome 扩展连接使用,可通过 agent-browser-cli set-extension-port <port> 修改。18767:CLI HTTP API 端口,供 CLI 复用会话,不能作为插件端口使用。CLI 修改插件端口:
agent-browser-cli set-extension-port 18766
该命令会写入配置文件;如果 daemon 正在运行,会自动重启 daemon,让新端口立即生效。
也可以手动修改配置文件。配置文件位于 ~/.agent-browser-cli/config.json,不存在时会自动生成:
{
"extension_port": 18765
}
手动修改示例:
{
"extension_port": 18766
}
手动改配置后需要执行 agent-browser-cli restart,daemon 才会按新端口重新监听。
Chrome 插件 popup 中也可以修改插件端口并立即重连。插件端口必须和 CLI 配置中的 extension_port 一致。
多 Chrome Profile / 多浏览器实例下,profile_id 和 browser_id 较长。可以给每个 Chrome Profile 设置短 label,之后用 --profile <label> 操作。
agent-browser-cli lookup tab <tabId>
agent-browser-cli lookup browser <browser_id>
agent-browser-cli profile-label set work --profile <profile_id>
agent-browser-cli tabs --profile work
也可以在对应 Chrome Profile 的扩展 popup 中设置 Profile Label。label 只作为别名,内部路由仍使用 browser_id:profile_id:tab_id;如果当前 daemon 内 label 匹配到多个 profile,CLI 会报歧义。推荐用 CLI 设置 label,因为 CLI 会校验当前 daemon 内跨 Profile 唯一性;popup 是本地便捷入口,不保证跨 Profile 唯一。tabtree 默认截断 URL 并省略 session_key 以减少 token,需完整字段时加 --full。
扩展不再默认重写页面的 alert / confirm / prompt。只有 CLI 执行页面脚本命令期间会临时抑制原生弹窗,命令结束后恢复,避免长期污染业务页面全局函数。
agent-browser-cli tabs
agent-browser-cli open https://www.baidu.com
成功时会返回:
{
"ok": true,
"result": {
"status": "success",
"metadata": {
"tabs_count": 1
}
}
}
README 只保留快速入口;完整命令和浏览器操作 SOP 见 skills/agent-browser-cli/SKILL.md。
agent-browser-cli tabs
agent-browser-cli scan
agent-browser-cli exec 'document.title'
agent-browser-cli snapshot
agent-browser-cli click @e1
agent-browser-cli fill @e2 'text'
agent-browser-cli send-keys Enter --target @e2
agent-browser-cli mouse-click @e1
agent-browser-cli screenshot --full-page
agent-browser-cli save-pdf
agent-browser-cli network start
agent-browser-cli network list
agent-browser-cli console start
agent-browser-cli console list
agent-browser-cli open https://example.com --window --focus
agent-browser-cli open https://example.com --group-title demo
agent-browser-cli close --tab <tabId>
agent-browser-cli tabtree
agent-browser-cli tabtree --full
agent-browser-cli tabtree --profile <profile_label>
agent-browser-cli tabtree --tab <tabId>
agent-browser-cli lookup tab <tabId>
agent-browser-cli lookup browser <browser_id>
agent-browser-cli profile-label set work --profile <profile_id>
agent-browser-cli profile-label clear --profile <profile_id>
agent-browser-cli status
agent-browser-cli doctor
agent-browser-cli logs --tail 100
agent-browser-cli install-skill --dry-run
完整版本记录见 CHANGELOG.md。
ai一句话更新
请阅读 https://github.com/sleepinginsummer/agent-browser-cli/blob/main/AI_INSTALL.md,按说明更新 CLI、重新下载插件 zip 到用户指定位置,用户手动加载 Chrome 扩展,并更新相关 SKILL.md。
如果 Chrome 扩展有更新,在 chrome://extensions 中重新下载 zip 覆盖,然后重新加载 assets/tmwd_cdp_bridge 扩展。
先停止常驻服务:
agent-browser-cli stop
然后按需清理:
npm uninstall -g @sleepinsummer/agent-browser-cli
rm -f .agent-browser-cli.log .agent-browser-cli.lock
rm -rf ~/.agents/skills/agent-browser-cli
最后在 Chrome 扩展管理页中移除 TMWD CDP Bridge 扩展,或删除已加载的 assets/tmwd_cdp_bridge 扩展配置。
MIT License. See LICENSE.