/ docs / comparison.md
comparison.md
  1  # Comparison Guide
  2  
  3  OpenCLI occupies a specific niche in the browser automation ecosystem. This guide honestly evaluates where opencli excels, where it's a viable option, and where other tools are a better fit.
  4  
  5  ## At a Glance
  6  
  7  | Tool | Approach | Best for |
  8  |------|----------|----------|
  9  | **opencli** | Pre-built TypeScript adapters | Deterministic site commands, broad platform coverage, desktop apps |
 10  | **Browser-Use** | LLM-driven browser control | General-purpose AI browser automation |
 11  | **Crawl4AI** | Async web crawler | Large-scale data crawling |
 12  | **Firecrawl** | Scraping API / self-hosted | Clean markdown extraction, managed or self-hosted infrastructure |
 13  | **agent-browser** | Browser primitive CLI | Token-efficient AI agent browsing |
 14  | **Stagehand** | AI browser framework | Developer-friendly browser automation |
 15  | **Skyvern** | Visual AI automation | Cross-site generalized workflows |
 16  
 17  ## Scenario Comparison
 18  
 19  ### 1. Scheduled Batch Data Extraction
 20  
 21  > "I want to pull trending posts from Bilibili/Reddit/HackerNews every hour into my pipeline."
 22  
 23  | Tool | Fit | Notes |
 24  |------|-----|-------|
 25  | **opencli** | Best | One command, structured JSON output, zero runtime cost. Runs in cron/CI without tokens or API keys. |
 26  | Crawl4AI | Good | Strong for large-scale crawling, but requires writing extraction logic per site. |
 27  | Firecrawl | Viable | Managed service with clean output, but costs scale with volume. |
 28  | Browser-Use / Stagehand | Poor | LLM inference on every run is slow, expensive, and non-deterministic for repeated tasks. |
 29  
 30  **Why opencli wins here:** A command like `opencli bilibili hot -f json` returns the same structured schema every time, costs nothing to run, and finishes in seconds. For recurring data extraction from known sites, pre-built adapters beat LLM-driven approaches on cost, speed, and reliability.
 31  
 32  ### 2. AI Agent Site Operations
 33  
 34  > "My AI agent needs to search Twitter, read Reddit threads, or post to Xiaohongshu."
 35  
 36  | Tool | Fit | Notes |
 37  |------|-----|-------|
 38  | **opencli** | Best | Structured JSON output, fast deterministic execution, hundreds of commands ready to use. |
 39  | agent-browser | Good | Token-efficient browser primitives, but requires LLM reasoning for every step. |
 40  | Browser-Use | Viable | General-purpose, but each operation costs tokens and takes 10-60s. |
 41  | Stagehand | Viable | Good DX, but same LLM-per-action cost model. |
 42  
 43  **Why opencli wins here:** When your agent needs `twitter search "AI news" -f json`, a deterministic command that returns in seconds is strictly better than an LLM clicking through a webpage. The agent saves tokens for reasoning, not navigation.
 44  
 45  ### 3. Authenticated Operations (Login-Required Sites)
 46  
 47  > "I need to access my bookmarks, post content, or interact with sites that require login."
 48  
 49  | Tool | Fit | Notes |
 50  |------|-----|-------|
 51  | **opencli** | Best | Reuses your Chrome login session via Browser Bridge. No credentials stored or transmitted. |
 52  | Browser-Use | Viable | Can use browser profiles, but credential management is manual. |
 53  | Firecrawl | Poor | Cloud service cannot access your authenticated sessions. |
 54  | Crawl4AI | Poor | Requires manual cookie/session injection. |
 55  
 56  **Why opencli wins here:** The Browser Bridge extension reuses your existing Chrome login state in real-time. You log in once in Chrome, and opencli commands work immediately. No OAuth setup, no API keys, no credential files.
 57  
 58  ### 4. General Web Browsing & Exploration
 59  
 60  > "I need to explore an unknown website, fill forms, or navigate complex multi-step flows."
 61  
 62  | Tool | Fit | Notes |
 63  |------|-----|-------|
 64  | Browser-Use | Best | LLM-driven, handles arbitrary websites and flows. |
 65  | Stagehand | Best | Clean API for `act()`, `extract()`, `observe()` on any page. |
 66  | agent-browser | Good | Token-efficient primitives for AI agents. |
 67  | Skyvern | Good | Visual AI that generalizes across sites. |
 68  | **opencli** | Poor | Only works with sites that have pre-built adapters. Cannot handle arbitrary websites. |
 69  
 70  **opencli is not the right tool here.** If you need to explore unknown websites or handle one-off tasks on sites without adapters, use an LLM-driven browser tool. opencli trades generality for determinism and cost.
 71  
 72  ### 5. Desktop App Control
 73  
 74  > "I want to script Cursor, ChatGPT, Notion, or other Electron apps from the terminal."
 75  
 76  | Tool | Fit | Notes |
 77  |------|-----|-------|
 78  | **opencli** | Best | 8 desktop adapters via CDP + AppleScript. The only CLI tool with this capability. |
 79  | All others | N/A | Browser automation tools cannot control desktop applications. |
 80  
 81  **This is unique to opencli.** No other tool in this comparison can send a prompt to ChatGPT desktop, extract code from Cursor, or write to Notion pages via CLI.
 82  
 83  ## Key Trade-offs
 84  
 85  ### opencli's Strengths
 86  
 87  - **Zero LLM cost** — No tokens consumed at runtime. Run 10,000 times for free.
 88  - **Deterministic output** — Same command always returns the same schema. Pipeable, scriptable, CI-friendly.
 89  - **Speed** — Adapter commands return in seconds, not minutes.
 90  - **Broad platform coverage** — 87+ sites spanning global platforms (Reddit, HackerNews, Twitter, YouTube) and Chinese platforms (Bilibili, Zhihu, Xiaohongshu, Douban, Weibo) with adapters that understand local anti-bot patterns.
 91  - **Desktop app control** — CDP adapters for Cursor, Codex, Notion, ChatGPT, Discord, and more.
 92  - **Easy to extend** — Drop a `.js` adapter into the `clis/` folder for auto-registration. Contributing a new site adapter is straightforward.
 93  
 94  ### opencli's Limitations
 95  
 96  - **Coverage requires adapters** — opencli only works with sites that have pre-built adapters. Adding a new site means writing a TypeScript adapter.
 97  - **Adapter maintenance** — When a website updates its DOM or API, the corresponding adapter may need updating. The community maintains these, but breakage is possible.
 98  - **Not general-purpose** — Cannot handle arbitrary websites. For unknown sites, pair opencli with a general browser tool as a fallback.
 99  
100  ## Complementary Usage
101  
102  opencli works best alongside general-purpose browser tools, not as a replacement:
103  
104  ```
105  Has adapter?  ──yes──▶  opencli (fast, free, deterministic)
106107       no
108109110  One-off task?  ──yes──▶  Browser-Use / Stagehand (LLM-driven)
111112       no
113114115  Recurring?    ──yes──▶  Write an opencli adapter, then use opencli
116  ```
117  
118  ## Further Reading
119  
120  - [Architecture Overview](./developer/architecture.md)
121  - [Writing a TypeScript Adapter](./developer/ts-adapter.md)
122  - [Testing Guide](./developer/testing.md)
123  - [AI Workflow](./developer/ai-workflow.md)
124  - [Contributing Guide](./developer/contributing.md)