| name | opencli-usage |
| description | 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 100+ adapters. |
| version | 1.7.0 |
| author | jackwener |
| tags | ["opencli","cli","browser","web","chrome-extension","cdp","bilibili","twitter","reddit","xiaohongshu","github","youtube","AI","agent","automation"] |
OpenCLI Usage Guide
Make any website or Electron App your CLI. Reuse Chrome login, zero risk, AI-powered discovery.
Install & Run
npm install -g @jackwener/opencli
opencli <command>
cd ~/code/opencli && npm install
npx tsx src/main.ts <command>
npm update -g @jackwener/opencli
Prerequisites
Browser commands require:
- Chrome browser running (logged into target sites)
- opencli Browser Bridge Chrome extension installed (load
extension/ as unpacked in chrome://extensions)
- No further setup needed — the daemon auto-starts on first browser command
Note: You must be logged into the target website in Chrome before running commands. Tabs opened during command execution are auto-closed afterwards.
Public API commands (hackernews, v2ex) need no browser.
Quick Lookup by Capability
| Capability | Platforms (partial list) |
|---|
| search | Bilibili, Twitter, Reddit, Xiaohongshu, Zhihu, YouTube, Google, arXiv, LinkedIn, Pixiv, etc. |
| hot/trending | Bilibili, Twitter, Weibo, HackerNews, Reddit, V2EX, Xueqiu, Lobsters, Douban |
| feed/timeline | Twitter, Reddit, Xiaohongshu, Xueqiu, Jike, Facebook, Instagram, Medium |
| user/profile | Twitter, Reddit, Instagram, TikTok, Facebook, Bilibili, Pixiv |
| post/create | Twitter, Jike, Douyin, Weibo |
| AI chat | Grok, Doubao, ChatGPT, Gemini, Cursor, Codex, NotebookLM |
| finance/stock | Xueqiu, Yahoo Finance, Barchart, Sina Finance, Bloomberg |
| web scraping | opencli web read --url <url> — any URL to Markdown |
| GitHub/DevOps | opencli gh, opencli docker, opencli vercel — external CLI passthrough |
| collaboration | opencli lark-cli, opencli dws, opencli wecom-cli — external CLI passthrough |
Command Quick Reference
Usage: opencli <site> <command> [args] [--limit N] [-f json|yaml|md|csv|table]
Type legend: 🌐 = Browser (needs Chrome login) · ✅ = Public API (no browser) · 🖥️ = Desktop (Electron/CDP) · 🔧 = External CLI (passthrough)
Website Adapters
| Site | Type | Commands |
|---|
| 1688 | 🌐 | search item download store |
| 36kr | 🌐 | hot news search article |
| amazon | 🌐 | bestsellers search product offer discussion movers-shakers new-releases |
| apple-podcasts | ✅ | top search episodes |
| arxiv | ✅ | search paper |
| band | 🌐 | bands posts post mentions |
| barchart | 🌐 | quote options greeks flow |
| bbc | ✅ | news |
| baidu-scholar | 🌐 | search |
| bilibili | 🌐 | hot search me favorite history feed user-videos subtitle dynamic ranking following |
| bloomberg | ✅🌐 | RSS: main markets tech politics · Browser: (full article) |
Desktop Apps (CDP/Electron)
| App | Commands |
|---|
| antigravity | status send read new dump extract-code model watch serve |
| chatgpt | status new send read ask model |
| chatwise | status new send read ask model history export screenshot |
| codex | status send read new dump extract-diff model ask screenshot history export |
| cursor | status send read new dump composer model extract-code ask screenshot history export |
| doubao-app | status new send read ask screenshot dump |
| notion | status search read new write sidebar favorites |
External CLI (passthrough)
opencli install gh
opencli register my-tool
opencli gh pr list --limit 5
opencli docker ps
opencli lark-cli msg send ...
Management
opencli list [-f json|yaml]
opencli validate [site]
opencli doctor
opencli explore <url>
opencli record <url>
All commands support: --format / -f with table json yaml md csv
Configuration
| Variable | Default | Description |
|---|
OPENCLI_DAEMON_PORT | 19825 | Daemon-extension bridge port |
OPENCLI_WINDOW_FOCUSED | false | 1 = open automation windows in foreground |
OPENCLI_BROWSER_CONNECT_TIMEOUT | 30 | Browser connection timeout (seconds) |
OPENCLI_BROWSER_COMMAND_TIMEOUT | 60 | Single command timeout (seconds) |
OPENCLI_BROWSER_EXPLORE_TIMEOUT | 120 | Explore/record timeout (seconds) |
OPENCLI_CDP_ENDPOINT | — | CDP endpoint for remote browser / Electron apps |
OPENCLI_CDP_TARGET | — | Filter CDP targets by URL substring |
OPENCLI_VERBOSE | false | Verbose logging (-v flag also works) |
OPENCLI_DIAGNOSTIC | false | 1 = structured diagnostic on failures |
Self-Repair
If a command fails due to a site change (selector, API, or response schema), automatically fix the adapter and retry instead of reporting failure. Re-run the command with OPENCLI_DIAGNOSTIC=1 to get structured diagnostic context, then fix the adapter file at RepairContext.adapter.sourcePath and retry. Max 3 repair rounds. See the opencli-autofix skill for the full workflow.
Related Skills
- opencli-browser — Browser automation for AI agents (navigate, click, type, extract via Chrome)
- opencli-explorer — Full guide for creating new adapters (API discovery, auth strategy, TS writing)
- opencli-oneshot — Quick 4-step template for adding a single command from a URL
- opencli-autofix — Automatically fix broken adapters when commands fail
- smart-search — Intelligent search router across multiple platforms