{
  "markdown": "# OpenCLI\n\n> **Convert any website into a CLI & run Browser Use on your logged-in Chrome.**\n> Turn websites, browser sessions, Electron apps, and local tools into deterministic interfaces for humans and AI agents.\n> Or run Browser Use against any page — navigate, fill forms, click, extract, automate.\n\n[![中文文档](https://img.shields.io/badge/docs-%E4%B8%AD%E6%96%87-0F766E?style=flat-square)](./README.zh-CN.md)\n[![npm](https://img.shields.io/npm/v/@jackwener/opencli?style=flat-square)](https://www.npmjs.com/package/@jackwener/opencli)\n[![Node.js Version](https://img.shields.io/node/v/@jackwener/opencli?style=flat-square)](https://nodejs.org)\n[![License](https://img.shields.io/npm/l/@jackwener/opencli?style=flat-square)](./LICENSE)\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/X, and [many more](#built-in-commands).\n- **Let AI Agents operate any website** — install the `opencli-browser` skill in your AI agent (Claude Code, Cursor, etc.), and it can navigate, click, type/fill, 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`, `longbridge`, `tg`, `discord`, `wx`, `ntn` (Notion), and other binaries you register yourself, plus **desktop app adapters** for Electron apps like Cursor, Trae CN, Codex, Antigravity, ChatGPT, and Trae SOLO.\n\n## Quick Start\n\n### 1. Install OpenCLI\n\nFor desktop use, start with **OpenCLIApp**. It bundles the OpenCLI runtime,\nkeeps the managed `opencli` command installed, and gives you a system tray UI\nfor setup, diagnostics, updates, browser-login keepalive, and Web → Markdown.\n\n**Option A — OpenCLIApp (recommended for macOS / Windows):**\nDownload the latest app from <https://opencli.info/download>, install it, then\nopen the app once and use the System page to install or repair the `opencli`\ncommand.\n\n**Option B — npm global install (CLI-only / CI / servers):**\nOpenCLI requires **Node.js >= 20.18.1** when installed through npm.\n\n```bash\nnode --version\nnpm install -g @jackwener/opencli\n```\n\n### 2. Install the Browser Bridge Extension\n\nOpenCLI connects to Chrome/Chromium 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://chromewebstore.google.com/detail/opencli/ildkmabpimmkaediidaifkhjpohdnifk).\n\n**Option B — Manual install:**\n1. Download the latest `opencli-extension-v{version}.zip` from the GitHub [Releases page](https://github.com/jackwener/opencli/releases).\n2. Unzip it, open `chrome://extensions`, 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 <contextId> work\nopencli profile use work\nopencli --profile work browser main 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 <site> <command>` 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](./docs/guide/extending-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://...` |\n| Quickly draft a private local adapter | `opencli browser init <site>/<command>` in `~/.opencli/clis/` |\n| Modify an official adapter locally | `opencli adapter eject <site>` + `opencli adapter reset <site>` |\n| Publish or install third-party commands | `opencli plugin install github:user/repo` |\n| Wrap an existing local binary | `opencli external register <name>` |\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 (also refreshes existing installs)\n\n```bash\nnpx skills add jackwener/opencli\n```\n\nOr install only what you need:\n\n```bash\nnpx skills add jackwener/opencli --skill opencli-adapter-author\nnpx skills add jackwener/opencli --skill opencli-autofix\nnpx skills add jackwener/opencli --skill opencli-browser\nnpx skills add jackwener/opencli --skill opencli-browser-sitemap\nnpx skills add jackwener/opencli --skill opencli-sitemap-author\nnpx skills add jackwener/opencli --skill opencli-usage\n```\n\n### Which skill to use\n\n| Skill | When to use | Example prompt to your AI agent |\n|-------|------------|-------------------------------|\n| **opencli-adapter-author** | Write a reusable adapter for a new site or add a command to an existing site | \"Write an adapter for douyin trending\" / \"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** | Drive a real Chrome page ad-hoc — navigate, fill forms, click, extract | \"Help me check my Xiaohongshu notifications\" / \"Help me fill out this form\" / \"Use browser commands to scrape this page\" |\n| **opencli-browser-sitemap** | Consume site sitemap context while driving a browser task | \"Use the sitemap to navigate this website without blind clicking\" |\n| **opencli-sitemap-author** | Create or update site sitemap knowledge for browser agents | \"Record the stable workflow you just discovered for this site\" |\n| **opencli-usage** | Quick reference for all OpenCLI commands and sites | \"What commands does OpenCLI have for Twitter?\" |\n\n### How it works\n\nOnce `opencli-browser` 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/opencli-browser/SKILL.md`](./skills/opencli-browser/SKILL.md) — drive Chrome ad-hoc (navigate, fill forms, click, extract)\n- [`skills/opencli-browser-sitemap/SKILL.md`](./skills/opencli-browser-sitemap/SKILL.md) — use sitemap context while driving a browser task\n- [`skills/opencli-sitemap-author/SKILL.md`](./skills/opencli-sitemap-author/SKILL.md) — create or update site sitemap knowledge\n- [`skills/opencli-adapter-author/SKILL.md`](./skills/opencli-adapter-author/SKILL.md) — write a new adapter end-to-end\n- [`skills/opencli-autofix/SKILL.md`](./skills/opencli-autofix/SKILL.md) — repair broken adapters\n- [`skills/opencli-usage/SKILL.md`](./skills/opencli-usage/SKILL.md) — command and site reference\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` commands require a `<session>` positional immediately after `browser`. `opencli browser work open <url>` and `opencli browser work tab new [url]` both return a target ID. Use `opencli browser work tab list` to inspect target IDs, then pass `--tab <targetId>` to route a command to a specific tab. `tab new` creates a new tab without changing the default browser target; only `tab select <targetId>` promotes that tab to the default target for later untargeted commands in the same session.\n\n## Writing a new adapter\n\nWhen the site you need is not yet covered, use the `opencli-adapter-author` skill end-to-end:\n\n1. **Recon** the site and pick a pattern (SPA / SSR / JSONP / Token / Streaming).\n2. **Discover** the right endpoint — network inspection, initial state, bundle search, token trace, or interceptor fallback.\n3. **Pick auth** — `PUBLIC` / `COOKIE` / `INTERCEPT` / `UI` / `LOCAL`.\n4. **Decode** response fields and design output columns.\n5. `opencli browser recon analyze <url>` → `opencli browser recon init <site>/<name>` → write adapter → `opencli browser recon verify <site>/<name>`.\n6. Site knowledge persists to `~/.opencli/sites/<site>/` so the next adapter for the same site starts from context.\n\n## Configuration\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `OPENCLI_PROFILE` | — | Browser Bridge profile alias/contextId to use when multiple Chrome profiles are connected |\n| `OPENCLI_WINDOW` | command default | Set to `foreground` or `background` to override Browser Bridge window placement. Browser-backed commands also accept `--window <foreground\\|background>`. |\n| `OPENCLI_SITE_SESSION` | adapter default | Set to `ephemeral` or `persistent` to override `siteSession` metadata for browser-backed adapter commands. `ephemeral` closes the one-shot automation window when the command finishes; `persistent` reuses the site's session. Per-command `--site-session` takes precedence. |\n| `OPENCLI_BROWSER_CONNECT_TIMEOUT` | `45` | 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`opencli browser *` requires an explicit `<session>` positional, uses a foreground browser window by default, and keeps that session's tab lease until `opencli browser <session> close` or idle cleanup. Browser-backed adapters use a background adapter window and release one-shot tab leases by default. Interactive adapters can declare `siteSession: 'persistent'` to keep a stable site tab for continuity; pass `--site-session ephemeral` for a one-shot tab.\n\n## Built-in Commands\n\n| Site | Commands |\n|------|----------|\n| **xiaohongshu** | `search` `ask` `note` `comments` `feed` `user` `download` `publish` `follow` `unfollow` `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` `follow` `unfollow` `me` `subtitle` `summary` `video` `user-videos` `creator-stats` |\n| **zhihu** | `hot` `search` `question` `download` `follow` `like` `favorite` `comment` `answer` |\n| **hackernews** | `top` `new` `best` `ask` `show` `jobs` `search` `user` |\n| **hltv** | `search` `player-summary` `player-matches` `player-form` `player-map-pool` `player-vs-team` `player-teammate-impact` `player-duel` `match-map` `match-series` `team-matches` `team-map-pool` `event-matches` |\n| **geogebra** | `eval` `add-point` `add-line` `add-circle` `add-polygon` `triangle` `hexagon` `list` `info` |\n| **linkedin** | `connect` `inbox` `job-detail` `jobs-preferences` `post-analytics` `posts` `profile-experience` `profile-projects` `profile-read` `profile-analytics` `safe-send` `search` `services-read` `sent-invitations` `thread-snapshot` `timeline` `salesnav-search` `salesnav-inbox` `salesnav-message` `salesnav-thread` |\n| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `upvoted` `save` `saved` `comment` `subscribe` |\n| **twitter** | `trending` `search` `timeline` `tweets` `lists` `list-tweets` `list-create` `list-delete` `list-add` `list-add-batch` `list-remove` `list-remove-batch` `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| **claude** | `ask` `send` `new` `status` `read` `history` `detail` |\n| **gemini** | `new` `ask` `image` `deep-research` `deep-research-result` |\n| **notebooklm** | `status` `list` `open` `current` `get` `history` `summary` `note-list` `notes-get` `source-list` `source-get` `source-fulltext` `source-guide` |\n| **amazon** | `bestsellers` `search` `product` `offer` `discussion` `movers-shakers` `new-releases` `rankings` |\n| **upwork** | `search` `feed` `detail` |\n| **slock** | `message-send` `message-read` `message-search` `channel-list` `channel-info` `channel-create` `channel-members` `channel-join` `task-list` `task-create` `task-claim` `task-status` `task-convert` `task-delete` `thread-list` `thread-follow` `attachment-upload` `attachment-download` `bookmark-add` `inbox` `dm-list` `server-list` `server-use` `whoami` |\n| **huodongxing** | `events` |\n| **midjourney** | `login` `whoami` `settings` `quota` `generate` `describe` `history` `status` `action` `download` |\n\nCurated highlights — **[→ see all 100+ supported sites & commands](./docs/adapters/index.md)** (douyin / weibo / spotify / 1688 / quark / nowcoder / google-scholar / hupu / xianyu / weread / weread-official / xiaoyuzhou / Chess.com / and more).\n\n## CLI Hub\n\nUnified passthrough for your existing command-line tools. Run `opencli <tool> ...` for any of:\n\n`gh` · `docker` · `vercel` · `wrangler` · `obsidian` · `longbridge` · `lark-cli` · `ntn(notion)` · `dws(DingTalk Workspace)` · `wecom-cli(企业微信)` · `tg(tg-cli)` · `discord(discord-cli)` · `wx(wx-cli)`\n\nRegister your own with `opencli external register <name>`; list everything with `opencli external list`.\n\n**Desktop app adapters** (Electron, via CDP): Cursor / Trae CN / Codex / Antigravity / ChatGPT App / ChatWise / Qoder / Discord / Doubao / Trae SOLO — see [`docs/adapters/desktop/`](./docs/adapters/desktop/).\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| **rednote** | Images, Videos | Downloads all media from a signed rednote note URL |\n| **bilibili** | Videos | Requires `yt-dlp` installed |\n| **twitter** | Images, Videos | From user media tab or single tweet |\n| **douban** | Images | Poster / 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/text with local credentials |\n| **zhihu** | Column articles, answers (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://www.xiaohongshu.com/search_result/<id>?xsec_token=...\" --output ./xhs\nopencli xiaohongshu download \"https://xhslink.com/...\" --output ./xhs\nopencli rednote download \"https://www.rednote.com/search_result/<id>?xsec_token=...\" --output ./rednote\nopencli bilibili download BV1xxx --output ./bilibili\nopencli twitter download elonmusk --limit 20 --output ./twitter\nopencli 1688 download 841141931191 --output ./1688-downloads\nopencli xiaoyuzhou download 69b3b675772ac2295bfc01d0 --output ./xiaoyuzhou\nopencli xiaoyuzhou transcript 69dd0c98e2c8be31551f6a33 --output ./xiaoyuzhou-transcripts\n```\n\n`opencli xiaoyuzhou download` and `transcript` require local Xiaoyuzhou credentials in `~/.opencli/xiaoyuzhou.json`.\n\n## Output Formats\n\nAll built-in commands support `--format` / `-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` so CI / scripts can branch on failure mode: `0` success, `66` empty result, `69` Browser Bridge down, `75` timeout, `77` auth required, `78` config error, `130` Ctrl-C. Full reference: [docs/guide/exit-codes.md](./docs/guide/exit-codes.md).\n\n## Plugins\n\nExtend OpenCLI with community-contributed adapters:\n\n```bash\nopencli plugin install github:user/opencli-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://github.com/ByteYue/opencli-plugin-github-trending) | JS | GitHub Trending repositories |\n| [opencli-plugin-hot-digest](https://github.com/ByteYue/opencli-plugin-hot-digest) | JS | Multi-platform trending aggregator |\n| [opencli-plugin-juejin](https://github.com/Astro-Han/opencli-plugin-juejin) | JS | 稀土掘金 (Juejin) hot articles |\n| [opencli-plugin-vk](https://github.com/flobo3/opencli-plugin-vk) | JS | VK (VKontakte) wall, feed, and search |\n| [opencli-plugin-x-article-publisher](https://github.com/genoooool/opencli-plugin-x-article-publisher) | JS | Publish Markdown with local images as X long-form Articles via OpenCLI and xPoster |\n\nSee [Plugins Guide](./docs/guide/plugins.md) for creating your own plugin.\n\n## Testing\n\nSee **[TESTING.md](./TESTING.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://chromewebstore.google.com/detail/opencli/ildkmabpimmkaediidaifkhjpohdnifk) and **enabled** in `chrome://extensions`.\n- **\"attach failed: Cannot access a chrome-extension:// URL\"** — Another extension may be interfering. Try disabling other extensions temporarily.\n- **Empty data or 'Unauthorized' error** — Your Chrome/Chromium login session may have expired. Navigate to the target site and log in again.\n- **Node API errors / missing `fetch` / startup crash on old Node** — OpenCLI requires **Node.js >= 20.18.1**. Run `node --version`, upgrade Node if needed, then retry.\n- **Daemon issues** — Check status: `curl localhost:19825/status` · View logs: `curl localhost:19825/logs`\n\n## Star History\n\n[![Star History Chart](https://star-history.dera.page/svg?repos=jackwener/opencli&type=Date)](https://star-history.dera.page/#jackwener/opencli&Date)\n\n## License\n\n[Apache-2.0](./LICENSE)\n",
  "bytes": 19505,
  "sha": "7f3848c49c92ef2122868ffed5c601958a27ea5c7f8dbc71748244bcbc1a19d4",
  "repo_slug": "jackwener/opencli",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/skl_jackwener_opencli_opencli_explorer_206b1350/readme"
}