qiaomu-opencli-usage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenCLI Usage Guide
OpenCLI 使用指南
Make any website or Electron App your CLI. Reuse Chrome login, zero risk, AI-powered discovery.
让任何网站或Electron App都成为你的CLI。复用Chrome登录凭证,零风险,AI驱动的接口发现能力。
Install & Run
安装与运行
bash
undefinedbash
undefinednpm global install (recommended)
npm 全局安装(推荐)
npm install -g @jackwener/opencli
opencli <command>
npm install -g @jackwener/opencli
opencli <command>
Or from source
或者从源码运行
cd ~/code/opencli && npm install
npx tsx src/main.ts <command>
cd ~/code/opencli && npm install
npx tsx src/main.ts <command>
Update to latest
更新到最新版本
npm update -g @jackwener/opencli
undefinednpm update -g @jackwener/opencli
undefinedPrerequisites
前提条件
Browser commands require:
- Chrome browser running (logged into target sites)
- opencli Browser Bridge Chrome extension installed (load as unpacked in
extension/)chrome://extensions - No further setup needed — the daemon auto-starts on first browser command
Note: You must be logged into the target website in Chrome before running commands. Tabs opened during command execution are auto-closed afterwards.
Public API commands (, ) need no browser.
hackernewsv2ex浏览器相关命令需要满足:
- Chrome浏览器正在运行 (已登录目标站点)
- 已安装 opencli Browser Bridge Chrome扩展(在页面加载
chrome://extensions目录作为已解压的扩展程序)extension/ - 无需额外设置 —— 首次运行浏览器命令时守护进程会自动启动
注意:运行命令前你必须已经在Chrome中登录目标网站。命令执行过程中打开的标签页会在执行结束后自动关闭。
公开API命令(、)不需要浏览器。
hackernewsv2exQuick Lookup by Capability
按功能快速查询
| Capability | Platforms (partial list) |
|---|---|
| search | Bilibili, Twitter, Reddit, Xiaohongshu, Zhihu, YouTube, Google, arXiv, LinkedIn, Pixiv, etc. |
| hot/trending | Bilibili, Twitter, Weibo, HackerNews, Reddit, V2EX, Xueqiu, Lobsters, Douban |
| feed/timeline | Twitter, Reddit, Xiaohongshu, Xueqiu, Jike, Facebook, Instagram, Medium |
| user/profile | Twitter, Reddit, Instagram, TikTok, Facebook, Bilibili, Pixiv |
| post/create | Twitter, Jike, Douyin, Weibo |
| AI chat | Grok, Doubao, ChatGPT, Gemini, Cursor, Codex, NotebookLM |
| finance/stock | Xueqiu, Yahoo Finance, Barchart, Sina Finance, Bloomberg |
| web scraping | |
| GitHub/DevOps | |
| collaboration | |
| 功能 | 支持平台(部分列表) |
|---|---|
| 搜索 | Bilibili、Twitter、Reddit、小红书、知乎、YouTube、Google、arXiv、LinkedIn、Pixiv等 |
| 热门/趋势 | Bilibili、Twitter、微博、HackerNews、Reddit、V2EX、雪球、Lobsters、豆瓣 |
| 动态/时间线 | Twitter、Reddit、小红书、雪球、即刻、Facebook、Instagram、Medium |
| 用户/资料 | Twitter、Reddit、Instagram、TikTok、Facebook、Bilibili、Pixiv |
| 发帖/创建 | Twitter、即刻、抖音、微博 |
| AI聊天 | Grok、豆包、ChatGPT、Gemini、Cursor、Codex、NotebookLM |
| 金融/股票 | 雪球、Yahoo Finance、Barchart、新浪财经、彭博 |
| 网页抓取 | |
| GitHub/DevOps | |
| 协作 | |
Command Quick Reference
命令快速参考
Usage:
opencli <site> <command> [args] [--limit N] [-f json|yaml|md|csv|table]Type legend: 🌐 = Browser (needs Chrome login) · ✅ = Public API (no browser) · 🖥️ = Desktop (Electron/CDP) · 🔧 = External CLI (passthrough)
用法:
opencli <site> <command> [args] [--limit N] [-f json|yaml|md|csv|table]类型说明:🌐 = 浏览器(需要Chrome登录)· ✅ = 公开API(无需浏览器)· 🖥️ = 桌面端(Electron/CDP)· 🔧 = 外部CLI(透传调用)
Website Adapters
网站适配器
| Site | Type | Commands |
|---|---|---|
| 1688 | 🌐 | |
| 36kr | 🌐 | |
| amazon | 🌐 | |
| apple-podcasts | ✅ | |
| arxiv | ✅ | |
| band | 🌐 | |
| barchart | 🌐 | |
| bbc | ✅ | |
| bilibili | 🌐 | |
| bloomberg | ✅🌐 | RSS: |
| bluesky | 🌐 | |
| boss | 🌐 | |
| chaoxing | 🌐 | |
| coupang | 🌐 | |
| ctrip | 🌐 | |
| devto | ✅ | |
| dictionary | ✅ | |
| doubao | 🌐 | |
| douban | 🌐 | |
| douyin | 🌐 | |
| 🌐 | | |
| gemini | 🌐 | |
| ✅ | | |
| grok | 🌐 | |
| hackernews | ✅ | |
| hf | ✅ | |
| hupu | 🌐 | |
| imdb | ✅ | |
| 🌐 | | |
| jd | 🌐 | |
| jianyu | 🌐 | |
| jike | 🌐 | |
| jimeng | 🌐 | |
| lesswrong | ✅ | |
| 🌐 | | |
| linux-do | 🌐 | |
| lobsters | ✅ | |
| medium | 🌐 | |
| notebooklm | 🌐 | |
| ones | 🌐 | |
| paperreview | ✅ | |
| pixiv | 🌐 | |
| producthunt | ✅ | |
| quark | 🌐 | |
| 🌐 | | |
| reuters | 🌐 | |
| sinablog | 🌐 | |
| sinafinance | ✅ | |
| smzdm | 🌐 | |
| spotify | ✅ | |
| stackoverflow | ✅ | |
| steam | ✅ | |
| substack | 🌐 | |
| tieba | 🌐 | |
| tiktok | 🌐 | |
| 🌐 | | |
| v2ex | ✅🌐 | Public: |
| web | 🌐 | |
| 🌐 | | |
| weixin | 🌐 | |
| weread | 🌐 | |
| wikipedia | ✅ | |
| xianyu | 🌐 | |
| xiaoe | 🌐 | |
| xiaohongshu | 🌐 | |
| xiaoyuzhou | ✅ | |
| xueqiu | 🌐 | |
| yahoo-finance | 🌐 | |
| yollomi | 🌐 | |
| youtube | 🌐 | |
| yuanbao | 🌐 | |
| zhihu | 🌐 | |
| zsxq | 🌐 | |
| 站点 | 类型 | 支持命令 |
|---|---|---|
| 1688 | 🌐 | |
| 36kr | 🌐 | |
| 亚马逊 | 🌐 | |
| apple-podcasts | ✅ | |
| arxiv | ✅ | |
| band | 🌐 | |
| barchart | 🌐 | |
| BBC | ✅ | |
| bilibili | 🌐 | |
| 彭博 | ✅🌐 | RSS: |
| bluesky | 🌐 | |
| BOSS直聘 | 🌐 | |
| 超星 | 🌐 | |
| coupang | 🌐 | |
| 携程 | 🌐 | |
| devto | ✅ | |
| 词典 | ✅ | |
| 豆包 | 🌐 | |
| 豆瓣 | 🌐 | |
| 抖音 | 🌐 | |
| 🌐 | | |
| gemini | 🌐 | |
| ✅ | | |
| grok | 🌐 | |
| hackernews | ✅ | |
| hf | ✅ | |
| 虎扑 | 🌐 | |
| imdb | ✅ | |
| 🌐 | | |
| 京东 | 🌐 | |
| 闲鱼 | 🌐 | |
| 即刻 | 🌐 | |
| 即梦 | 🌐 | |
| lesswrong | ✅ | |
| 🌐 | | |
| linux-do | 🌐 | |
| lobsters | ✅ | |
| medium | 🌐 | |
| notebooklm | 🌐 | |
| ones | 🌐 | |
| paperreview | ✅ | |
| pixiv | 🌐 | |
| producthunt | ✅ | |
| 夸克 | 🌐 | |
| 🌐 | | |
| 路透社 | 🌐 | |
| 新浪博客 | 🌐 | |
| 新浪财经 | ✅ | |
| 什么值得买 | 🌐 | |
| spotify | ✅ | |
| stackoverflow | ✅ | |
| steam | ✅ | |
| substack | 🌐 | |
| 贴吧 | 🌐 | |
| tiktok | 🌐 | |
| 🌐 | | |
| v2ex | ✅🌐 | 公开: |
| web | 🌐 | |
| 微博 | 🌐 | |
| 微信 | 🌐 | |
| 微信读书 | 🌐 | |
| 维基百科 | ✅ | |
| 闲鱼 | 🌐 | |
| 小鹅通 | 🌐 | |
| 小红书 | 🌐 | |
| 小宇宙 | ✅ | |
| 雪球 | 🌐 | |
| Yahoo Finance | 🌐 | |
| yollomi | 🌐 | |
| youtube | 🌐 | |
| 元宝 | 🌐 | |
| 知乎 | 🌐 | |
| 知识星球 | 🌐 | |
Desktop Apps (CDP/Electron)
桌面应用(CDP/Electron)
| App | Commands |
|---|---|
| antigravity | |
| chatgpt | |
| chatwise | |
| codex | |
| cursor | |
| discord-app | |
| doubao-app | |
| notion | |
| 应用 | 支持命令 |
|---|---|
| antigravity | |
| chatgpt | |
| chatwise | |
| codex | |
| cursor | |
| discord-app | |
| doubao-app | |
| notion | |
External CLI (passthrough)
外部CLI(透传)
OpenCLI can discover, auto-install, and passthrough commands to external CLI tools. Use to auto-install, or to register a local CLI.
opencli install <name>opencli register <name>| CLI | Description | Commands |
|---|---|---|
| gh | GitHub CLI — repos, PRs, issues, releases | |
| obsidian | Obsidian vault — notes, search, tags | All obsidian subcommands |
| docker | Docker CLI | All docker subcommands |
| lark-cli | Lark/Feishu — messages, docs, calendar, tasks (200+ commands) | All lark-cli subcommands |
| dws | DingTalk Workspace — messages, docs, calendar, contacts | All dws subcommands |
| wecom-cli | WeCom/企业微信 — contacts, todos, meetings, messages | All wecom-cli subcommands |
| vercel | Vercel — deploy, domains, env vars, logs | All vercel subcommands |
bash
opencli install gh # Auto-install gh CLI
opencli register my-tool # Register a local custom CLI
opencli gh pr list --limit 5 # Passthrough to gh
opencli docker ps # Passthrough to docker
opencli lark-cli msg send ... # Passthrough to lark-cliOpenCLI可以发现、自动安装并透传命令到外部CLI工具。使用自动安装,或使用注册本地CLI。
opencli install <name>opencli register <name>| CLI | 描述 | 支持命令 |
|---|---|---|
| gh | GitHub CLI — 仓库、PR、Issue、发布 | |
| obsidian | Obsidian知识库 — 笔记、搜索、标签 | 所有obsidian子命令 |
| docker | Docker CLI | 所有docker子命令 |
| lark-cli | 飞书 — 消息、文档、日历、任务(200+命令) | 所有lark-cli子命令 |
| dws | 钉钉 workspace — 消息、文档、日历、联系人 | 所有dws子命令 |
| wecom-cli | 企业微信 — 联系人、待办、会议、消息 | 所有wecom-cli子命令 |
| vercel | Vercel — 部署、域名、环境变量、日志 | 所有vercel子命令 |
bash
opencli install gh # 自动安装gh CLI
opencli register my-tool # 注册本地自定义CLI
opencli gh pr list --limit 5 # 透传调用gh
opencli docker ps # 透传调用docker
opencli lark-cli msg send ... # 透传调用lark-cliManagement
管理命令
bash
opencli list [-f json|yaml] # List all commands
opencli validate [site] # Validate adapter definitions
opencli doctor # Diagnose browser bridge
opencli explore <url> # AI-powered API discovery
opencli record <url> # Record API calls manuallyAll commands support: / with
--format-ftablejsonyamlmdcsvbash
opencli list [-f json|yaml] # 列出所有命令
opencli validate [site] # 校验适配器定义
opencli doctor # 诊断浏览器桥接状态
opencli explore <url> # AI驱动的API发现
opencli record <url> # 手动录制API调用所有命令都支持: / 参数,可选值为
--format-ftablejsonyamlmdcsvSelf-Repair
自修复功能
If a command fails due to a site change (selector, API, or response schema), automatically fix the adapter and retry instead of reporting failure. Re-run the command with to get structured diagnostic context, then fix the adapter file at and retry. Max 3 repair rounds. See the skill for the full workflow.
OPENCLI_DIAGNOSTIC=1RepairContext.adapter.sourcePathopencli-autofix如果命令因为站点变更(选择器、API或响应结构变更)执行失败,会自动修复适配器并重试,而不是直接返回失败。添加参数重新运行命令可以获取结构化诊断上下文,之后修复路径下的适配器文件并重试即可。最多支持3轮修复。完整工作流请参考 skill。
OPENCLI_DIAGNOSTIC=1RepairContext.adapter.sourcePathopencli-autofixRelated Skills
相关技能
- opencli-browser — Browser automation for AI agents (navigate, click, type, extract via Chrome)
- opencli-explorer — Full guide for creating new adapters (API discovery, auth strategy, TS writing)
- opencli-oneshot — Quick 4-step template for adding a single command from a URL
- opencli-autofix — Automatically fix broken adapters when commands fail
- opencli-browser — 面向AI Agent的浏览器自动化能力(通过Chrome实现导航、点击、输入、提取)
- opencli-explorer — 创建新适配器的完整指南(API发现、鉴权策略、TS编写)
- opencli-oneshot — 从URL添加单个命令的4步快速模板
- opencli-autofix — 命令失败时自动修复损坏的适配器