Ot Aiops
支持多协议工业设备数据采集与智能诊断,具备高风险写入防护机制。
通过 inference.sh 实现 AI 代理的网页自动化操作,支持交互、截图与视频录制。
openclaw skills install @okaris/agentic-browser命令、参数、文件名以原文为准
通过 [inference.sh](https://inference.sh) 实现 AI 代理的浏览器自动化。底层使用 Playwright,提供简单的 @e 引用系统用于元素交互。

# 安装 CLI 工具
curl -fsSL https://cli.inference.sh | sh && infsh login
# 打开页面并获取可交互元素
infsh app run agent-browser --function open --input '{"url": "https://example.com"}' --session new安装说明: 安装脚本仅检测操作系统和架构,从
dist.inference.sh下载对应二进制文件,并验证 SHA-256 校验和。无需管理员权限或后台进程。[手动安装与校验方法](https://dist.inference.sh/cli/checksums.txt) 可用。
每次浏览器自动化都遵循以下模式:
@e 引用# 1. 启动会话
RESULT=$(infsh app run agent-browser --function open --session new --input '{
"url": "https://example.com/login"
}')
SESSION_ID=$(echo $RESULT | jq -r '.session_id')
# 元素引用:@e1 [input] "邮箱", @e2 [input] "密码", @e3 [button] "登录"
# 2. 填写并提交表单
infsh app run agent-browser --function interact --session $SESSION_ID --input '{
"action": "fill", "ref": "@e1", "text": "user@example.com"
}'
infsh app run agent-browser --function interact --session $SESSION_ID --input '{
"action": "fill", "ref": "@e2", "text": "password123"
}'
infsh app run agent-browser --function interact --session $SESSION_ID --input '{
"action": "click", "ref": "@e3"
}'
# 3. 导航后重新获取页面状态
infsh app run agent-browser --function snapshot --session $SESSION_ID --input '{}'
# 4. 完成后关闭会话
infsh app run agent-browser --function close --session $SESSION_ID --input '{}'| 函数 | 描述 |
|---|---|
open | 导航至指定 URL,配置浏览器参数(视口大小、代理、视频录制等) |
snapshot | 在 DOM 变化后重新获取页面状态及 @e 引用 |
interact | 使用 @e 引用执行各类操作(点击、输入、拖拽、上传等) |
screenshot | 截取页面截图(视口范围或整页) |
execute | 在页面中运行 JavaScript 代码 |
close | 关闭会话,若启用录制则返回视频文件 |
| 动作 | 描述 | 必需字段 |
|---|---|---|
click | 点击元素 | ref |
dblclick | 双击元素 | ref |
fill | 清空并输入文本 | ref, text |
type | 输入文本(不清空) | text |
press | 按下按键(如 Enter、Tab 等) | text |
select | 选择下拉框选项 | ref, text |
hover | 鼠标悬停于元素上 | ref |
check | 勾选复选框 | ref |
uncheck | 取消勾选复选框 | ref |
drag | 拖拽元素至目标位置 | ref, target_ref |
upload | 上传文件 | ref, file_paths |
scroll | 滚动页面 | direction(up/down/left/right),scroll_amount |
back | 返回上一页历史记录 | - |
wait | 等待指定毫秒数 | wait_ms |
goto | 跳转至新 URL | url |
元素以 @e 引用形式返回:
@e1 [a] "首页" href="/"
@e2 [input type="text"] placeholder="搜索"
@e3 [button] "提交"
@e4 [select] "选择选项"
@e5 [input type="checkbox"] name="同意条款"重要提示: 引用在页面跳转后失效。请在以下情况后务必重新获取快照:
录制浏览器会话,用于调试或文档记录:
# 启用录制(可选显示鼠标光标)
SESSION=$(infsh app run agent-browser --function open --session new --input '{
"url": "https://example.com",
"record_video": true,
"show_cursor": true
}' | jq -r '.session_id')
# ... 执行操作 ...
# 关闭会话以获取视频文件
infsh app run agent-browser --function close --session $SESSION --input '{}'
# 返回结果:{"success": true, "video": <File>}在截图和视频中显示可见的鼠标光标(适用于演示场景):
infsh app run agent-browser --function open --session new --input '{
"url": "https://example.com",
"show_cursor": true,
"record_video": true
}'光标以红色圆点显示,跟随鼠标移动,并在点击时提供反馈。
通过代理服务器路由网络流量:
infsh app run agent-browser --function open --session new --input '{
"url": "https://example.com",
"proxy_url": "http://proxy.example.com:8080",
"proxy_username": "user",
"proxy_password": "pass"
}'向文件输入框上传文件:
infsh app run agent-browser --function interact --session $SESSION --input '{
"action": "upload",
"ref": "@e5",
"file_paths": ["/path/to/file.pdf"]
}'将元素拖拽至目标位置:
infsh app run agent-browser --function interact --session $SESSION --input '{
"action": "drag",
"ref": "@e1",
"target_ref": "@e2"
}'在页面上下文中运行自定义 JavaScript 代码:
infsh app run agent-browser --function execute --session $SESSION --input '{
"code": "document.querySelectorAll(\"h2\").length"
}'
# 返回结果:{"result": "5", "screenshot": <File>}name: Agent Browser
version: 0.1.5
description: 用于自动化浏览器操作的技能,支持页面打开、表单填写、交互操作、截图和视频录制等功能。
summary: 通过命令行控制浏览器,实现网页自动化操作,适用于表单提交、内容抓取、登录会话复用等场景。
| 参考链接 | 说明 |
|---|---|
| [references/commands.md](references/commands.md) | 完整的功能参考,包含所有选项 |
| [references/snapshot-refs.md](references/snapshot-refs.md) | 快照生命周期、失效规则及故障排查 |
| [references/session-management.md](references/session-management.md) | 会话持久化、并行会话支持 |
| [references/authentication.md](references/authentication.md) | 登录流程、OAuth 支持、双因素认证处理 |
| [references/video-recording.md](references/video-recording.md) | 调试用的视频录制工作流 |
| [references/proxy-support.md](references/proxy-support.md) | 代理配置、地理区域测试支持 |
| 模板文件 | 说明 |
|---|---|
| [templates/form-automation.sh](templates/form-automation.sh) | 带验证的表单自动填充 |
| [templates/authenticated-session.sh](templates/authenticated-session.sh) | 登录一次,重复使用会话 |
| [templates/capture-workflow.sh](templates/capture-workflow.sh) | 带截图的内容提取流程 |
SESSION=$(infsh app run agent-browser --function open --session new --input '{
"url": "https://example.com/contact"
}' | jq -r '.session_id')
# 获取元素:@e1 [input] "Name", @e2 [input] "Email", @e3 [textarea], @e4 [button] "Send"
infsh app run agent-browser --function interact --session $SESSION --input '{"action": "fill", "ref": "@e1", "text": "John Doe"}'
infsh app run agent-browser --function interact --session $SESSION --input '{"action": "fill", "ref": "@e2", "text": "john@example.com"}'
infsh app run agent-browser --function interact --session $SESSION --input '{"action": "fill", "ref": "@e3", "text": "Hello!"}'
infsh app run agent-browser --function interact --session $SESSION --input '{"action": "click", "ref": "@e4"}'
infsh app run agent-browser --function snapshot --session $SESSION --input '{}'
infsh app run agent-browser --function close --session $SESSION --input '{}'SESSION=$(infsh app run agent-browser --function open --session new --input '{
"url": "https://google.com"
}' | jq -r '.session_id')
infsh app run agent-browser --function interact --session $SESSION --input '{"action": "fill", "ref": "@e1", "text": "weather today"}'
infsh app run agent-browser --function interact --session $SESSION --input '{"action": "press", "text": "Enter"}'
infsh app run agent-browser --function interact --session $SESSION --input '{"action": "wait", "wait_ms": 2000}'
infsh app run agent-browser --function snapshot --session $SESSION --input '{}'
infsh app run agent-browser --function close --session $SESSION --input '{}'SESSION=$(infsh app run agent-browser --function open --session new --input '{
"url": "https://example.com",
"record_video": true
}' | jq -r '.session_id')
# 生成完整页面截图
infsh app run agent-browser --function screenshot --session $SESSION --input '{
"full_page": true
}'
# 关闭会话并获取视频
RESULT=$(infsh app run agent-browser --function close --session $SESSION --input '{}')
echo $RESULT | jq '.video'浏览器状态在会话内保持。请始终遵循以下步骤:
--session newsession_id# 网页搜索(用于研究与浏览)
npx skills add inference-sh/skills@web-search
# LLM 模型(用于分析提取的内容)
npx skills add inference-sh/skills@llm-models已收录 8 个 Skill