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, Electron app, or local CLI tool into a command-line interface â Bilibili, Zhihu, å°įēĸäšĻ, Twitter/X, Reddit, YouTube, Antigravity, gh, docker, 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
- 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 â
explore discovers APIs, synthesize generates adapters, cascade finds auth strategies.
- External CLI Hub â Discover, auto-install, and passthrough commands to any external CLI (gh, obsidian, docker, etc). Zero setup.
- Self-healing setup â
opencli doctor diagnoses and auto-starts the daemon, extension, and live browser connectivity.
- Dynamic Loader â Simply drop
.ts or .yaml adapters into the clis/ folder for auto-registration.
- Dual-Engine Architecture â Supports both YAML declarative data pipelines and robust browser runtime TypeScript injections.
Why opencli?
There are many great browser automation tools. Here's when opencli is the right choice:
| Your need | Best tool | Why |
|---|
| Scheduled data extraction from specific sites | opencli | Pre-built adapters, deterministic JSON, zero LLM cost |
| AI agent needs reliable site operations | opencli | Hundreds of commands, structured output, fast deterministic response |
| Explore an unknown website ad-hoc | Browser-Use, Stagehand | LLM-driven general browsing for one-off tasks |
| Large-scale web crawling | Crawl4AI, Scrapy | Purpose-built for throughput and scale |
| Control desktop Electron apps from terminal | opencli | CDP + AppleScript â the only CLI tool that does this |
What makes opencli different:
- Zero LLM cost â No tokens consumed at runtime. Run 10,000 times and pay nothing.
- Deterministic â Same command, same output schema, every time. Pipeable, scriptable, CI-friendly.
- Broad coverage â 50+ sites across global and Chinese platforms (Bilibili, Zhihu, Xiaohongshu, Reddit, HackerNews, and more), plus desktop Electron apps via CDP.
For a detailed comparison with Browser-Use, Crawl4AI, Firecrawl, and others, see the Comparison Guide.
Prerequisites
- 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).
Browser Bridge Extension Setup
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.zip.
- Unzip the file and open
chrome://extensions, enable Developer mode (top-right toggle).
- Click Load unpacked and select the unzipped folder.
Method 2: Load Source (For Developers)
- Open
chrome://extensions and 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 doctor for ongoing diagnosis:
opencli doctor # Check extension + daemon connectivity
Quick Start
Install via npm (recommended)
npm install -g @jackwener/opencli
Then 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 output
Install from source (for developers)
git 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!
Update
npm install -g @jackwener/opencli@latest
Built-in Commands
Run opencli list for the live registry.
| Site | Commands | Mode |
|---|
| twitter | trending bookmarks profile search timeline thread following followers notifications post reply delete like article follow unfollow bookmark unbookmark download accept reply-dm block unblock hide-reply | Browser |
| reddit | hot |
External CLI Hub
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 |
| readwise | Readwise & Reader CLI | opencli readwise login |
| gws | Google Workspace CLI â Docs, Sheets, Drive, Gmail, Calendar | opencli gws docs list |
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 mycli
Desktop App Adapters
Each 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 |
| Doubao | Control Doubao AI desktop app via CDP | Doc |
Download Support
OpenCLI supports downloading images, videos, and articles from supported platforms.
Supported Platforms
| Platform | Content Types | Notes |
|---|
| xiaohongshu | Images, Videos | Downloads all media from a note |
| bilibili | Videos | Requires yt-dlp installed |
| twitter | Images, Videos | Downloads from user media tab or single tweet |
| zhihu | Articles (Markdown) | Exports articles with optional image download |
| weixin | Articles (Markdown) | Exports WeChat Official Account articles |
Prerequisites
For video downloads from streaming platforms, you need to install yt-dlp:
# Install yt-dlp
pip install yt-dlp
# or
brew install yt-dlp
Usage Examples
# Download images/videos from Xiaohongshu note
opencli xiaohongshu download abc123 --output ./xhs
# Download Bilibili video (requires yt-dlp)
opencli bilibili download BV1xxx --output ./bilibili
opencli bilibili download 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-images
# Export WeChat article to Markdown
opencli weixin download --url "https://mp.weixin.qq.com/s/xxx" --output ./weixin
Output Formats
All 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 steps
Plugins
Extend OpenCLI with community-contributed adapters. Plugins use the same YAML/TS format as built-in commands and are automatically discovered at startup.
opencli plugin install github:user/opencli-plugin-my-tool # Install
opencli plugin list # List installed
opencli plugin update my-tool # Update to latest
opencli plugin update --all # Update all installed plugins
opencli plugin uninstall my-tool # Remove
opencli plugin list also shows the tracked short commit hash when a plugin version is recorded in ~/.opencli/plugins.lock.json.
See Plugins Guide for creating your own plugin.
For AI Agents (Developer Guide)
If 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/data
Explore outputs to .opencli/explore/<site>/ (manifest.json, endpoints.json, capabilities.json, auth.json).
Testing
See TESTING.md for how to run and write tests.
Troubleshooting
- "Extension not connected"
- Ensure the opencli Browser Bridge extension is installed and enabled in
chrome://extensions.
- "attach failed: Cannot access a chrome-extension:// URL"
- Another Chrome extension (e.g. youmind, New Tab Override, or AI assistant extensions) may be interfering. Try disabling other extensions temporarily, then retry.
- 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
Star History

License
Apache-2.0