除 npm 包外还需单独安装 Chrome 扩展(商店或手动 Load unpacked),否则连不上浏览器;browser 页面操作命令必须带 --session ;多 Chrome profile 同时连接时需先用 opencli profile use 指定,否则会要求你选择。
OpenCLI
jackwenerApache-2.0活跃维护把任意网站变成命令行工具,让 AI Agent 复用你已登录的浏览器会话执行网页操作,省去重复登录和手动点击。
Make Any Website into CLI & Use your logged-in browser by AI agent.
node --version
npm install -g @jackwener/opencli
opencli doctorREADME 未说明 GPU 或显存要求;npm 安装需 Node.js >= 20.18.1,通过 Chrome/Chromium 的 Browser Bridge 扩展加本地守护进程连接浏览器。
把任意网站变成 CLI,并让 AI agent 复用你已登录的 Chrome 会话做浏览器自动化
把任意网站变成命令行工具,让 AI Agent 复用你已登录的浏览器会话执行网页操作,省去重复登录和手动点击。
核心能力
- 内置 B 站、知乎、小红书、Reddit、HN、X 等站点适配器命令
- 通过 opencli browser 原语让 agent 导航、点击、填表、提取页面数据
- 用结构化 DOM 快照读取页面而非截图,便于 agent 解析
- 提供 adapter init/check/test 流程与技能,端到端编写新站点适配器
- 命令默认输出 JSON 契约,失败带 error code 与 hint 便于程序处理
容易踩的坑
- v2.0.3最新正式版2026-11-07 · 2026-11-07 17:45 UTC
Includes Chrome extension 1.0.27. Update the extension for loopback connectivity, native keyboard input, and browser-window recovery fixes.
Features
- Add Pinduoduo search and Twitter list-members commands.
- Include replies and retweets in Twitter search results, and suggest site login commands on authentication failures.
Fixes
- Agree on a reachable loopback address across the daemon, CLI, and extension; avoid replacing a newer daemon with an older CLI.
- Aim browser clicks at the resolved element, detect sibling occlusion, send complete native keyboard events, and recover owned idle windows after restart.
- Fall back to DataTransfer uploads when the file chooser does not open; safely replace stale plugin host junctions on Windows.
- Preserve JavaScript pipes and quoted expressions in pipelines, append query parameters before URL fragments, and escape CSV/Markdown headers.
- Isolate concurrent download temporary files, preserve article code blocks, and honor yt-dlp failure exit status.
- Improve LinkedIn experience, activity, and job parsing; wait for Weixin verification and article rendering; fix Ctrip train navigation.
- Improve Twitter identity, Facebook search, Reddit blocked-page handling, JD login detection, Gemini conversation extraction, Grok session/text extraction, and YouTube login detection.
- Update Xiaohongshu search and creator-note extraction, and report unloaded interaction counts as errors rather than zero.
- Update undici to 7.30.1 for published security advisories.
What's Changed
- docs: highlight Chrome Web Store installation by @jackwener in https://github.com/jackwener/OpenCLI/pull/2687
- fix(extension): recover marked idle browser windows after restart by @wangning19940904 in https://github.com/jackwener/OpenCLI/pull/2703
- fix(deps): bump undici to 7.30.1 for three published advisories by @yisiliu in https://github.com/jackwener/OpenCLI/pull/2709
- fix(skills): pass --session to autofix browser page commands by @StrivingLee in https://github.com/jackwener/OpenCLI/pull/2706
- fix(pipeline/template): evaluate expressions that start and end with a quote by @Enesuygurs in https://github.com/jackwener/OpenCLI/pull/2696
- fix(ctrip): use one-way ticketType and unblock train navigation (#2689) by @nengqi in https://github.com/jackwener/OpenCLI/pull/2700
- fix(adapters): fall through to DataTransfer upload when the intercepted file chooser never opens by @LeoLin990405 in https://github.com/jackwener/OpenCLI/pull/2683
- fix(xiaohongshu): fail typed when a note's interaction counts never load instead of reporting 0 by @yisiliu in https://github.com/jackwener/OpenCLI/pull/2708
- fix(linkedin): prevent title and company shift on grouped experience cards (#2433) by @nengqi in https://github.com/jackwener/OpenCLI/pull/2701
- fix(weixin): wait for the captcha to auto-resolve before failing (#2045) by @LeoLin990405 in https://github.com/jackwener/OpenCLI/pull/2694
- fix(browser): aim retargeted clicks at the resolved element, not the ancestor centre by @LeoLin990405 in https://github.com/jackwener/OpenCLI/pull/2682
- fix(xiaohongshu): read the current .note-card render in creator-notes DOM fallback by @jackwener in https://github.com/jackwener/OpenCLI/pull/2779
- fix(xiaohongshu): search on the AI-search homepage, with a guarded result-URL fallback by @jackwener in https://github.com/jackwener/OpenCLI/pull/2777
- fix(daemon): agree on one loopback address across daemon, CLI and extension (#2690) by @jackwener in https://github.com/jackwener/OpenCLI/pull/2782
- fix(daemon): only replace a daemon older than the CLI (#2761) by @jackwener in https://github.com/jackwener/OpenCLI/pull/2783
- fix(reddit): classify Reddit's network-security block across all read commands; keep partial read on denied expansion by @jackwener in https://github.com/jackwener/OpenCLI/pull/2784
- fix(output): escape CSV and Markdown column headers by @gavenren in https://github.com/jackwener/OpenCLI/pull/2743
- fix(download):
- v2.0.22026-10-20 · 2026-10-20 13:51 UTC
查看更新说明
What's Changed
- fix(release): verified OIDC publishing for 2.0.2 by @jackwener in https://github.com/jackwener/OpenCLI/pull/2686
Full Changelog: https://github.com/jackwener/OpenCLI/compare/v2.0.1...v2.0.2
- v2.0.12026-10-19 · 2026-10-19 17:56 UTC
查看更新说明
Includes Chrome extension 1.0.26. Update the extension to receive the navigation fix.
Features
- Add a validated Douyin single-content detail reader (#2667).
Fixes
- Avoid duplicate browser navigations during extension tab lease creation, which can cause Chromium's
Navigation rejected.error without--trace(#2487, #2679). - Reject native input on hidden pages without replaying the action (#2664).
- Wait for complete Ctrip flight captures in the foreground (#2663).
- Capture page-owned TikTok profile responses and the current identity (#2662).
- Locate LinkedIn activity cards from post permalinks (#2661).
- Bound Xiaohongshu lazy user pagination while retaining collected results (#2666).
- Classify Xueqiu page failures and expose response shape (#2668).
- Classify Instagram read failures and navigate target profiles (#2669).
Upgrade
npm install -g @jackwener/[email protected]The navigation fix requires extension 1.0.26. Chrome Web Store publication follows its review process; the extension ZIP is also attached to this release.
Full Changelog: https://github.com/jackwener/OpenCLI/compare/v2.0.0...v2.0.1
- v2.0.0OpenCLI 2.0.02026-10-17 · 2026-10-17 10:17 UTC
查看更新说明
A major release focused on agent experience: a smaller CLI surface, predictable JSON results, native Chrome APIs, and evidence-driven adapter development. Includes Chrome extension 1.0.25.
Breaking changes and migration
- Browser sessions are explicit options: use
opencli browser <command> ... --session researchinstead of positional session names. - CLI results default to
{ "ok": true, "data": ... }; failures use{ "ok": false, "error": { "code", "message", "hint", ... } }and a nonzero exit status. Update consumers to readdata; follow modes emit JSON Lines. Explicit human-readable formats and raw exports remain available. - Use
opencli adapter init,adapter test, andadapter checkfor adapter authoring and validation. These replace the former browser init/verify and adapter validation entry points. - Use
opencli browser network --staticfor captured requests plus AST-derived endpoint evidence, andopencli browser state --diagnosticsfor page diagnostics. The separate discover/analyze workflow is removed. - Electron desktop automation, its app registry and public launcher export, site sitemap knowledge, and external CLI Hub passthrough are removed. Direct CDP connections to Chrome remain supported.
- Existing JS adapter registration and execution contracts (
cli({...}),func(args),func(page, args)) remain supported. AdapterdefaultFormatno longer overrides the CLI's JSON default.
Features
- Native Chrome API discovery and calls through
opencli browser chrome describeandchrome call, including tab/window management and tab-group creation and editing without attaching a page session. Managed session resources are protected. - Compact, paginated command discovery with
opencli list [query] --site --limit --offset; streamlined bundled agent skills and adapter authoring. - AST-based static endpoint discovery integrated with captured network evidence, with incomplete network captures retained when requested.
- Per-site slot pools give concurrent adapter runs exclusive tabs and run-level pacing; optional owned-tab cleanup and configurable browser idle timeout.
- Proton API inbox and verified browser authentication; Xiaohongshu comment/comment-delete and YouTube comment commands; richer Twitter, YouTube, and Bilibili metadata.
Fixes
- Exclude Chrome 155 browser toolbar targets from direct CDP page selection so blank tabs remain usable.
- More reliable ChatGPT file/image uploads and composer targeting; current Gemini, Grok, and DeepSeek composer flows.
- Xiaohongshu captcha/search/comment handling, Taobao cart confirmation and blocked-page detection, DBLP browser-backed XML reads, and YouTube channel-handle resolution.
- Plugin path containment and host-package linking, browser upload file chooser activation, auth recovery hints, and structured error/exit-code handling.
- Updated Vitest to address GHSA-82fw-gwwq-j7x9.
Full changelog: https://github.com/jackwener/OpenCLI/compare/v1.8.8...v2.0.0
- Browser sessions are explicit options: use
- v1.8.82026-08-30 · 2026-08-30 17:37 UTC
查看更新说明
What's Changed
- fix: upgrade undici to 7.29.0, 8.9.0 (CVE-2026-13697) by @anupamme in https://github.com/jackwener/OpenCLI/pull/2326
- fix: sync package-lock with undici 7.29.0 bump by @jackwener in https://github.com/jackwener/OpenCLI/pull/2361
- docs: fix broken star history chart by @OctoBored in https://github.com/jackwener/OpenCLI/pull/2301
- fix(weixin): recover draft cover uploads by @jackwener in https://github.com/jackwener/OpenCLI/pull/2362
- feat(bilibili): add --top to fetch pinned comments by @henrycjchen in https://github.com/jackwener/OpenCLI/pull/2106
- fix(xiaohongshu): harvest search rows during scroll instead of first/last screen union by @sleepyy-dog in https://github.com/jackwener/OpenCLI/pull/2349
- refactor(sinafinance): use rolling news API by @jackwener in https://github.com/jackwener/OpenCLI/pull/2365
- chore(xiaohongshu): share evaluate unwrap helper by @jackwener in https://github.com/jackwener/OpenCLI/pull/2363
- feat(zhihu): preserve comment reply threads by @wuyak in https://github.com/jackwener/OpenCLI/pull/2306
- feat(zhihu): export answers with local images by @wuyak in https://github.com/jackwener/OpenCLI/pull/2304
- fix(xiaohongshu): recover from collapsed masonry render by reopening in a fresh tab by @sleepyy-dog in https://github.com/jackwener/OpenCLI/pull/2355
- feat(jira): add custom field support by @du00cs in https://github.com/jackwener/OpenCLI/pull/2289
- feat(minimax): add music-generation adapter with global and China endpoints by @octo-patch in https://github.com/jackwener/OpenCLI/pull/2290
- feat(bilibili): add creator analytics adapter by @ele-yufo in https://github.com/jackwener/OpenCLI/pull/2268
- feat(xiaohongshu): add search filter panel options (--sort/--note-type/--publish-time/--scope/--location) by @xemaya in https://github.com/jackwener/OpenCLI/pull/2276
- feat(twitter): intercept complete followers timeline by @jackwener in https://github.com/jackwener/OpenCLI/pull/2380
- fix(notebooklm): support redirected domain by @lingjiuu in https://github.com/jackwener/OpenCLI/pull/2228
- fix: declare the Node >=20.18.1 floor that undici 7.x already requires by @jackwener in https://github.com/jackwener/OpenCLI/pull/2381
- fix(twitter): read current following follower counts by @jackwener in https://github.com/jackwener/OpenCLI/pull/2382
- feat(xiaoyuzhou): add playback history by @lmmsoft in https://github.com/jackwener/OpenCLI/pull/2260
- fix(jike): reject anonymous read sessions by @jackwener in https://github.com/jackwener/OpenCLI/pull/2384
- feat(execution): support OPENCLI_SITE_SESSION env default for adapter site sessions by @GabrielDrapor in https://github.com/jackwener/OpenCLI/pull/2221
- feat(youtube): paginate authenticated watch history by @jackwener in https://github.com/jackwener/OpenCLI/pull/2386
- fix(youtube): paginate search results by @jackwener in https://github.com/jackwener/OpenCLI/pull/2387
- fix(midjourney): always poll job history at least once before timing out by @jackwener in https://github.com/jackwener/OpenCLI/pull/2383
- chore: npm audit fix for dev-dependency advisories by @jackwener in https://github.com/jackwener/OpenCLI/pull/2378
- feat(pixiv): add novel commands by @b1llow in https://github.com/jackwener/OpenCLI/pull/2112
- fix(trip): repair flight extraction — dropped font-black class emptied every row by @yisiliu in https://github.com/jackwener/OpenCLI/pull/2385
- fix(nowcoder): distinguish content and moment posts by @aolast in https://github.com/jackwener/OpenCLI/pull/2218
- fix(ctrip): read structured flight results by @jackwener in https://github.com/jackwener/OpenCLI/pull/2393
- feat(jike): use structured APIs for search and notifications by @jackwener in https://github.com/jackwener/OpenCLI/pull/2394
- fix(linkedin): make sent invitations and thread snapshots accurate by @jackwener in https://github.com/jackwener/OpenCLI/pull/2395
- docs(skill): add evidence-first Deep Recon workflow by @jackwener in https://github.com/jackwener/Ope
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
OpenCLI
Convert any website into a CLI & run Browser Use on your logged-in Chrome. Turn websites and browser sessions into deterministic interfaces for humans and AI agents. Or run Browser Use against any page — navigate, fill forms, click, extract, automate.
OpenCLI is a general-purpose browser automation CLI for AI agents and an agent-browser alternative. Navigate, inspect, click, fill forms, extract, and screenshot websites without a site adapter. Built-in adapters add reusable, deterministic site commands. See OpenCLI vs agent-browser and migration.
OpenCLI gives you one surface for three different kinds of automation:
- Use built-in adapters for sites like Bilibili, Zhihu, Xiaohongshu, Reddit, HackerNews, Twitter/X, and many more.
- Let AI Agents operate any website — install the
opencli-browserskill in your AI agent (Claude Code, Cursor, etc.), and it can navigate, click, type/fill, extract, and inspect any page through your logged-in browser viaopencli browserprimitives. - Write new adapters end-to-end with
opencli browser+ theopencli-adapter-authorskill, which guides from first recon through field decoding, code, andopencli adapter test.
Agent command contract
Commands default to JSON: { "ok": true, "data": ... }; failures return
{ "ok": false, "error": { "code": "...", "message": "...", "hint": "..." } }
on stdout with a nonzero exit code. Logs use stderr. Explicit human formats,
help, version and completion retain their own formats; browser follow modes use JSON Lines.
opencli list search --site github
opencli browser open https://example.com --session research
opencli browser network --static --session research
opencli browser chrome describe
opencli adapter check github/search
list returns compact, paginated capabilities (commands, total, nextOffset);
read arguments with <command> --help -f json. Page scope is --session, native
Chrome calls need no session. Adapter authoring is grouped under adapter init|check|test.
state --diagnostics and network --static replace analyze and discover.
This changes CLI syntax and JSON output. JS adapters keep cli({...}),
func(args) and func(page, args); adapter defaultFormat no longer changes the CLI default.
Quick Start
1. Install OpenCLI
For desktop use, start with OpenCLIApp. It bundles the OpenCLI runtime,
keeps the managed opencli command installed, and gives you a system tray UI
for setup, diagnostics, updates, browser-login keepalive, and Web → Markdown.
Option A — OpenCLIApp (recommended for macOS / Windows):
Download the latest app from https://opencli.info/download, install it, then
open the app once and use the System page to install or repair the opencli
command.
Option B — npm global install (CLI-only / CI / servers): OpenCLI requires Node.js >= 20.18.1 when installed through npm.
node --version
npm install -g @jackwener/opencli
2. Install the Browser Bridge Extension
OpenCLI connects to Chrome/Chromium through a lightweight Browser Bridge extension plus a small local daemon. The daemon auto-starts when needed.
Option A — Chrome Web Store (recommended): Install OpenCLI from the Chrome Web Store.
Option B — Manual install:
- Download the latest
opencli-extension-v{version}.zipfrom the GitHub Releases page. - Unzip it, open
chrome://extensions, and enable Developer mode. - Click Load unpacked and select the unzipped folder.
3. Verify the setup
opencli doctor
4. Optional: name your Chrome profile
Each Chrome profile runs its own OpenCLI extension instance. If you use multiple Chrome profiles, list the connected profiles and assign local aliases:
opencli profile list
opencli profile rename <contextId> work
opencli profile use work
opencli --profile work browser main state
With only one connected profile, OpenCLI uses it automatically. With multiple connected profiles and no default, OpenCLI asks you to choose instead of guessing.
5. Run your first commands
opencli list
opencli hackernews top --limit 5
opencli bilibili hot --limit 5
For Humans
Use OpenCLI directly when you want a reliable command instead of a live browser session:
opencli listshows every registered command.opencli <site> <command>runs a built-in or generated adapter.opencli doctorhelps diagnose browser connectivity.
Extending OpenCLI
If you want to add your own commands, start with the Extending OpenCLI guide. README keeps this short; the guide covers the directory layout, source-control model, and install commands.
| Need | Recommended path |
|---|---|
| Keep personal website commands in your own Git repo | opencli plugin create + opencli plugin install file://... |
| Quickly draft a private local adapter | opencli adapter init <site>/<command> in ~/.opencli/clis/ |
| Modify an official adapter locally | opencli adapter eject <site> + opencli adapter reset <site> |
| Publish or install third-party commands | opencli plugin install github:user/repo |
Close temporary browser tabs after use
To remove temporary owned tabs when a workflow finishes:
export OPENCLI_CLOSE_OWNED_TAB=1
opencli web read --url https://example.com --stdout true
# Multi-step browser sessions stay open between calls; close explicitly at the end:
opencli browser close --session research
This opts into closing only the current lease's owned tab. Chrome closes its
window automatically if no tabs remain; existing user pages and other sessions
are preserved. Bound tabs are detached and kept open. The default reusable
container policy, idle expiry, --keep-tab true, and persistent site sessions
remain unchanged. Use --site-session ephemeral for one-shot reads of adapters
that otherwise keep a persistent site session.
Cleanup uses a dedicated action, so older extensions reject it without releasing
the lease, and requires an extension acknowledgement. If cleanup fails or the extension
is too old, a warning reports it separately from the site action. Retry explicit
browser cleanup, or close a remaining one-shot adapter tab manually; do not
repeat a completed site write. Explicit browser close also exits
with an error; a one-shot adapter can still return its already-completed result.
For AI Agents
OpenCLI's browser commands are designed to be used by AI Agents — not run manually. Install skills into your AI agent (Claude Code, Cursor, etc.), and the agent operates websites on your behalf using your logged-in Chrome session.
Install skills (also refreshes existing installs)
npx skills add jackwener/opencli
Or install only what you need:
npx skills add jackwener/opencli --skill opencli-adapter-author
npx skills add jackwener/opencli --skill opencli-autofix
npx skills add jackwener/opencli --skill opencli-browser
npx skills add jackwener/opencli --skill opencli-usage
OpenCLI no longer ships the sitemap skills. Older opencli-sitemap-author and
opencli-browser-sitemap copies may remain in an agent's separate skills directory after an
upgrade. If they remain, use the agent's removal flow if available; otherwise remove only those two
directories (for example, ~/.agents/skills/opencli-sitemap-author). The location varies by agent;
keep the rest of the skills directory.
Which skill to use
| Skill | When to use | Example prompt to your AI agent |
|---|---|---|
| opencli-adapter-author | Write a reusable adapter for a new site or add a command to an existing site | "Write an adapter for douyin trending" / "Make a command that grabs the top posts from this page" |
| opencli-autofix | Repair a broken adapter when a built-in command fails | "opencli zhihu hot is returning empty — fix it" |
| opencli-browser | Drive a real Chrome page ad-hoc — navigate, fill forms, click, extract | "Help me check my Xiaohongshu notifications" / "Help me fill out this form" / "Use browser commands to scrape this page" |
| opencli-usage | Quick reference for all OpenCLI commands and sites | "What commands does OpenCLI have for Twitter?" |
How it works
Once opencli-browser is installed, your AI agent can:
- Navigate to any URL using your logged-in browser
- Read page content via structured DOM snapshots (not screenshots)
- Interact — click buttons, fill forms, select options, press keys
- Extract data from the page or intercept network API responses
- Wait for elements, text, or page transitions
The agent handles all the opencli browser commands internally — you just describe what you want done in natural language.
Skill references:
skills/opencli-browser/SKILL.md— drive Chrome ad-hoc (navigate, fill forms, click, extract)skills/opencli-adapter-author/SKILL.md— write a new adapter end-to-endskills/opencli-autofix/SKILL.md— repair broken adaptersskills/opencli-usage/SKILL.md— command and site reference
Available browser commands include open, state, click, type, fill, select, keys, wait, get, find, extract, frames, screenshot, scroll, back, eval, network, tab list, tab new, tab select, tab close, chrome describe, chrome call, and close.
opencli browser commands require a --session <name> option for page operations. opencli browser --session work open <url> and opencli browser --session work tab new [url] both return a target ID. Use opencli browser --session work tab list to inspect target IDs, then pass --tab <targetId> to route a command to a specific tab. tab new creates a new tab without changing the default browser target; only tab select <targetId> promotes that tab to the default target for later untargeted commands in the same session.
Writing a new adapter
When the site you need is not yet covered, use the opencli-adapter-author skill end-to-end:
- Recon the site and pick a pattern (SPA / SSR / JSONP / Token / Streaming).
- Discover the right endpoint — network inspection, initial state, bundle search, token trace, or interceptor fallback.
- Pick auth —
PUBLIC/COOKIE/INTERCEPT/UI/LOCAL. - Decode response fields and design output columns.
opencli browser recon analyze <url>→opencli browser recon init <site>/<name>→ write adapter →opencli browser recon verify <site>/<name>.- Site knowledge persists to
~/.opencli/sites/<site>/so the next adapter for the same site starts from context.
Configuration
| Variable | Default | Description |
|---|---|---|
OPENCLI_PROFILE | — | Browser Bridge profile alias/contextId to use when multiple Chrome profiles are connected |
OPENCLI_WINDOW | command default | Set to foreground or background to override Browser Bridge window placement. Browser-backed commands also accept --window <foreground|background>. |
OPENCLI_SITE_SESSION | adapter default | Set to ephemeral or persistent to override siteSession metadata for browser-backed adapter commands. ephemeral releases the one-shot tab when the command finishes, and the automation window stays open as a reusable container; persistent reuses the site's session. Per-command --site-session takes precedence. |
OPENCLI_CLOSE_OWNED_TAB | 0 | Set to 1 to close the current owned tab on explicit session close or one-shot adapter cleanup instead of keeping a blank placeholder. Requires a supporting Browser Bridge extension. |
OPENCLI_SITE_SLOTS | — | Pool sites onto warm persistent tabs, e.g. xiaohongshu:1:1500-3000,weibo:2 (site:poolSize[:minMs[-maxMs]]). Each command run borrows one slot tab exclusively (reads included) and queues when all are busy; the optional interval spaces runs by a jittered delay. Tabs share one automation window and only its active tab renders, so with poolSize > 1 render-dependent commands (lazy-loaded lists) can stall on background slots — use 1 for those and for risk-controlled sites. --site-session ephemeral opts one invocation out. |
OPENCLI_BROWSER_CONNECT_TIMEOUT | 45 | Seconds to wait for browser connection |
OPENCLI_BROWSER_COMMAND_TIMEOUT | 60 | Seconds to wait for a single browser command |
OPENCLI_BROWSER_IDLE_TIMEOUT | extension default | Owned session idle timeout in seconds; per-command idleTimeout takes precedence. Does not extend explicit cleanup: ephemeral adapters normally release their tab at command completion. Bound tabs and persistent adapter sessions ignore idle timeouts. Releasing a session keeps its reusable window container open. |
OPENCLI_CDP_ENDPOINT | — | Chrome DevTools Protocol endpoint for remote browsers |
OPENCLI_CDP_TARGET | — | Filter CDP targets by URL substring (e.g. detail.1688.com) |
OPENCLI_VERBOSE | false | Enable verbose logging (-v flag also works) |
DEBUG_SNAPSHOT | — | Set to 1 for DOM snapshot debug output |
opencli browser * requires an explicit --session <name> option for page operations, uses a foreground browser window by default, and keeps that session's tab lease until opencli browser --session <session> close or idle cleanup. Browser-backed adapters use a background adapter window and release one-shot tab leases by default. Interactive adapters can declare siteSession: 'persistent' to keep a stable site tab for continuity; pass --site-session ephemeral for a one-shot tab.
Built-in Commands
| Site | Commands |
|---|---|
| xiaohongshu | search ask note comments feed user download publish follow unfollow notifications creator-notes creator-notes-summary creator-note-detail creator-profile creator-stats |
| bilibili | hot search history feed ranking download comments dynamic favorite following follow unfollow me subtitle summary video user-videos creator-stats |
| zhihu | hot search question download follow like favorite comment answer |
| hackernews | top new best ask show jobs search user |
| hltv | search player-summary player-matches player-form player-map-pool player-vs-team player-teammate-impact player-duel match-map match-series team-matches team-map-pool event-matches |
| geogebra | eval add-point add-line add-circle add-polygon triangle hexagon list info |
connect inbox job-detail jobs-preferences post-analytics posts profile-experience profile-projects profile-read profile-analytics safe-send search services-read sent-invitations thread-snapshot timeline salesnav-search salesnav-inbox salesnav-message salesnav-thread | |
hot frontpage popular search subreddit read user user-posts user-comments upvote upvoted save saved comment subscribe | |
trending search timeline tweets lists list-tweets list-create list-delete list-add list-add-batch list-remove list-remove-batch bookmarks post download profile article like likes notifications reply reply-dm thread follow unfollow followers following block unblock bookmark unbookmark delete hide-reply accept | |
| claude | ask send new status read history detail |
| gemini | new ask image deep-research deep-research-result |
| notebooklm | status list open current get history summary note-list notes-get source-list source-get source-fulltext source-guide |
| amazon | bestsellers search product offer discussion movers-shakers new-releases rankings |
| upwork | search feed detail |
| slock | message-send message-read message-search channel-list channel-info channel-create channel-members channel-join task-list task-create task-claim task-status task-convert task-delete thread-list thread-follow attachment-upload attachment-download bookmark-add inbox dm-list server-list server-use whoami |
| huodongxing | events |
| midjourney | login whoami settings quota generate describe history status action download |
Curated highlights — → see all 100+ supported sites & commands (douyin / weibo / spotify / 1688 / quark / nowcoder / google-scholar / hupu / xianyu / weread / weread-official / xiaoyuzhou / Chess.com / and more).
Download Support
OpenCLI supports downloading images, videos, and articles from supported platforms.
| Platform | Content Types | Notes |
|---|---|---|
| xiaohongshu | Images, Videos | Downloads all media from a note |
| rednote | Images, Videos | Downloads all media from a signed rednote note URL |
| bilibili | Videos | Requires yt-dlp installed |
| Images, Videos | From user media tab or single tweet | |
| douban | Images | Poster / still image lists |
| pixiv | Images | Original-quality illustrations, multi-page |
| 1688 | Images, Videos | Downloads page-visible product media from item pages |
| xiaoyuzhou | Audio, Transcript | Downloads episode audio and transcript JSON/text with local credentials |
| zhihu | Column articles, answers (Markdown) | Exports with optional image download |
| weixin | Articles (Markdown) | WeChat Official Account articles |
For video downloads, install yt-dlp first: brew install yt-dlp
opencli xiaohongshu download "https://www.xiaohongshu.com/search_result/<id>?xsec_token=..." --output ./xhs
opencli xiaohongshu download "https://xhslink.com/..." --output ./xhs
opencli rednote download "https://www.rednote.com/search_result/<id>?xsec_token=..." --output ./rednote
opencli bilibili download BV1xxx --output ./bilibili
opencli twitter download elonmusk --limit 20 --output ./twitter
opencli 1688 download 841141931191 --output ./1688-downloads
opencli xiaoyuzhou download 69b3b675772ac2295bfc01d0 --output ./xiaoyuzhou
opencli xiaoyuzhou transcript 69dd0c98e2c8be31551f6a33 --output ./xiaoyuzhou-transcripts
opencli xiaoyuzhou download and transcript require local Xiaoyuzhou credentials in ~/.opencli/xiaoyuzhou.json.
Output Formats
All built-in commands support --format / -f with json (default), table, yaml, md, and csv.
opencli bilibili hot -f json # Pipe to jq or LLMs
opencli bilibili hot -f csv # Spreadsheet-friendly
opencli bilibili hot -v # Verbose: show pipeline debug steps
Exit Codes
opencli follows Unix sysexits.h so CI / scripts can branch on failure mode: 0 success, 66 empty result, 69 Browser Bridge down, 75 timeout, 77 auth required, 78 config error, 130 Ctrl-C. Full reference: docs/guide/exit-codes.md.
Plugins
Extend OpenCLI with community-contributed adapters:
opencli plugin install github:user/opencli-plugin-my-tool
opencli plugin list
opencli plugin update --all
opencli plugin uninstall my-tool
Albato, Goofish and Taobao use local adapter-subdirectory installation; see the installation notes.
| Plugin | Type | Description |
|---|---|---|
| opencli-plugin-albato | JS | Albato automation workflow management: scenario inspection, start/pause, failure diagnosis, and retry |
| opencli-plugin-amap | JS | AutoNavi / 高德地图 spot & route extraction, coordinate decoders (GCJ-02 & WGS-84), and SSR search |
| opencli-plugin-github-trending | JS | GitHub Trending repositories |
| opencli-plugin-goofish | JS | Goofish / 闲鱼 buyer orders, favorites, IM chat, profile, item search, and fulfillment stats |
| opencli-plugin-hot-digest | JS | Multi-platform trending aggregator |
| opencli-plugin-juejin | JS | 稀土掘金 (Juejin) hot articles |
| opencli-plugin-taobao | JS | Taobao buyer chat history, order history, bought shops, favorites, and keyword-based chat summaries |
| opencli-plugin-vk | JS | VK (VKontakte) wall, feed, and search |
| opencli-plugin-x-article-publisher | JS | Publish Markdown with local images as X long-form Articles via OpenCLI and xPoster |
See Plugins Guide for creating your own plugin.
Testing
See TESTING.md for how to run and write tests.
Troubleshooting
- "Extension not connected" — Ensure the Browser Bridge extension is installed from the Chrome Web Store and enabled in
chrome://extensions. - "attach failed: Cannot access a chrome-extension:// URL" — Another extension may be interfering. Try disabling other extensions temporarily.
- Empty data or 'Unauthorized' error — Your Chrome/Chromium login session may have expired. Navigate to the target site and log in again.
- Node API errors / missing
fetch/ startup crash on old Node — OpenCLI requires Node.js >= 20.18.1. Runnode --version, upgrade Node if needed, then retry. - Daemon issues — Check status:
curl localhost:19825/status· View logs:curl localhost:19825/logs