
qiaomu-opencli-browser
Make websites accessible for AI agents. Navigate, click, type, extract, wait — using Chrome with existing login sessions. No LLM API key needed.
- Installs
- 1.1K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/joeseesun/qiaomu-opencli-skills --skill qiaomu-opencli-browser- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads qiaomu-opencli-browser automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
OpenCLI Browser — Browser Automation for AI Agents
Control Chrome step-by-step via CLI. Reuses existing login sessions — no passwords needed.
Prerequisites
opencli doctor # Verify extension + daemon connectivity
Requires: Chrome running + OpenCLI Browser Bridge extension installed.
Critical Rules
- ALWAYS use
stateto inspect the page, NEVER usescreenshot—statereturns structured DOM with[N]element indices, is instant and costs zero tokens.screenshotrequires vision processing and is slow. Only usescreenshotwhen the user explicitly asks to save a visual. - ALWAYS use
click/type/selectfor interaction, NEVER useevalto click or type —eval "el.click()"bypasses scrollIntoView and CDP click pipeline, causing failures on off-screen elements. Usestateto find the[N]index, thenclick <N>. - Verify inputs with
get value, not screenshots — aftertype, runget value <index>to confirm. - Run
stateafter every page change — afteropen,click(on links),scroll, always runstateto see the new elements and their indices. Never guess indices. - Chain commands aggressively with
&&— combineopen + state, multipletypecalls, andtype + get valueinto single&&chains. Each tool call has overhead; chaining cuts it. evalis read-only — useevalONLY for data extraction (JSON.stringify(...)), never for clicking, typing, or navigating. Always wrap in IIFE to avoid variable conflicts:eval "(function(){ const x = ...; return JSON.stringify(x); })()".- Minimize total tool calls — plan your sequence before acting. A good task completion uses 3-5 tool calls, not 15-20. Combine
open + stateas one call. Combinetype + type + clickas one call. Only runstateseparately when you need to discover new indices. - Prefer
networkto discover APIs — most sites have JSON APIs. API-based adapters are more reliable than DOM scraping.
Command Cost Guide
| Cost | Commands | When to use |
|---|---|---|
| Free & instant | state, get *, eval, network, scroll, keys | Default — use these |
| Free but changes page | open, click, type, select, back | Interaction — run state after |
| Expensive (vision tokens) | screenshot | ONLY when user needs a saved image |
Action Chaining Rules
Commands can be chained with &&. The browser persists via daemon, so chaining is safe.
Always chain when possible — fewer tool calls = faster completion:
# GOOD: open + inspect in one call (saves 1 round trip)
opencli browser open https://example.com && opencli browser state
# GOOD: fill form in one call (saves 2 round trips)
opencli browser type 3 "hello" && opencli browser type 4 "world" && opencli browser click 7
# GOOD: type + verify in one call
opencli browser type 5 "test@example.com" && opencli browser get value 5
# GOOD: click + wait + state in one call (for page-changing clicks)
opencli browser click 12 && opencli browser wait time 1 && opencli browser state
# BAD: separate calls for each action (wasteful)
opencli browser type 3 "hello" # Don't do this
opencli browser type 4 "world" # when you can chain
opencli browser click 7 # all three together
Page-changing — always put last in a chain (subsequent commands see stale indices):
open <url>,back,click <link/button that navigates>
Rule: Chain when you already know the indices. Run state separately when you need to discover indices first.
Core Workflow
- Navigate:
opencli browser open <url> - Inspect:
opencli browser state→ elements with[N]indices - Interact: use indices —
click,type,select,keys - Wait (if needed):
opencli browser wait selector ".loaded"orwait text "Success" - Verify:
opencli browser stateoropencli browser get value <N> - Repeat: browser stays open between commands
- Save: write a TS adapter to
~/.opencli/clis/<site>/<command>.ts
Commands
Navigation
opencli browser open <url> # Open URL (page-changing)
opencli browser back # Go back (page-changing)
opencli browser scroll down # Scroll (up/down, --amount N)
opencli browser scroll up --amount 1000
Inspect (free & instant)
opencli browser state # Structured DOM with [N] indices — PRIMARY tool
opencli browser screenshot [path.png] # Save visual to file — ONLY for user deliverables
Get (free & instant)
opencli browser get title # Page title
opencli browser get url # Current URL
opencli browser get text <index> # Element text content
opencli browser get value <index> # Input/textarea value (use to verify after type)
opencli browser get html # Full page HTML
opencli browser get html --selector "h1" # Scoped HTML
opencli browser get attributes <index> # Element attributes
Interact
opencli browser click <index> # Click element [N]
opencli browser type <index> "text" # Type into element [N]
opencli browser select <index> "option" # Select dropdown
opencli browser keys "Enter" # Press key (Enter, Escape, Tab, Control+a)
Wait
Three variants — use the right one for the situation:
opencli browser wait time 3 # Wait N seconds (fixed delay)
opencli browser wait selector ".loaded" # Wait until element appears in DOM
opencli browser wait selector ".spinner" --timeout 5000 # With timeout (default 30s)
opencli browser wait text "Success" # Wait until text appears on page
When to wait: After open on SPAs, after click that triggers async loading, before eval on dynamically rendered content.
Extract (free & instant, read-only)
Use eval ONLY for reading data. Never use it to click, type, or navigate.
opencli browser eval "document.title"
opencli browser eval "JSON.stringify([...document.querySelectorAll('h2')].map(e => e.textContent))"
# IMPORTANT: wrap complex logic in IIFE to avoid "already declared" errors
opencli browser eval "(function(){ const items = [...document.querySelectorAll('.item')]; return JSON.stringify(items.map(e => e.textContent)); })()"
Selector safety: Always use fallback selectors — querySelector returns null on miss:
# BAD: crashes if selector misses
opencli browser eval "document.querySelector('.title').textContent"
# GOOD: fallback with || or ?.
opencli browser eval "(document.querySelector('.title') || document.querySelector('h1') || {textContent:''}).textContent"
opencli browser eval "document.querySelector('.title')?.textContent ?? 'not found'"
Network (API Discovery)
opencli browser network # Show captured API requests (auto-captured since open)
opencli browser network --detail 3 # Show full response body of request #3
opencli browser network --all # Include static resources
Sedimentation (Save as CLI)
opencli browser init hn/top # Generate adapter scaffold at ~/.opencli/clis/hn/top.ts
opencli browser verify hn/top # Test the adapter (adds --limit 3 only if `limit` arg is defined)
initauto-detects the domain from the active browser session (no need to specify it)initcreates the file + populatessite,name,domain, andcolumnsfrom current pageverifyruns the adapter end-to-end and prints output; if nolimitarg exists in the adapter, it won't pass--limit 3
Session
opencli browser close # Close automation window
Example: Extract HN Stories
opencli browser open https://news.ycombinator.com
opencli browser state # See [1] a "Story 1", [2] a "Story 2"...
opencli browser eval "JSON.stringify([...document.querySelectorAll('.titleline a')].slice(0,5).map(a => ({title: a.textContent, url: a.href})))"
opencli browser close
Example: Fill a Form
opencli browser open https://httpbin.org/forms/post
opencli browser state # See [3] input "Customer Name", [4] input "Telephone"
opencli browser type 3 "OpenCLI" && opencli browser type 4 "555-0100"
opencli browser get value 3 # Verify: "OpenCLI"
opencli browser close
Saving as Reusable CLI — Complete Workflow
Step-by-step sedimentation flow:
# 1. Explore the website
opencli browser open https://news.ycombinator.com
opencli browser state # Understand DOM structure
# 2. Discover APIs (crucial for high-quality adapters)
opencli browser eval "fetch('/api/...').then(r=>r.json())" # Trigger API calls
opencli browser network # See captured API requests
opencli browser network --detail 0 # Inspect response body
# 3. Generate scaffold
opencli browser init hn/top # Creates ~/.opencli/clis/hn/top.ts
# 4. Edit the adapter (fill in func logic)
# - If API found: use fetch() directly (Strategy.PUBLIC or COOKIE)
# - If no API: use page.evaluate() for DOM extraction (Strategy.UI)
# 5. Verify
opencli browser verify hn/top # Runs the adapter and shows output
# 6. If verify fails, edit and retry
# 7. Close when done
opencli browser close
Example adapter:
// ~/.opencli/clis/hn/top.ts
import { cli, Strategy } from '@jackwener/opencli/registry';
cli({
site: 'hn',
name: 'top',
description: 'Top Hacker News stories',
domain: 'news.ycombinator.com',
strategy: Strategy.PUBLIC,
browser: false,
args: [{ name: 'limit', type: 'int', default: 5 }],
columns: ['rank', 'title', 'score', 'url'],
func: async (_page, kwargs) => {
const limit = Math.min(Math.max(1, kwargs.limit ?? 5), 50);
const resp = await fetch('https://hacker-news.firebaseio.com/v0/topstories.json');
const ids = await resp.json();
return Promise.all(
ids.slice(0, limit).map(async (id: number, i: number) => {
const item = await (await fetch(`https://hacker-news.firebaseio.com/v0/item/${id}.json`)).json();
return { rank: i + 1, title: item.title, score: item.score, url: item.url ?? '' };
})
);
},
});
Save to ~/.opencli/clis/<site>/<command>.ts → immediately available as opencli <site> <command>.
Strategy Guide
| Strategy | When | browser: |
|---|---|---|
Strategy.PUBLIC | Public API, no auth | false |
Strategy.COOKIE | Needs login cookies | true |
Strategy.UI | Direct DOM interaction | true |
Always prefer API over UI — if you discovered an API during browsing, use fetch() directly.
Tips
- Always
statefirst — never guess element indices, always inspect first - Sessions persist — browser stays open between commands, no need to re-open
- Use
evalfor data extraction —eval "JSON.stringify(...)"is faster than multiplegetcalls - Use
networkto find APIs — JSON APIs are more reliable than DOM scraping - Alias:
opencli opis shorthand foropencli browser
Common Pitfalls
-
form.submit()fails in automation — Don't useform.submit()orevalto submit forms. Navigate directly to the search URL instead:# BAD: form.submit() often silently fails opencli browser eval "document.querySelector('form').submit()" # GOOD: construct the URL and navigate opencli browser open "https://github.com/search?q=opencli&type=repositories" -
GitHub DOM changes frequently — Prefer
data-testidattributes when available; they are more stable than class names or tag structure. -
SPA pages need
waitbefore extraction — Afteropenorclickon single-page apps, the DOM isn't ready immediately. Alwayswait selectororwait textbeforeeval. -
Use
statebefore clicking — Runopencli browser stateto inspect available interactive elements and their indices. Never guess indices from memory. -
evaluateruns in browser context —page.evaluate()in adapters executes inside the browser. Node.js APIs (fs,path,process) are NOT available. Usefetch()for network calls, DOM APIs for page data. -
Backticks in
page.evaluatebreak JSON storage — When writing adapters that will be stored/transported as JSON, avoid template literals insidepage.evaluate. Use string concatenation or function-style evaluate:// BAD: template literal backticks break when adapter is in JSON page.evaluate(`document.querySelector("${selector}")`) // GOOD: function-style evaluate page.evaluate((sel) => document.querySelector(sel), selector)
Troubleshooting
| Error | Fix |
|---|---|
| "Browser not connected" | Run opencli doctor |
| "attach failed: chrome-extension://" | Disable 1Password temporarily |
| Element not found | opencli browser scroll down && opencli browser state |
| Stale indices after page change | Run opencli browser state again to get fresh indices |
FAQ
What does the qiaomu-opencli-browser skill do?
Make websites accessible for AI agents. Navigate, click, type, extract, wait — using Chrome with existing login sessions. No LLM API key needed.
How do I install qiaomu-opencli-browser?
Run npx skills add https://github.com/joeseesun/qiaomu-opencli-skills --skill qiaomu-opencli-browser in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/qiaomu-opencli-browser/ (personal) or .claude/skills/qiaomu-opencli-browser/ (project).
Which AI agents can use qiaomu-opencli-browser?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is qiaomu-opencli-browser safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains qiaomu-opencli-browser?
It is published by joeseesun in joeseesun/qiaomu-opencli-skills. It has 1,051 recorded installs.
More from joeseesun/qiaomu-opencli-skills
opencli
joeseesun/qiaomu-opencli-skills
Open the skill to read its SKILL.md instructions.
qiaomu-opencli-usage
joeseesun/qiaomu-opencli-skills
Use when running OpenCLI commands to interact with websites (Bilibili, Twitter, Reddit, Xiaohongshu, etc.), desktop apps (Cursor, Notion), or public APIs (HackerNews, arXiv). Covers installation, command reference, and output formats for 79+ adapters.
qiaomu-smart-search
joeseesun/qiaomu-opencli-skills
基于 opencli 命令的智能搜索路由器。当用户想要搜索、查询、查找或研究信息时,尤其是涉及指定网站、社交媒体、技术资料、新闻、购物、旅游、求职、金融或中文内容时,务必使用此 skill
qiaomu-opencli-oneshot
joeseesun/qiaomu-opencli-skills
Use when quickly generating a single OpenCLI command from a specific URL and goal description. 4-step process — open page, capture API, write TS adapter, test. For full site exploration, use opencli-explorer instead.
qiaomu-opencli-explorer
joeseesun/qiaomu-opencli-skills
Use when creating a new OpenCLI adapter from scratch, adding support for a new website or platform, exploring a site's API endpoints via browser DevTools, or when a user asks to automatically generate a CLI for a website (e.g. "帮我生成 xxx.com 的 cli"). Covers automated generation, API discovery workflow, authentication strategy selection, TS adapter writing, and testing.
qiaomu-opencli-autofix
joeseesun/qiaomu-opencli-skills
Automatically fix broken OpenCLI adapters when commands fail. Load this skill when an opencli command fails — it guides you through diagnosing the failure via OPENCLIDIAGNOSTIC, patching the adapter, and retrying. Works with any AI agent.
Popular productivity & automation skills
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
lark-doc
open.feishu.cn
飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。
lark-base
open.feishu.cn
飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。
lark-drive
open.feishu.cn
飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。
lark-shared
open.feishu.cn
Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.
lark-im
open.feishu.cn
飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。