[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-3222":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},3222,"OpenCLI","jackwener\u002FOpenCLI","jackwener","Make Any Website into CLI & Use your logged-in browser by AI agent. ","https:\u002F\u002Fopencli.info\u002F",null,"JavaScript",24075,2403,52,63,0,90,568,3951,424,45,"Apache License 2.0",false,"main",true,[27,28,29,30],"ai-agent","ai-agents","ai-tools","cli","2026-06-12 02:00:47","# OpenCLI\n\n> **Turn websites, browser sessions, Electron apps, and local tools into deterministic interfaces for humans and AI agents.**\n> Reuse your logged-in browser, automate live workflows, and crystallize repeated actions into reusable CLI commands.\n\n[![中文文档](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocs-%E4%B8%AD%E6%96%87-0F766E?style=flat-square)](.\u002FREADME.zh-CN.md)\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002F@jackwener\u002Fopencli?style=flat-square)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@jackwener\u002Fopencli)\n[![Node.js Version](https:\u002F\u002Fimg.shields.io\u002Fnode\u002Fv\u002F@jackwener\u002Fopencli?style=flat-square)](https:\u002F\u002Fnodejs.org)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fl\u002F@jackwener\u002Fopencli?style=flat-square)](.\u002FLICENSE)\n\nOpenCLI gives you one surface for three different kinds of automation:\n\n- **Use built-in adapters** for sites like Bilibili, Zhihu, Xiaohongshu, Reddit, HackerNews, Twitter\u002FX, and [many more](#built-in-commands).\n- **Let AI Agents operate any website** — install the `opencli-adapter-author` skill in your AI agent (Claude Code, Cursor, etc.), and it can navigate, click, type\u002Ffill, extract, and inspect any page through your logged-in browser via `opencli browser` primitives.\n- **Write new adapters** end-to-end with `opencli browser` + the `opencli-adapter-author` skill, which guides from first recon through field decoding, code, and `opencli browser verify`.\n\nIt also works as a **CLI hub** for local tools such as `gh`, `docker`, and other binaries you register yourself, plus **desktop app adapters** for Electron apps like Cursor, Codex, Antigravity, ChatGPT, and Notion.\n\n## Highlights\n\n- **Desktop App Control** — Drive Electron apps (Cursor, Codex, ChatGPT, Notion, etc.) directly from the terminal via CDP.\n- **Browser Automation for AI Agents** — Install the `opencli-adapter-author` skill, and your AI agent can operate any website: navigate, click, type\u002Ffill, extract, screenshot — all through your logged-in Chrome session.\n- **Multi-profile Browser Bridge** — Install the extension in each Chrome profile you want to use, then route commands with `--profile`, `OPENCLI_PROFILE`, or `opencli profile use`.\n- **Website → CLI** — Turn any website into a deterministic CLI: 100+ site surfaces are already registered, or write your own with the `opencli-adapter-author` skill + `opencli browser verify`.\n- **Account-safe** — Reuses Chrome\u002FChromium logged-in state; your credentials never leave the browser.\n- **AI Agent ready** — One skill takes you from site recon through API discovery, field decoding, adapter writing, and verification.\n- **CLI Hub** — Discover, auto-install, and passthrough commands to any external CLI (gh, docker, obsidian, etc).\n- **Zero LLM cost** — No tokens consumed at runtime. Run 10,000 times and pay nothing.\n- **Deterministic** — Same command, same output schema, every time. Pipeable, scriptable, CI-friendly.\n\n---\n\n## Quick Start\n\n### 1. Install OpenCLI\n\nOpenCLI requires **Node.js >= 21**.\n\n```bash\nnode --version\nnpm install -g @jackwener\u002Fopencli\n```\n\n### 2. Install the Browser Bridge Extension\n\nOpenCLI connects to Chrome\u002FChromium through a lightweight Browser Bridge extension plus a small local daemon. The daemon auto-starts when needed.\n\n**Option A — Chrome Web Store (recommended):**\nInstall **OpenCLI** from the [Chrome Web Store](https:\u002F\u002Fchromewebstore.google.com\u002Fdetail\u002Fopencli\u002Fildkmabpimmkaediidaifkhjpohdnifk).\n\n**Option B — Manual install:**\n1. Download the latest `opencli-extension-v{version}.zip` from the GitHub [Releases page](https:\u002F\u002Fgithub.com\u002Fjackwener\u002Fopencli\u002Freleases).\n2. Unzip it, open `chrome:\u002F\u002Fextensions`, and enable **Developer mode**.\n3. Click **Load unpacked** and select the unzipped folder.\n\n### 3. Verify the setup\n\n```bash\nopencli doctor\n```\n\n### 4. Optional: name your Chrome profile\n\nEach Chrome profile runs its own OpenCLI extension instance. If you use multiple Chrome profiles, list the connected profiles and assign local aliases:\n\n```bash\nopencli profile list\nopencli profile rename \u003CcontextId> work\nopencli profile use work\nopencli --profile work browser state\n```\n\nWith only one connected profile, OpenCLI uses it automatically. With multiple connected profiles and no default, OpenCLI asks you to choose instead of guessing.\n\n### 5. Run your first commands\n\n```bash\nopencli list\nopencli hackernews top --limit 5\nopencli bilibili hot --limit 5\n```\n\n## For Humans\n\nUse OpenCLI directly when you want a reliable command instead of a live browser session:\n\n- `opencli list` shows every registered command.\n- `opencli \u003Csite> \u003Ccommand>` runs a built-in or generated adapter.\n- `opencli external register mycli` exposes a local CLI through the same discovery surface.\n- `opencli doctor` helps diagnose browser connectivity.\n\n## Extending OpenCLI\n\nIf you want to add your own commands, start with the [Extending OpenCLI guide](.\u002Fdocs\u002Fguide\u002Fextending-opencli.md). README keeps this short; the guide covers the directory layout, source-control model, and install commands.\n\n| Need | Recommended path |\n|------|------------------|\n| Keep personal website commands in your own Git repo | `opencli plugin create` + `opencli plugin install file:\u002F\u002F...` |\n| Quickly draft a private local adapter | `opencli browser init \u003Csite>\u002F\u003Ccommand>` in `~\u002F.opencli\u002Fclis\u002F` |\n| Modify an official adapter locally | `opencli adapter eject \u003Csite>` + `opencli adapter reset \u003Csite>` |\n| Publish or install third-party commands | `opencli plugin install github:user\u002Frepo` |\n| Wrap an existing local binary | `opencli external register \u003Cname>` |\n\n## For AI Agents\n\nOpenCLI's browser commands are designed to be used by AI Agents — not run manually. Install skills into your AI agent (Claude Code, Cursor, etc.), and the agent operates websites on your behalf using your logged-in Chrome session.\n\n### Install skills\n\n```bash\nnpx skills add jackwener\u002Fopencli\n```\n\nOr install only what you need:\n\n```bash\nnpx skills add jackwener\u002Fopencli --skill opencli-adapter-author\nnpx skills add jackwener\u002Fopencli --skill opencli-autofix\nnpx skills add jackwener\u002Fopencli --skill opencli-browser\nnpx skills add jackwener\u002Fopencli --skill opencli-usage\nnpx skills add jackwener\u002Fopencli --skill smart-search\n```\n\n### Which skill to use\n\n| Skill | When to use | Example prompt to your AI agent |\n|-------|------------|-------------------------------|\n| **opencli-adapter-author** | Operate a site in real time, or write a reusable adapter for a new site | \"Help me check my Xiaohongshu notifications\" \u002F \"Write an adapter for douyin trending\" \u002F \"Make a command that grabs the top posts from this page\" |\n| **opencli-autofix** | Repair a broken adapter when a built-in command fails | \"`opencli zhihu hot` is returning empty — fix it\" |\n| **opencli-browser** | Browser automation reference for AI agents | \"Use browser commands to scrape this page\" |\n| **opencli-usage** | Quick reference for all OpenCLI commands and sites | \"What commands does OpenCLI have for Twitter?\" |\n| **smart-search** | Search across existing OpenCLI capabilities | \"Find me a Bilibili trending adapter\" |\n\n### How it works\n\nOnce `opencli-adapter-author` is installed, your AI agent can:\n\n1. **Navigate** to any URL using your logged-in browser\n2. **Read** page content via structured DOM snapshots (not screenshots)\n3. **Interact** — click buttons, fill forms, select options, press keys\n4. **Extract** data from the page or intercept network API responses\n5. **Wait** for elements, text, or page transitions\n\nThe agent handles all the `opencli browser` commands internally — you just describe what you want done in natural language.\n\n**Skill references:**\n- [`skills\u002Fopencli-adapter-author\u002FSKILL.md`](.\u002Fskills\u002Fopencli-adapter-author\u002FSKILL.md) — browser operation + adapter authoring, end-to-end\n- [`skills\u002Fopencli-autofix\u002FSKILL.md`](.\u002Fskills\u002Fopencli-autofix\u002FSKILL.md) — repair broken adapters\n- [`skills\u002Fopencli-browser\u002FSKILL.md`](.\u002Fskills\u002Fopencli-browser\u002FSKILL.md) — browser automation reference\n- [`skills\u002Fopencli-usage\u002FSKILL.md`](.\u002Fskills\u002Fopencli-usage\u002FSKILL.md) — command and site reference\n- [`skills\u002Fsmart-search\u002FSKILL.md`](.\u002Fskills\u002Fsmart-search\u002FSKILL.md) — capability search\n\nAvailable browser commands include `open`, `state`, `click`, `type`, `fill`, `select`, `keys`, `wait`, `get`, `find`, `extract`, `frames`, `screenshot`, `scroll`, `back`, `eval`, `network`, `tab list`, `tab new`, `tab select`, `tab close`, `init`, `verify`, and `close`.\n\n`opencli browser open \u003Curl>` and `opencli browser tab new [url]` both return a target ID. Use `opencli browser tab list` to inspect the target IDs of tabs that already exist, then pass `--tab \u003CtargetId>` to route a command to a specific tab. `tab new` creates a new tab without changing the default browser target; only `tab select \u003CtargetId>` promotes that tab to the default target for later untargeted `opencli browser ...` commands.\n\n## Core Concepts\n\n### `browser`: AI Agent browser control\n\n`opencli browser` commands are the low-level primitives that AI Agents use to operate websites. You don't run these manually — instead, install the `opencli-adapter-author` skill into your AI agent, describe what you want in natural language, and the agent handles the browser operations.\n\nFor example, tell your agent: *\"Help me check my Xiaohongshu notifications\"* — the agent will use `opencli browser open`, `state`, `click`, etc. under the hood.\n\n### Built-in adapters: stable commands\n\nUse site-specific commands such as `opencli hackernews top` or `opencli reddit hot` when the capability already exists. These are deterministic and work without browser — ideal for both humans and AI agents.\n\n### Writing a new adapter\n\nWhen the site you need is not yet covered, use the `opencli-adapter-author` skill. It takes the agent end-to-end:\n\n1. Recon the site and classify its pattern (SPA \u002F SSR \u002F JSONP \u002F Token \u002F Streaming).\n2. Discover the right endpoint — network inspection, initial state, bundle search, token trace, or interceptor fallback.\n3. Decide the auth strategy — `PUBLIC` \u002F `COOKIE` \u002F `HEADER` \u002F `INTERCEPT`.\n4. Decode response fields and design output columns.\n5. `opencli browser analyze \u003Curl>` for one-shot recon, then `opencli browser init \u003Csite>\u002F\u003Cname>` → write adapter → `opencli browser verify \u003Csite>\u002F\u003Cname>`.\n6. Persist site knowledge to `~\u002F.opencli\u002Fsites\u002F\u003Csite>\u002F` so the next adapter for the same site is faster.\n\n### CLI Hub and desktop adapters\n\nOpenCLI is not only for websites. It can also:\n\n- expose local binaries like `gh`, `docker`, `obsidian`, or custom tools through `opencli \u003Ctool> ...`\n- control Electron desktop apps through dedicated adapters and CDP-backed integrations\n\n## Prerequisites\n\n- **Node.js**: >= 21.0.0 (required for the standard npm install path)\n- **Bun**: >= 1.0 (optional alternative runtime)\n- **Chrome or Chromium** running and logged into the target site for browser-backed commands\n\n> **Important**: Browser-backed commands reuse your Chrome\u002FChromium login session. If you get empty data or permission-like failures, first confirm the site is already open and authenticated in Chrome\u002FChromium.\n\n## Configuration\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `OPENCLI_DAEMON_PORT` | `19825` | HTTP port for the daemon-extension bridge |\n| `OPENCLI_PROFILE` | — | Browser Bridge profile alias\u002FcontextId to use when multiple Chrome profiles are connected |\n| `OPENCLI_WINDOW_FOCUSED` | `false` | Set to `1` to open the automation container in the foreground (useful for debugging). The `--focus` flag sets this. |\n| `OPENCLI_LIVE` | `false` | Set to `1` to keep the automation lease open after an adapter command finishes (useful for inspection). The `--live` flag sets this. |\n| `OPENCLI_BROWSER_CONNECT_TIMEOUT` | `30` | Seconds to wait for browser connection |\n| `OPENCLI_BROWSER_COMMAND_TIMEOUT` | `60` | Seconds to wait for a single browser command |\n| `OPENCLI_CDP_ENDPOINT` | — | Chrome DevTools Protocol endpoint for remote browser or Electron apps |\n| `OPENCLI_CDP_TARGET` | — | Filter CDP targets by URL substring (e.g. `detail.1688.com`) |\n| `OPENCLI_VERBOSE` | `false` | Enable verbose logging (`-v` flag also works) |\n| `DEBUG_SNAPSHOT` | — | Set to `1` for DOM snapshot debug output |\n\n`--focus` works for both `opencli browser *` and browser-backed adapter commands. `--live` is mainly for adapter commands: browser subcommands already keep the automation lease open until you run `opencli browser close` or the idle timeout expires.\n\n## Update\n\n```bash\nnpm install -g @jackwener\u002Fopencli@latest\n\n# If you use the packaged OpenCLI skills, refresh them too\nnpx skills add jackwener\u002Fopencli\n```\n\nOr refresh only the skills you actually use:\n\n```bash\nnpx skills add jackwener\u002Fopencli --skill opencli-adapter-author\nnpx skills add jackwener\u002Fopencli --skill opencli-autofix\nnpx skills add jackwener\u002Fopencli --skill opencli-browser\nnpx skills add jackwener\u002Fopencli --skill opencli-usage\nnpx skills add jackwener\u002Fopencli --skill smart-search\n```\n\n## For Developers\n\nInstall from source:\n\n```bash\ngit clone git@github.com:jackwener\u002Fopencli.git\ncd opencli\nnpm install\nnpm run build\nnpm link\n```\n\nTo load the source Browser Bridge extension:\n\n1. Open `chrome:\u002F\u002Fextensions` and enable **Developer mode**.\n2. Click **Load unpacked** and select this repository's `extension\u002F` directory.\n\n## Built-in Commands\n\n| Site | Commands |\n|------|----------|\n| **xiaohongshu** | `search` `note` `comments` `feed` `user` `download` `publish` `notifications` `creator-notes` `creator-notes-summary` `creator-note-detail` `creator-profile` `creator-stats` |\n| **bilibili** | `hot` `search` `history` `feed` `ranking` `download` `comments` `dynamic` `favorite` `following` `me` `subtitle` `video` `user-videos` |\n| **tieba** | `hot` `posts` `search` `read` |\n| **hupu** | `hot` `search` `detail` `mentions` `reply` `like` `unlike` |\n| **twitter** | `trending` `search` `timeline` `tweets` `lists` `list-tweets` `list-add` `list-remove` `bookmarks` `post` `download` `profile` `article` `like` `likes` `notifications` `reply` `reply-dm` `thread` `follow` `unfollow` `followers` `following` `block` `unblock` `bookmark` `unbookmark` `delete` `hide-reply` `accept` |\n| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `upvoted` `save` `saved` `comment` `subscribe` |\n| **zhihu** | `hot` `search` `question` `download` `follow` `like` `favorite` `comment` `answer` |\n| **amazon** | `bestsellers` `search` `product` `offer` `discussion` `movers-shakers` `new-releases` `rankings` |\n| **1688** | `search` `item` `assets` `download` `store` |\n| **gitee** | `trending` `search` `user` |\n| **gemini** | `new` `ask` `image` `deep-research` `deep-research-result` |\n| **claude** | `ask` `send` `new` `status` `read` `history` `detail` |\n| **yuanbao** | `new` `ask` |\n| **notebooklm** | `status` `list` `open` `current` `get` `history` `summary` `note-list` `notes-get` `source-list` `source-get` `source-fulltext` `source-guide` |\n| **spotify** | `auth` `status` `play` `pause` `next` `prev` `volume` `search` `queue` `shuffle` `repeat` |\n| **xianyu** | `search` `item` `chat` `publish` |\n| **xiaoe** | `courses` `detail` `catalog` `play-url` `content` |\n| **quark** | `ls` `mkdir` `mv` `rename` `rm` `save` `share-tree` |\n| **uiverse** | `code` `preview` |\n| **baidu-scholar** | `search` |\n| **google-scholar** | `search` `cite` `profile` |\n| **gov-law** | `search` `recent` |\n| **gov-policy** | `search` `recent` |\n| **nowcoder** | `hot` `trending` `topics` `recommend` `creators` `companies` `jobs` `search` `suggest` `experience` `referral` `salary` `papers` `practice` `notifications` `detail` |\n| **wanfang** | `search` |\n| **hackernews** | `top` `new` `best` `ask` `show` `jobs` `search` `user` |\n| **xiaoyuzhou** | `auth*` `podcast*` `podcast-episodes*` `episode*` `download*` `transcript*` |\n\n100+ site surfaces in total — **[→ see all supported sites & commands](.\u002Fdocs\u002Fadapters\u002Findex.md)**\n\n`*` `opencli xiaoyuzhou podcast`, `podcast-episodes`, `episode`, `download`, and `transcript` require local Xiaoyuzhou credentials in `~\u002F.opencli\u002Fxiaoyuzhou.json`.\n\n## CLI Hub\n\nOpenCLI acts as a universal hub for your existing command-line tools — unified discovery, pure passthrough execution, and auto-install (if a tool isn't installed, OpenCLI runs `brew install \u003Ctool>` automatically before re-running the command).\n\n| External CLI | Description | Example |\n|--------------|-------------|---------|\n| **gh** | GitHub CLI | `opencli gh pr list --limit 5` |\n| **obsidian** | Obsidian vault management | `opencli obsidian search query=\"AI\"` |\n| **docker** | Docker | `opencli docker ps` |\n| **lark-cli** | Lark\u002FFeishu — messages, docs, calendar, tasks, 200+ commands | `opencli lark-cli calendar +agenda` |\n| **dws** | DingTalk — cross-platform CLI for DingTalk's full suite, designed for humans and AI agents | `opencli dws msg send --to user \"hello\"` |\n| **wecom-cli** | WeCom\u002F企业微信 — CLI for WeCom open platform, for humans and AI agents | `opencli wecom-cli msg send --to user \"hello\"` |\n| **vercel** | Vercel — deploy projects, manage domains, env vars, logs | `opencli vercel deploy --prod` |\n\n**Register your own** — add any local CLI so AI agents can discover it via `opencli list`:\n\n```bash\nopencli external register mycli\n```\n\n### Desktop App Adapters\n\nControl Electron desktop apps directly from the terminal. Each adapter has its own detailed documentation:\n\n| App | Description | Doc |\n|-----|-------------|-----|\n| **Cursor** | Control Cursor IDE — Composer, chat, code extraction | [Doc](.\u002Fdocs\u002Fadapters\u002Fdesktop\u002Fcursor.md) |\n| **Codex** | Drive OpenAI Codex CLI agent headlessly | [Doc](.\u002Fdocs\u002Fadapters\u002Fdesktop\u002Fcodex.md) |\n| **Antigravity** | Control Antigravity Ultra from terminal | [Doc](.\u002Fdocs\u002Fadapters\u002Fdesktop\u002Fantigravity.md) |\n| **ChatGPT App** | Automate ChatGPT macOS desktop app | [Doc](.\u002Fdocs\u002Fadapters\u002Fdesktop\u002Fchatgpt-app.md) |\n| **ChatWise** | Multi-LLM client (GPT-4, Claude, Gemini) | [Doc](.\u002Fdocs\u002Fadapters\u002Fdesktop\u002Fchatwise.md) |\n| **Notion** | Search, read, write Notion pages | [Doc](.\u002Fdocs\u002Fadapters\u002Fdesktop\u002Fnotion.md) |\n| **Discord** | Discord Desktop — messages, channels, servers | [Doc](.\u002Fdocs\u002Fadapters\u002Fdesktop\u002Fdiscord.md) |\n| **Doubao** | Control Doubao AI desktop app via CDP | [Doc](.\u002Fdocs\u002Fadapters\u002Fdesktop\u002Fdoubao-app.md) |\n\nTo add a new Electron app, start with [docs\u002Fguide\u002Felectron-app-cli.md](.\u002Fdocs\u002Fguide\u002Felectron-app-cli.md).\n\n## Download Support\n\nOpenCLI supports downloading images, videos, and articles from supported platforms.\n\n| Platform | Content Types | Notes |\n|----------|---------------|-------|\n| **xiaohongshu** | Images, Videos | Downloads all media from a note |\n| **bilibili** | Videos | Requires `yt-dlp` installed |\n| **twitter** | Images, Videos | From user media tab or single tweet |\n| **douban** | Images | Poster \u002F still image lists |\n| **pixiv** | Images | Original-quality illustrations, multi-page |\n| **1688** | Images, Videos | Downloads page-visible product media from item pages |\n| **xiaoyuzhou** | Audio, Transcript | Downloads episode audio and transcript JSON\u002Ftext with local credentials |\n| **zhihu** | Articles (Markdown) | Exports with optional image download |\n| **weixin** | Articles (Markdown) | WeChat Official Account articles |\n\nFor video downloads, install `yt-dlp` first: `brew install yt-dlp`\n\n```bash\nopencli xiaohongshu download \"https:\u002F\u002Fwww.xiaohongshu.com\u002Fsearch_result\u002F\u003Cid>?xsec_token=...\" --output .\u002Fxhs\nopencli xiaohongshu download \"https:\u002F\u002Fxhslink.com\u002F...\" --output .\u002Fxhs\nopencli bilibili download BV1xxx --output .\u002Fbilibili\nopencli twitter download elonmusk --limit 20 --output .\u002Ftwitter\nopencli 1688 download 841141931191 --output .\u002F1688-downloads\nopencli xiaoyuzhou download 69b3b675772ac2295bfc01d0 --output .\u002Fxiaoyuzhou\nopencli xiaoyuzhou transcript 69dd0c98e2c8be31551f6a33 --output .\u002Fxiaoyuzhou-transcripts\n```\n\n`opencli xiaoyuzhou download` and `transcript` require local Xiaoyuzhou credentials in `~\u002F.opencli\u002Fxiaoyuzhou.json`.\n\n## Output Formats\n\nAll built-in commands support `--format` \u002F `-f` with `table` (default), `json`, `yaml`, `md`, and `csv`.\n\n```bash\nopencli bilibili hot -f json    # Pipe to jq or LLMs\nopencli bilibili hot -f csv     # Spreadsheet-friendly\nopencli bilibili hot -v         # Verbose: show pipeline debug steps\n```\n\n## Exit Codes\n\nopencli follows Unix `sysexits.h` conventions so it integrates naturally with shell pipelines and CI scripts:\n\n| Code | Meaning | When |\n|------|---------|------|\n| `0` | Success | Command completed normally |\n| `1` | Generic error | Unexpected \u002F unclassified failure |\n| `2` | Usage error | Bad arguments or unknown command |\n| `66` | Empty result | No data returned (`EX_NOINPUT`) |\n| `69` | Service unavailable | Browser Bridge not connected (`EX_UNAVAILABLE`) |\n| `75` | Temporary failure | Command timed out — retry (`EX_TEMPFAIL`) |\n| `77` | Auth required | Not logged in to target site (`EX_NOPERM`) |\n| `78` | Config error | Missing credentials or bad config (`EX_CONFIG`) |\n| `130` | Interrupted | Ctrl-C \u002F SIGINT |\n\n```bash\nopencli spotify status || echo \"exit $?\"   # 69 if browser not running\nopencli gh issue list 2>\u002Fdev\u002Fnull\n[ $? -eq 77 ] && opencli gh auth login      # auto-auth if not logged in\n```\n\n## Plugins\n\nExtend OpenCLI with community-contributed adapters:\n\n```bash\nopencli plugin install github:user\u002Fopencli-plugin-my-tool\nopencli plugin list\nopencli plugin update --all\nopencli plugin uninstall my-tool\n```\n\n| Plugin | Type | Description |\n|--------|------|-------------|\n| [opencli-plugin-github-trending](https:\u002F\u002Fgithub.com\u002FByteYue\u002Fopencli-plugin-github-trending) | JS | GitHub Trending repositories |\n| [opencli-plugin-hot-digest](https:\u002F\u002Fgithub.com\u002FByteYue\u002Fopencli-plugin-hot-digest) | JS | Multi-platform trending aggregator |\n| [opencli-plugin-juejin](https:\u002F\u002Fgithub.com\u002FAstro-Han\u002Fopencli-plugin-juejin) | JS | 稀土掘金 (Juejin) hot articles |\n| [opencli-plugin-vk](https:\u002F\u002Fgithub.com\u002Fflobo3\u002Fopencli-plugin-vk) | JS | VK (VKontakte) wall, feed, and search |\n\nSee [Plugins Guide](.\u002Fdocs\u002Fguide\u002Fplugins.md) for creating your own plugin.\n\n## For AI Agents (Developer Guide)\n\nBefore writing any adapter code, read the [`opencli-adapter-author` skill](.\u002Fskills\u002Fopencli-adapter-author\u002FSKILL.md). It takes you end-to-end:\n\n- Recon the site and pick a pattern (SPA \u002F SSR \u002F JSONP \u002F Token \u002F Streaming).\n- Discover the right endpoint via `opencli browser network`, `eval`, or the interceptor fallback.\n- Decide auth strategy (`PUBLIC` \u002F `COOKIE` \u002F `HEADER` \u002F `INTERCEPT`).\n- Run `opencli browser analyze \u003Curl>` for one-shot recon, decode response fields, design columns, scaffold with `opencli browser init`.\n- Verify with `opencli browser verify \u003Csite>\u002F\u003Cname>` before shipping.\n\nFor long-lived personal commands that should live in your own Git repo, use a local plugin instead; see [Extending OpenCLI](.\u002Fdocs\u002Fguide\u002Fextending-opencli.md). Quick private adapters can still live at `~\u002F.opencli\u002Fclis\u002F\u003Csite>\u002F\u003Cname>.js`. Site knowledge (endpoints, field maps, fixtures) accumulates in `~\u002F.opencli\u002Fsites\u002F\u003Csite>\u002F` so the next adapter for the same site starts from context instead of zero.\n\n## Testing\n\nSee **[TESTING.md](.\u002FTESTING.md)** for how to run and write tests.\n\n## Troubleshooting\n\n- **\"Extension not connected\"** — Ensure the Browser Bridge extension is installed from the [Chrome Web Store](https:\u002F\u002Fchromewebstore.google.com\u002Fdetail\u002Fopencli\u002Fildkmabpimmkaediidaifkhjpohdnifk) and **enabled** in `chrome:\u002F\u002Fextensions`.\n- **\"attach failed: Cannot access a chrome-extension:\u002F\u002F URL\"** — Another extension may be interfering. Try disabling other extensions temporarily.\n- **Empty data or 'Unauthorized' error** — Your Chrome\u002FChromium login session may have expired. Navigate to the target site and log in again.\n- **Node API errors \u002F missing `fetch` \u002F startup crash on old Node** — OpenCLI requires **Node.js >= 21**. Run `node --version`, upgrade Node if needed, then retry.\n- **Daemon issues** — Check status: `curl localhost:19825\u002Fstatus` · View logs: `curl localhost:19825\u002Flogs`\n\n## Star History\n\n[![Star History Chart](https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=jackwener\u002Fopencli&type=Date)](https:\u002F\u002Fstar-history.com\u002F#jackwener\u002Fopencli&Date)\n\n## License\n\n[Apache-2.0](.\u002FLICENSE)\n","OpenCLI 是一个将任何网站、Electron 应用或本地工具转换为标准化命令行界面的工具，旨在为 AI 代理提供无缝发现、学习和执行工具的能力。其核心功能包括内置适配器支持多种热门网站自动化操作、通过 `opencli-adapter-author` 技能让 AI 代理通过已登录浏览器导航和操作任意网页、以及作为 CLI 中枢管理本地工具如 `gh` 和 `docker` 等。此外，它还支持桌面应用控制，并确保用户账号安全。适用于需要对重复任务进行脚本化处理、集成到 CI\u002FCD 流程中或希望通过命令行与常用服务交互的场景。",2,"2026-06-11 02:52:54","top_language"]