Make Any Website & Tool Your CLI. A universal CLI Hub and AI-native runtime. Transform any website, Electron app, or local binary into a standardized command-line interface. Built for AI Agents to discover, learn, and execute tools seamlessly via a unified AGENT.md integration.
npx skills add https://github.com/jackwener/opencli --skill smart-searchInstall this skill with the CLI and start using the SKILL.md workflow in your workspace.
Turn websites, browser sessions, Electron apps, and local tools into deterministic interfaces for humans and AI agents.
Reuse your logged-in browser, automate live workflows, and crystallize repeated actions into reusable CLI commands.
OpenCLI gives you one surface for three different kinds of automation:
opencli-adapter-author skill in your AI agent (Claude Code, Cursor, etc.), and it can navigate, click, type, extract, and inspect any page through your logged-in browser via opencli browser primitives.opencli browser + the opencli-adapter-author skill, which guides from first recon through field decoding, code, and opencli browser verify.It also works as a CLI hub for local tools such as gh, docker, and other binaries you register yourself, plus desktop app adapters for Electron apps like Cursor, Codex, Antigravity, ChatGPT, and Notion.
opencli-adapter-author skill, and your AI agent can operate any website: navigate, click, type, extract, screenshot — all through your logged-in Chrome session.opencli-adapter-author skill + opencli browser verify.npm install -g @jackwener/opencli
OpenCLI connects to Chrome/Chromium through a lightweight Browser Bridge extension plus a small local daemon. The daemon auto-starts when needed.
opencli-extension-v{version}.zip from the GitHub Releases page.chrome://extensions, and enable Developer mode.opencli doctor
opencli list
opencli hackernews top --limit 5
opencli bilibili hot --limit 5
Use OpenCLI directly when you want a reliable command instead of a live browser session:
opencli list shows every registered command.opencli <site> <command> runs a built-in or generated adapter.opencli register mycli exposes a local CLI through the same discovery surface.opencli doctor helps diagnose browser connectivity.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.
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
npx skills add jackwener/opencli --skill smart-search
| Skill | When to use | Example prompt to your AI agent |
|---|---|---|
| opencli-adapter-author | Operate a site in real time, or write a reusable adapter for a new site | "Help me check my Xiaohongshu notifications" / "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 | Browser automation reference for AI agents | "Use browser commands to scrape this page" |
| opencli-usage | Quick reference for all OpenCLI commands and sites | "What commands does OpenCLI have for Twitter?" |
| smart-search | Search across existing OpenCLI capabilities | "Find me a Bilibili trending adapter" |
Once opencli-adapter-author is installed, your AI agent can:
The agent handles all the opencli browser commands internally — you just describe what you want done in natural language.
Skill references:
skills/opencli-adapter-author/SKILL.md — browser operation + adapter authoring, end-to-endskills/opencli-autofix/SKILL.md — repair broken adaptersskills/opencli-browser/SKILL.md — browser automation referenceskills/opencli-usage/SKILL.md — command and site referenceskills/smart-search/SKILL.md — capability searchAvailable browser commands include open, state, click, type, select, keys, wait, get, find, extract, frames, screenshot, scroll, back, eval, network, tab list, tab new, tab select, tab close, init, verify, and close.
opencli browser open <url> and opencli browser tab new [url] both return a target ID. Use opencli browser tab list to inspect the target IDs of tabs that already exist, 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 opencli browser ... commands.
browser: AI Agent browser controlopencli browser commands are the low-level primitives that AI Agents use to operate websites. You don't run these manually — instead, install the opencli-adapter-author skill into your AI agent, describe what you want in natural language, and the agent handles the browser operations.
For example, tell your agent: "Help me check my Xiaohongshu notifications" — the agent will use opencli browser open, state, click, etc. under the hood.
Use site-specific commands such as opencli hackernews top or opencli reddit hot when the capability already exists. These are deterministic and work without browser — ideal for both humans and AI agents.
When the site you need is not yet covered, use the opencli-adapter-author skill. It takes the agent end-to-end:
PUBLIC / COOKIE / HEADER / INTERCEPT.opencli browser init <site>/<name> → write adapter → opencli browser verify <site>/<name>.~/.opencli/sites/<site>/ so the next adapter for the same site is faster.OpenCLI is not only for websites. It can also:
gh, docker, obsidian, or custom tools through opencli <tool> ...Important: Browser-backed commands reuse your Chrome/Chromium login session. If you get empty data or permission-like failures, first confirm the site is already open and authenticated in Chrome/Chromium.
| Variable | Default | Description |
|---|---|---|
OPENCLI_DAEMON_PORT |
19825 |
HTTP port for the daemon-extension bridge |
OPENCLI_WINDOW_FOCUSED |
false |
Set to 1 to open automation windows in the foreground (useful for debugging). The --focus flag sets this. |
OPENCLI_LIVE |
false |
Set to 1 to keep the automation window open after an adapter command finishes (useful for inspection). The --live flag sets this. |
OPENCLI_BROWSER_CONNECT_TIMEOUT |
30 |
Seconds to wait for browser connection |
OPENCLI_BROWSER_COMMAND_TIMEOUT |
60 |
Seconds to wait for a single browser command |
OPENCLI_CDP_ENDPOINT |
— | Chrome DevTools Protocol endpoint for remote browser or Electron apps |
OPENCLI_CDP_TARGET |
— | Filter CDP targets by URL substring (e.g. detail.1688.com) |
OPENCLI_VERBOSE |
false |
Enable verbose logging (-v flag also works) |
OPENCLI_DIAGNOSTIC |
false |
Set to 1 to capture structured diagnostic context on failures |
DEBUG_SNAPSHOT |
— | Set to 1 for DOM snapshot debug output |
--focus works for both opencli browser * and browser-backed adapter commands. --live is mainly for adapter commands: browser subcommands already keep the automation window open until you run opencli browser close or the idle timeout expires.
npm install -g @jackwener/opencli@latest
# If you use the packaged OpenCLI skills, refresh them too
npx skills add jackwener/opencli
Or refresh only the skills you actually use:
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
npx skills add jackwener/opencli --skill smart-search
Install from source:
git clone [email protected]:jackwener/opencli.git
cd opencli
npm install
npm run build
npm link
To load the source Browser Bridge extension:
chrome://extensions and enable Developer mode.extension/ directory.| Site | Commands |
|---|---|
| xiaohongshu | search note comments feed user download publish notifications creator-notes creator-notes-summary creator-note-detail creator-profile creator-stats |
| bilibili | hot search history feed ranking download comments dynamic favorite following me subtitle video user-videos |
| tieba | hot posts search read |
| hupu | hot search detail mentions reply like unlike |
trending search timeline tweets lists list-tweets list-add list-remove bookmarks post download profile article like likes notifications reply reply-dm thread follow unfollow followers following block unblock bookmark unbookmark delete hide-reply accept |
|
hot frontpage popular search subreddit read user user-posts user-comments upvote upvoted save saved comment subscribe |
|
| zhihu | hot search question download follow like favorite comment answer |
| amazon | bestsellers search product offer discussion movers-shakers new-releases rankings |
| 1688 | search item assets download store |
| gitee | trending search user |
| gemini | new ask image deep-research deep-research-result |
| yuanbao | new ask |
| notebooklm | status list open current get history summary note-list notes-get source-list source-get source-fulltext source-guide |
| spotify | auth status play pause next prev volume search queue shuffle repeat |
| xianyu | search item chat |
| xiaoe | courses detail catalog play-url content |
| quark | ls mkdir mv rename rm save share-tree |
| uiverse | code preview |
| baidu-scholar | search |
| google-scholar | search |
| gov-law | search recent |
| gov-policy | search recent |
| nowcoder | hot trending topics recommend creators companies jobs search suggest experience referral salary papers practice notifications detail |
| wanfang | search |
| hackernews | top new best ask show jobs search user |
| xiaoyuzhou | auth* podcast* podcast-episodes* episode* download* transcript* |
90+ adapters in total — → see all supported sites & commands
* opencli xiaoyuzhou podcast, podcast-episodes, episode, download, and transcript require local Xiaoyuzhou credentials in ~/.opencli/xiaoyuzhou.json.
OpenCLI acts as a universal hub for your existing command-line tools — unified discovery, pure passthrough execution, and auto-install (if a tool isn't installed, OpenCLI runs brew install <tool> automatically before re-running the command).
| External CLI | Description | Example |
|---|---|---|
| gh | GitHub CLI | opencli gh pr list --limit 5 |
| obsidian | Obsidian vault management | opencli obsidian search query="AI" |
| docker | Docker | opencli docker ps |
| lark-cli | Lark/Feishu — messages, docs, calendar, tasks, 200+ commands | opencli lark-cli calendar +agenda |
| dws | DingTalk — cross-platform CLI for DingTalk's full suite, designed for humans and AI agents | opencli dws msg send --to user "hello" |
| wecom-cli | WeCom/企业微信 — CLI for WeCom open platform, for humans and AI agents | opencli wecom-cli msg send --to user "hello" |
| vercel | Vercel — deploy projects, manage domains, env vars, logs | opencli vercel deploy --prod |
Register your own — add any local CLI so AI agents can discover it via opencli list:
opencli register mycli
Control Electron desktop apps directly from the terminal. Each adapter has its own detailed documentation:
| App | Description | Doc |
|---|---|---|
| Cursor | Control Cursor IDE — Composer, chat, code extraction | Doc |
| Codex | Drive OpenAI Codex CLI agent headlessly | Doc |
| Antigravity | Control Antigravity Ultra from terminal | Doc |
| ChatGPT App | Automate ChatGPT macOS desktop app | Doc |
| ChatWise | Multi-LLM client (GPT-4, Claude, Gemini) | Doc |
| Notion | Search, read, write Notion pages | Doc |
| Discord | Discord Desktop — messages, channels, servers | Doc |
| Doubao | Control Doubao AI desktop app via CDP | Doc |
To add a new Electron app, start with docs/guide/electron-app-cli.md.
OpenCLI supports downloading images, videos, and articles from supported platforms.
| Platform | Content Types | Notes |
|---|---|---|
| xiaohongshu | Images, Videos | Downloads all media from a note |
| 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 | Articles (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 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.
All built-in commands support --format / -f with table (default), json, 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
opencli follows Unix sysexits.h conventions so it integrates naturally with shell pipelines and CI scripts:
| Code | Meaning | When |
|---|---|---|
0 |
Success | Command completed normally |
1 |
Generic error | Unexpected / unclassified failure |
2 |
Usage error | Bad arguments or unknown command |
66 |
Empty result | No data returned (EX_NOINPUT) |
69 |
Service unavailable | Browser Bridge not connected (EX_UNAVAILABLE) |
75 |
Temporary failure | Command timed out — retry (EX_TEMPFAIL) |
77 |
Auth required | Not logged in to target site (EX_NOPERM) |
78 |
Config error | Missing credentials or bad config (EX_CONFIG) |
130 |
Interrupted | Ctrl-C / SIGINT |
opencli spotify status || echo "exit $?" # 69 if browser not running
opencli gh issue list 2>/dev/null
[ $? -eq 77 ] && opencli gh auth login # auto-auth if not logged in
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
| Plugin | Type | Description |
|---|---|---|
| opencli-plugin-github-trending | JS | GitHub Trending repositories |
| opencli-plugin-hot-digest | JS | Multi-platform trending aggregator |
| opencli-plugin-juejin | JS | 稀土掘金 (Juejin) hot articles |
| opencli-plugin-vk | JS | VK (VKontakte) wall, feed, and search |
See Plugins Guide for creating your own plugin.
Before writing any adapter code, read the opencli-adapter-author skill. It takes you end-to-end:
opencli browser network, eval, or the interceptor fallback.PUBLIC / COOKIE / HEADER / INTERCEPT).opencli browser init.opencli browser verify <site>/<name> before shipping.Adapters you write outside the repo live at ~/.opencli/clis/<site>/<name>.js. Site knowledge (endpoints, field maps, fixtures) accumulates in ~/.opencli/sites/<site>/ so the next adapter for the same site starts from context instead of zero.
See TESTING.md for how to run and write tests.
chrome://extensions in Chrome or Chromium.node:util styleText (stable in Node 21+).curl localhost:19825/status · View logs: curl localhost:19825/logs