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应用转化为你的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、新浪财经、Bloomberg |
| 网页抓取 | |
| 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 | 🌐 | |
| 36氪 | 🌐 | |
| amazon | 🌐 | |
| apple-podcasts | ✅ | |
| arxiv | ✅ | |
| band | 🌐 | |
| barchart | 🌐 | |
| bbc | ✅ | |
| bilibili | 🌐 | |
| bloomberg | ✅🌐 | RSS: |
| bluesky | 🌐 | |
| boss直聘 | 🌐 | |
| 超星学习通 | 🌐 | |
| coupang | 🌐 | |
| 携程 | 🌐 | |
| devto | ✅ | |
| dictionary | ✅ | |
| 豆包 | 🌐 | |
| 豆瓣 | 🌐 | |
| 抖音 | 🌐 | |
| 🌐 | | |
| gemini | 🌐 | |
| ✅ | | |
| grok | 🌐 | |
| hackernews | ✅ | |
| hf | ✅ | |
| 虎扑 | 🌐 | |
| imdb | ✅ | |
| 🌐 | | |
| 京东 | 🌐 | |
| 简鱼 | 🌐 | |
| 即刻 | 🌐 | |
| 即梦AI | 🌐 | |
| lesswrong | ✅ | |
| 🌐 | | |
| LinuxDo | 🌐 | |
| lobsters | ✅ | |
| medium | 🌐 | |
| notebooklm | 🌐 | |
| ONES | 🌐 | |
| paperreview | ✅ | |
| pixiv | 🌐 | |
| producthunt | ✅ | |
| 夸克网盘 | 🌐 | |
| 🌐 | | |
| 路透社 | 🌐 | |
| 新浪博客 | 🌐 | |
| 新浪财经 | ✅ | |
| 什么值得买 | 🌐 | |
| spotify | ✅ | |
| stackoverflow | ✅ | |
| steam | ✅ | |
| substack | 🌐 | |
| 贴吧 | 🌐 | |
| tiktok | 🌐 | |
| 🌐 | | |
| v2ex | ✅🌐 | 公共API: |
| web | 🌐 | |
| 微博 | 🌐 | |
| 微信 | 🌐 | |
| 微信读书 | 🌐 | |
| wikipedia | ✅ | |
| 闲鱼 | 🌐 | |
| 小鹅通 | 🌐 | |
| 小红书 | 🌐 | |
| 小宇宙 | ✅ | |
| 雪球 | 🌐 | |
| yahoo-finance | 🌐 | |
| Yollomi | 🌐 | |
| youtube | 🌐 | |
| 元宝AI | 🌐 | |
| 知乎 | 🌐 | |
| 知识星球 | 🌐 | |
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 | Lark/飞书 — 消息、文档、日历、任务(200+命令) | 所有lark-cli子命令 |
| dws | 钉钉工作台 — 消息、文档、日历、联系人 | 所有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或响应 schema)导致命令失败,请自动修复适配器并重试,而非直接报告错误。添加参数重新运行命令以获取结构化诊断信息,然后在路径下修复适配器文件并重试。最多支持3轮修复。完整工作流请查看技能。
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 — 命令失败时自动修复损坏的适配器