page-agent
它能做什么
这项技能帮助开发者加入 page-agent,这是一个在网页中运行的开源助手,能够执行“点击这里”或“填写那个字段”之类的指令。适合希望为自己的网络应用加入 AI 副驾驶的团队。
适用场景
- ✓你希望网络应用的用户可以用日常语言下指令,而不必点击许多界面的时候。
- ✓你想在不重写前端的情况下,为旧的网络应用加上自然语言层以实现现代化的时候。
- ✓你想用本地或托管的语言模型演示 page-agent 的时候。
技能链接
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/web-development/page-agent/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在我们的管理后台中加入 page-agent 副驾驶,让用户可以输入诸如“为 Acme 创建一张发票”之类的指令。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能说明如何把 page-agent 脚本加入你的网站,并将其连接到兼容 OpenAI 的语言模型。智能体把页面读取为文本,并对找到的元素执行操作。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
page-agent
alibaba/page-agent (https://github.com/alibaba/page-agent, 17k+ stars, MIT) is an in-page GUI agent written in TypeScript. It lives inside a webpage, reads the DOM as text (no screenshots, no multi-modal LLM), and executes natural-language instructions like "click the login button, then fill username as John" against the current page. Pure client-side — the host site just includes a script and passes an OpenAI-compatible LLM endpoint.
When to use this skill
Load this skill when a user wants to:
- Ship an AI copilot inside their own web app (SaaS, admin panel, B2B tool, ERP, CRM) — "users on my dashboard should be able to type 'create invoice for Acme Corp and email it' instead of clicking through five screens"
- Modernize a legacy web app without rewriting the frontend — page-agent drops on top of existing DOM
- Add accessibility via natural language — voice / screen-reader users drive the UI by describing what they want
- Demo or evaluate page-agent against a local (Ollama) or hosted (Qwen, OpenAI, OpenRouter) LLM
- Build interactive training / product demos — let an AI walk a user through "how to submit an expense report" live in the real UI
When NOT to use this skill
- User wants Hermes itself to drive a browser → use Hermes' built-in
browser_exectool (local Chromium or a cloud browser). page-agent is the opposite direction. - User wants cross-tab automation without embedding → use Playwright, browser-use, or the page-agent Chrome extension
- User needs visual grounding / screenshots → page-agent is text-DOM only; use a multimodal browser agent instead
Prerequisites
- Node 22.13+ or 24+, npm 10+ (docs claim 11+ but 10.9 works fine)
- An OpenAI-compatible LLM endpoint: Qwen (DashScope), OpenAI, Ollama, OpenRouter, or anything speaking
/v1/chat/completions - Browser with devtools (for debugging)
Path 1 — 30-second demo via CDN (no install)
Fastest way to see it work. Uses alibaba's free testing LLM proxy — for evaluation only, subject to their terms.
Add to any HTML page (or paste into the devtools console as a bookmarklet):
<script src="https://cdn.jsdelivr.net/npm/page-agent@1.8.0/dist/iife/page-agent.demo.js" crossorigin="true"></script>
A panel appears. Type an instruction. Done.
Bookmarklet form (drop into bookmarks bar, click on any page):
javascript:(function(){var s=document.createElement('script');s.src='https://cdn.jsdelivr.net/npm/page-agent@1.8.0/dist/iife/page-agent.demo.js';document.head.appendChild(s);})();
Path 2 — npm install into your own web app (production use)
Inside an existing web project (React / Vue / Svelte / plain):
npm install page-agent
Wire it up with your own LLM endpoint — never ship the demo CDN to real users:
import { PageAgent } from 'page-agent'
const agent = new PageAgent({
model: 'qwen3.5-plus',
baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
apiKey: process.env.LLM_API_KEY, // never hardcode
language: 'en-US',
})
// Show the panel for end users:
agent.panel.show()
// Or drive it programmatically:
await agent.execute('Click submit button, then fill username as John')
Provider examples (any OpenAI-compatible endpoint works):
| Provider | baseURL |
model |
|---|---|---|
| Qwen / DashScope | https://dashscope.aliyuncs.com/compatible-mode/v1 |
qwen3.5-plus |
| OpenAI | https://api.openai.com/v1 |
gpt-4o-mini |
| Ollama (local) | http://localhost:11434/v1 |
qwen3:14b |
| OpenRouter | https://openrouter.ai/api/v1 |
anthropic/claude-sonnet-4.6 |
Key config fields (passed to new PageAgent({...})):
model,baseURL,apiKey— LLM connectionlanguage— UI language (en-US,zh-CN, etc.)- Allowlist and data-masking hooks exist for locking down what the agent can touch — see https://alibaba.github.io/page-agent/ for the full option list
Security. Don't put your apiKey in client-side code for a real deployment — proxy LLM calls through your backend and point baseURL at your proxy. The demo CDN exists because alibaba runs that proxy for evaluation.
Path 3 — clone the source repo (contributing, or hacking on it)
Use this when the user wants to modify page-agent itself, test it against arbitrary sites via a local IIFE bundle, or develop the browser extension.
git clone https://github.com/alibaba/page-agent.git
cd page-agent
常见问题
它会对页面截图吗?
不会。技能说明 page-agent 把 DOM 作为文本读取,不使用截图或多模态模型。
它用于控制我自己的浏览器吗?
不是。技能说明如果你想让 Hermes 操控浏览器,应使用它内置的浏览器工具。
开始需要准备什么?
你需要能访问兼容 OpenAI 的语言模型端点,它可以在本地,也可以是托管的。
详情
热度
- GitHub 星标
- 260k
- 排名
- #579
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-merge-conflict-arbiter
260k以中立第三方的身份,解决两个智能体分支之间的 git 合并冲突,为代码仓库生成一个合并结果。
antigravity-cli
260k指导你安装、更新和排查 Antigravity 命令行工具,包括其插件、登录和沙盒。
blackbox
260k让你的智能体把编程任务交给 Blackbox AI 命令行工具,它会运行多个 AI 模型并挑选最佳结果。
dynamic-workflow
260k教你的智能体把大量相似的工作保存为脚本批量运行,使只有经过验证的结果才返回主对话。