back to home

jackwener / opencli

Make any website your CLI. A powerful, AI-native runtime for seamless browser automation and dynamic web data extraction.

848 stars
76 forks
9 issues
TypeScriptJavaScript

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing jackwener/opencli in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/jackwener/opencli)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

OpenCLI > **Make any website your CLI.** > Zero risk · Reuse Chrome login · AI-powered discovery 中文文档 A CLI tool that turns **any website** into a command-line interface — bilibili, zhihu, xiaohongshu, twitter, reddit, and many more — powered by browser session reuse and AI-native discovery. --- Table of Contents • Highlights • Prerequisites • Quick Start • Built-in Commands • Output Formats • For AI Agents (Developer Guide) • Testing • Troubleshooting • Releasing New Versions • License --- Highlights • **Account-safe** — Reuses Chrome's logged-in state; your credentials never leave the browser. • **AI Agent ready** — discovers APIs, generates adapters, finds auth strategies. • **Dynamic Loader** — Simply drop or adapters into the folder for auto-registration. • **Dual-Engine Architecture** — Supports both YAML declarative data pipelines and robust browser runtime typescript injections. Prerequisites • **Node.js**: >= 18.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 the Playwright MCP Bridge extension. Playwright MCP Bridge Extension Setup • Install **Playwright MCP Bridge** extension in Chrome. • Run — it auto-discovers your token and lets you choose which tools to configure: The interactive TUI will: • 🔍 Auto-discover from Chrome (no manual copy needed) • ☑️ Show all detected tools (Codex, Cursor, Claude Code, Gemini CLI, etc.) • ✏️ Update only the files you select (Space to toggle, Enter to confirm) Manual setup (alternative) Add token to your MCP client config (e.g. Claude/Cursor): Export in shell (e.g. ): Verify with — shows colored status for all config locations: Quick Start Install via npm (recommended) Then use directly: Install from source (for developers) Update Built-in Commands | Site | Commands | Mode | |------|----------|------| | **bilibili** | | 🔐 Browser | | **zhihu** | | 🔐 Browser | | **xiaohongshu** | | 🔐 Browser | | **xueqiu** | | 🔐 Browser | | **twitter** | | 🔐 Browser | | **reddit** | | 🔐 Browser | | **weibo** | | 🔐 Browser | | **boss** | | 🔐 Browser | | **coupang** | | 🔐 Browser | | **youtube** | | 🔐 Browser | | **yahoo-finance** | | 🔐 Browser | | **reuters** | | 🔐 Browser | | **smzdm** | | 🔐 Browser | | **ctrip** | | 🔐 Browser | | **github** | | 🌐 Public | | **v2ex** | | 🌐 Public / 🔐 Browser | | **hackernews** | | 🌐 Public | | **bbc** | | 🌐 Public | Output Formats All built-in commands support / with , , , , and . The command supports the same format options, and keeps for backward compatibility. For AI Agents (Developer Guide) If you are an AI assistant tasked with creating a new command adapter for , 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. Explore outputs to (manifest.json, endpoints.json, capabilities.json, auth.json). Testing See **TESTING.md** for the full testing guide, including: • Current test coverage (unit + ~52 E2E tests across all 18 sites) • How to run tests locally • How to add tests when creating new adapters • CI/CD pipeline with sharding • Headless browser mode ( ) Troubleshooting • **"Failed to connect to Playwright MCP Bridge"** • Ensure the Playwright MCP extension is installed and **enabled** in your running Chrome. • Restart the Chrome browser if you just installed the extension. • **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 to prove you are human. • **Node API errors** • Make sure you are using Node.js >= 18. Some dependencies require modern Node APIs. • **Token issues** • Run to diagnose token configuration across all tools. Releasing New Versions The CI will automatically build, create a GitHub release, and publish to npm. License BSD-3-Clause