Make any website, Electron App, or Local Tool your CLI.
Zero risk ยท Reuse Chrome login ยท AI-powered discovery ยท Universal CLI Hub
A CLI tool that turns any website or Electron app into a command-line interface โ Bilibili, Zhihu, ๅฐ็บขไนฆ, Twitter/X, Reddit, YouTube, Antigravity, and many more โ powered by browser session reuse and AI-native discovery.
Built for AI Agents: Simply configure an instruction in your global AGENT.md or .cursorrules guiding the AI to execute opencli list via Bash to discover available tools. Register your favorite local CLIs (opencli register mycli), and the AI will automatically learn how to invoke all your tools perfectly!
CLI All Electron Apps! The Most Powerful Update Has Arrived! Turn ANY Electron application into a CLI tool! Recombine, script, and extend applications like Antigravity Ultra seamlessly. Now AI can control itself natively. Unlimited possibilities await!
- Highlights
- Prerequisites
- Quick Start
- Built-in Commands
- Download Support
- Output Formats
- For AI Agents (Developer Guide)
- Remote Chrome (Server/Headless)
- Testing
- Troubleshooting
- Releasing New Versions
- License
- CLI All Electron โ CLI-ify apps like Antigravity Ultra! Now AI can control itself natively using cc/openclaw!
- Account-safe โ Reuses Chrome's logged-in state; your credentials never leave the browser.
- AI Agent ready โ
explorediscovers APIs,synthesizegenerates adapters,cascadefinds auth strategies. - External CLI Hub โ Discover, auto-install, and passthrough commands to any external CLI (gh, obsidian, docker, kubectl, etc). Zero setup.
- Self-healing setup โ
opencli setupverifies Browser Bridge connectivity;opencli doctordiagnoses daemon, extension, and live browser connectivity. - Dynamic Loader โ Simply drop
.tsor.yamladapters into theclis/folder for auto-registration. - Dual-Engine Architecture โ Supports both YAML declarative data pipelines and robust browser runtime TypeScript injections.
- Node.js: >= 20.0.0
- Chrome running and logged into the target site (e.g. bilibili.com, zhihu.com, xiaohongshu.com).
โ ๏ธ Important: Browser commands reuse your Chrome login session. You must be logged into the target website in Chrome before running commands. If you get empty data or errors, check your login status first.
OpenCLI connects to your browser through a lightweight Browser Bridge Chrome Extension + micro-daemon (zero config, auto-start).
You can install the extension via either method:
Method 1: Download Pre-built Release (Recommended)
- Go to the GitHub Releases page and download the latest
opencli-extension.ziporopencli-extension.crx. - Open
chrome://extensionsand enable Developer mode (top-right toggle). - Drag and drop the
.crxfile or the unzipped folder into the extensions page.
Method 2: Load Unpacked Source (For Developers)
- Open
chrome://extensionsand enable Developer mode. - Click Load unpacked and select the
extension/directory from this repository.
That's it! The daemon auto-starts when you run any browser command. No tokens, no manual configuration.
Tip: Use
opencli doctorfor ongoing diagnosis:opencli doctor # Check extension + daemon connectivity opencli doctor --live # Also test live browser commands
npm install -g @jackwener/opencliThen use directly:
opencli list # See all commands
opencli list -f yaml # List commands as YAML
opencli hackernews top --limit 5 # Public API, no browser
opencli bilibili hot --limit 5 # Browser command
opencli zhihu hot -f json # JSON output
opencli zhihu hot -f yaml # YAML outputgit clone git@github.com:jackwener/opencli.git
cd opencli
npm install
npm run build
npm link # Link binary globally
opencli list # Now you can use it anywhere!npm install -g @jackwener/opencli@latestRun opencli list for the live registry.
| Site | Commands | Mode |
|---|---|---|
trending bookmarks profile search timeline thread following followers notifications post reply delete like article follow unfollow bookmark unbookmark download accept reply-dm |
Browser | |
hot frontpage popular search subreddit read user user-posts user-comments upvote save comment subscribe saved upvoted |
Browser | |
| cursor | status send read new dump composer model extract-code ask screenshot history export |
Desktop |
| bilibili | hot search me favorite history feed subtitle dynamic ranking following user-videos download |
Browser |
| codex | status send read new dump extract-diff model ask screenshot history export |
Desktop |
| chatwise | status new send read ask model history export screenshot |
Desktop |
| notion | status search read new write sidebar favorites export |
Desktop |
| discord-app | status send read channels servers search members |
Desktop |
| v2ex | hot latest topic daily me notifications |
Public / Browser |
| xueqiu | feed hot-stock hot search stock watchlist |
Browser |
| antigravity | status send read new dump extract-code model watch |
Desktop |
| chatgpt | status new send read ask |
Desktop |
| xiaohongshu | search notifications feed user download creator-notes creator-note-detail creator-notes-summary creator-profile creator-stats |
Browser |
| apple-podcasts | search episodes top |
Public |
| xiaoyuzhou | podcast podcast-episodes episode |
Public |
| zhihu | hot search question download |
Browser |
| youtube | search video transcript |
Browser |
| boss | search detail recommend joblist greet batchgreet send chatlist chatmsg invite mark exchange resume stats |
Browser |
| coupang | search add-to-cart |
Browser |
| bbc | news |
Public |
| bloomberg | main markets economics industries tech politics businessweek opinions feeds news |
Public / Browser |
| ctrip | search |
Browser |
| github | search |
Public |
| arxiv | search paper |
Public |
| wikipedia | search summary |
Public |
| hackernews | top |
Public |
search |
Browser | |
| reuters | search |
Browser |
| smzdm | search |
Browser |
hot |
Browser | |
| yahoo-finance | quote |
Browser |
| sinafinance | news |
๐ Public |
| barchart | quote options greeks flow |
Browser |
| chaoxing | assignments exams |
Browser |
| grok | ask |
Desktop |
| hf | top |
Public |
| jike | feed search create like comment repost notifications post topic user |
Browser |
| jimeng | generate history |
Browser |
| linux-do | hot latest search categories category topic |
Public |
| stackoverflow | hot search bounties unanswered |
Public |
| weread | shelf search book highlights notes notebooks ranking |
Browser |
Bloomberg note: The RSS-backed Bloomberg listing commands (
main, section feeds,feeds) work without a browser.bloomberg newsis for standard Bloomberg story/article pages that your current Chrome session can already access. Audio and some other non-standard pages may fail, and OpenCLI does not bypass Bloomberg paywall or entitlement checks.
OpenCLI acts as a universal hub for your existing command-line tools. It provides unified discovery, automatic installation, and pure passthrough execution.
| External CLI | Description | Commands Example |
|---|---|---|
| gh | GitHub CLI | opencli gh pr list --limit 5 |
| obsidian | Obsidian vault management | opencli obsidian search query="AI" |
| docker | Docker command-line interface | opencli docker ps |
| kubectl | Kubernetes command-line tool | opencli kubectl get pods |
| readwise | Readwise & Reader CLI | opencli readwise login |
Zero Configuration: OpenCLI purely passes your inputs to the underlying binary via standard I/O streams. The external CLI works exactly as it naturally would, maintaining its standard output formats.
Auto-Installation: If you run opencli gh ... and gh is not installed on your system, OpenCLI will automatically try to install it using your system's package manager (e.g., brew install gh) before seamlessly re-running the command.
Register Your Own:
Add any local CLI to your OpenCLI registry so AI agents can automatically discover it via the opencli list command.
opencli register mycliEach desktop adapter has its own detailed documentation with commands reference, setup guide, and examples:
| 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 | 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 |
| Feishu | ้ฃไนฆ/Lark Desktop via AppleScript | Doc |
| ๅพฎไฟก Desktop via AppleScript + Accessibility | Doc | |
| NeteaseMusic | ็ฝๆไบ้ณไน Desktop via CEF/CDP | Doc |
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 | Downloads from user media tab or single tweet | |
| zhihu | Articles (Markdown) | Exports articles with optional image download |
For video downloads from streaming platforms, you need to install yt-dlp:
# Install yt-dlp
pip install yt-dlp
# or
brew install yt-dlp# Download images/videos from Xiaohongshu note
opencli xiaohongshu download --note-id abc123 --output ./xhs
# Download Bilibili video (requires yt-dlp)
opencli bilibili download --bvid BV1xxx --output ./bilibili
opencli bilibili download --bvid BV1xxx --quality 1080p # Specify quality
# Download Twitter media from user
opencli twitter download elonmusk --limit 20 --output ./twitter
# Download single tweet media
opencli twitter download --tweet-url "https://x.com/user/status/123" --output ./twitter
# Export Zhihu article to Markdown
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu
# Export with local images
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --download-imagesThe download step can be used in YAML pipelines:
pipeline:
- fetch: https://api.example.com/media
- download:
url: ${{ item.imageUrl }}
dir: ./downloads
filename: ${{ item.title | sanitize }}.jpg
concurrency: 5
skip_existing: trueAll built-in commands support --format / -f with table, json, yaml, md, and csv.
The list command supports the same format options, and keeps --json for backward compatibility.
opencli list -f yaml # Command registry as YAML
opencli bilibili hot -f table # Default: rich terminal table
opencli bilibili hot -f json # JSON (pipe to jq or LLMs)
opencli bilibili hot -f yaml # YAML (human-readable structured output)
opencli bilibili hot -f md # Markdown
opencli bilibili hot -f csv # CSV
opencli bilibili hot -v # Verbose: show pipeline debug stepsIf you are an AI assistant tasked with creating a new command adapter for opencli, please follow the AI Agent workflow below:
Quick mode: To generate a single command for a specific page URL, see CLI-ONESHOT.md โ just a URL + one-line goal, 4 steps done.
Full mode: Before writing any adapter code, read CLI-EXPLORER.md. It contains the complete browser exploration workflow, the 5-tier authentication strategy decision tree, and debugging guide.
# 1. Deep Explore โ discover APIs, infer capabilities, detect framework
opencli explore https://example.com --site mysite
# 2. Synthesize โ generate YAML adapters from explore artifacts
opencli synthesize mysite
# 3. Generate โ one-shot: explore โ synthesize โ register
opencli generate https://example.com --goal "hot"
# 4. Strategy Cascade โ auto-probe: PUBLIC โ COOKIE โ HEADER
opencli cascade https://api.example.com/dataExplore outputs to .opencli/explore/<site>/ (manifest.json, endpoints.json, capabilities.json, auth.json).
See TESTING.md for the full testing guide, including:
- Current test coverage (unit + E2E tests across browser and desktop adapters)
- How to run tests locally
- How to add tests when creating new adapters
- CI/CD pipeline with sharding
- Headless browser mode (
OPENCLI_HEADLESS=1)
# Quick start
npm run build
npx vitest run # All tests
npx vitest run src/ # Unit tests only
npx vitest run tests/e2e/ # E2E tests- "Extension not connected"
- Ensure the opencli Browser Bridge extension is installed and enabled in
chrome://extensions.
- Ensure the opencli Browser Bridge extension is installed and enabled in
- Empty data returns or 'Unauthorized' error
- Your login session in Chrome might have expired. Open a normal Chrome tab, navigate to the target site, and log in or refresh the page.
- Node API errors
- Make sure you are using Node.js >= 20. Some dependencies require modern Node APIs.
- Daemon issues
- Check daemon status:
curl localhost:19825/status - View extension logs:
curl localhost:19825/logs
- Check daemon status:
npm version patch # 0.1.0 โ 0.1.1
npm version minor # 0.1.0 โ 0.2.0
git push --follow-tagsThe CI will automatically build, create a GitHub release, and publish to npm.