把任何网站、本地工具、Electron 应用变成能够让 AI 调用的命令行!
零风控 · 复用 Chrome 登录 · AI 自动发现接口 · 全能 CLI 枢纽
OpenCLI 将任何网站或 Electron 应用(如 Antigravity)变成命令行工具 — B站、知乎、小红书、Twitter/X、Reddit、YouTube 等多种站点与应用 — 复用浏览器登录态,AI 驱动探索。
专为 AI Agent 打造:只需在全局 .cursorrules 或 AGENT.md 中配置简单指令,引导 AI 通过 Bash 执行 opencli list 来检索可用的 CLI 工具及其用法。随后,将你常用的 CLI 列表整合注册进去(opencli register mycli),AI 便能瞬间学会自动调用相应的本地工具!
opencli 支持 CLI 化所有 electron 应用!最强大更新来袭! CLI all electron!现在支持把所有 electron 应用 CLI 化,从而组合出各种神奇的能力。 如果你在使用诸如 Antigravity Ultra 等工具时觉得不够灵活或难以扩展,现在通过 OpenCLI 把他 CLI 化,轻松打破界限。 现在,AI 可以自己控制自己!结合 cc/openclaw 就可以远程控制任何 electron 应用!无限玩法!!
- CLI All Electron — 支持把所有 electron 应用(如 Antigravity Ultra)CLI 化,让 AI 控制自己!
- 多站点覆盖 — 覆盖 B站、知乎、小红书、Twitter、Reddit,以及多种桌面应用
- 零风控 — 复用 Chrome 登录态,无需存储任何凭证
- 自修复配置 —
opencli setup检查 Browser Bridge 连通性;opencli doctor诊断 daemon、扩展和浏览器连接状态 - AI 原生 —
explore自动发现 API,synthesize生成适配器,cascade探测认证策略 - 动态加载引擎 — 声明式的
.yaml或者底层定制的.ts适配器,放入clis/文件夹即可自动注册生效
- Node.js: >= 20.0.0
- Chrome 浏览器正在运行,且已登录目标网站(如 bilibili.com、zhihu.com、xiaohongshu.com)
⚠️ 重要:大多数命令复用你的 Chrome 登录状态。运行命令前,你必须已在 Chrome 中打开目标网站并完成登录。如果获取到空数据或报错,请先检查你的浏览器登录状态。
OpenCLI 通过轻量化的 Browser Bridge Chrome 扩展 + 微型 daemon 与浏览器通信(零配置,自动启动)。
你可以选择以下任一方式安装扩展:
方式一:下载构建好的安装包(推荐)
- 到 GitHub Releases 页面 下载最新的
opencli-extension.zip或opencli-extension.crx。 - 打开 Chrome 的
chrome://extensions,启用右上角的 开发者模式。 - 将
.crx拖入浏览器窗口,或将解压后的文件夹拖入即可完成安装。
方式二:加载源码(针对开发者)
- 同样在
chrome://extensions开启 开发者模式。 - 点击 加载已解压的扩展程序,选择本仓库代码树中的
extension/文件夹。
完成!运行任何 opencli 浏览器命令时,后台微型 daemon 会自动启动与浏览器通信。无需配 API Token,零代码配置。
Tip:后续诊断用
opencli doctor:opencli doctor # 检查扩展和 daemon 连通性 opencli doctor --live # 额外测试浏览器命令
npm install -g @jackwener/opencli直接使用:
opencli list # 查看所有命令
opencli list -f yaml # 以 YAML 列出所有命令
opencli hackernews top --limit 5 # 公共 API,无需浏览器
opencli bilibili hot --limit 5 # 浏览器命令
opencli zhihu hot -f json # JSON 输出
opencli zhihu hot -f yaml # YAML 输出git clone git@github.com:jackwener/opencli.git
cd opencli
npm install
npm run build
npm link # 链接到全局环境
opencli list # 可以在任何地方使用了!npm install -g @jackwener/opencli@latest运行 opencli list 查看完整注册表。
| 站点 | 命令 | 模式 |
|---|---|---|
trending bookmarks profile search timeline thread following followers notifications post reply delete like article follow unfollow bookmark unbookmark download accept reply-dm |
浏览器 | |
hot frontpage popular search subreddit read user user-posts user-comments upvote save comment subscribe saved upvoted |
浏览器 | |
| cursor | status send read new dump composer model extract-code ask screenshot history export |
桌面端 |
| bilibili | hot search me favorite history feed subtitle dynamic ranking following user-videos download |
浏览器 |
| codex | status send read new dump extract-diff model ask screenshot history export |
桌面端 |
| chatwise | status new send read ask model history export screenshot |
桌面端 |
| notion | status search read new write sidebar favorites export |
桌面端 |
| discord-app | status send read channels servers search members |
桌面端 |
| v2ex | hot latest topic daily me notifications |
公开 / 浏览器 |
| xueqiu | feed hot-stock hot search stock watchlist |
浏览器 |
| antigravity | status send read new dump extract-code model watch |
桌面端 |
| chatgpt | status new send read ask |
桌面端 |
| xiaohongshu | search notifications feed user download creator-notes creator-note-detail creator-notes-summary creator-profile creator-stats |
浏览器 |
| apple-podcasts | search episodes top |
公开 |
| xiaoyuzhou | podcast podcast-episodes episode |
公开 |
| zhihu | hot search question download |
浏览器 |
| youtube | search video transcript |
浏览器 |
| boss | search detail recommend joblist greet batchgreet send chatlist chatmsg invite mark exchange resume stats |
浏览器 |
| coupang | search add-to-cart |
浏览器 |
| bbc | news |
公共 API |
| bloomberg | main markets economics industries tech politics businessweek opinions feeds news |
公共 API / 浏览器 |
| ctrip | search |
浏览器 |
| arxiv | search paper |
公开 |
| wikipedia | search summary |
公开 |
| hackernews | top |
公共 API |
search |
浏览器 | |
| reuters | search |
浏览器 |
| smzdm | search |
浏览器 |
hot |
浏览器 | |
| yahoo-finance | quote |
浏览器 |
| sinafinance | news |
🌐 公开 |
| barchart | quote options greeks flow |
浏览器 |
| chaoxing | assignments exams |
浏览器 |
| grok | ask |
桌面端 |
| hf | top |
公开 |
| jike | feed search create like comment repost notifications post topic user |
浏览器 |
| jimeng | generate history |
浏览器 |
| linux-do | hot latest search categories category topic |
公开 |
| stackoverflow | hot search bounties unanswered |
公开 |
| steam | top-sellers |
公开 |
| weread | shelf search book highlights notes notebooks ranking |
浏览器 |
Bloomberg 说明:Bloomberg 的 RSS 列表命令(
main、各栏目 feed、feeds)无需浏览器即可使用。bloomberg news适用于当前 Chrome 会话本身就能访问的标准 Bloomberg 文章页。音频页和部分非标准页面可能失败,OpenCLI 也不会绕过 Bloomberg 的付费墙、登录或权限校验。
每个桌面适配器都有自己详细的文档说明,包括命令参考、启动配置与使用示例:
| 应用 | 描述 | 文档 |
|---|---|---|
| Cursor | 控制 Cursor IDE — Composer、对话、代码提取等 | README |
| Codex | 在后台(无头)驱动 OpenAI Codex CLI Agent | README |
| Antigravity | 在终端直接控制 Antigravity Ultra | README |
| ChatGPT | 自动化操作 ChatGPT macOS 桌面客户端 | README |
| ChatWise | 多 LLM 客户端(GPT-4、Claude、Gemini) | README |
| Notion | 搜索、读取、写入 Notion 页面 | README |
| Discord | Discord 桌面版 — 消息、频道、服务器 | README |
| Feishu | 飞书/Lark 桌面版 (AppleScript 驱动) | README |
| 微信 Mac 桌面端 (AppleScript + 无障碍接口) | README | |
| NeteaseMusic | 网易云音乐 (CEF/CDP 驱动) | README |
OpenCLI 支持从各平台下载图片、视频和文章。
| 平台 | 内容类型 | 说明 |
|---|---|---|
| 小红书 | 图片、视频 | 下载笔记中的所有媒体文件 |
| B站 | 视频 | 需要安装 yt-dlp |
| Twitter/X | 图片、视频 | 从用户媒体页或单条推文下载 |
| 知乎 | 文章(Markdown) | 导出文章,可选下载图片到本地 |
下载流媒体平台的视频需要安装 yt-dlp:
# 安装 yt-dlp
pip install yt-dlp
# 或者
brew install yt-dlp# 下载小红书笔记中的图片/视频
opencli xiaohongshu download --note-id abc123 --output ./xhs
# 下载B站视频(需要 yt-dlp)
opencli bilibili download --bvid BV1xxx --output ./bilibili
opencli bilibili download --bvid BV1xxx --quality 1080p # 指定画质
# 下载 Twitter 用户的媒体
opencli twitter download elonmusk --limit 20 --output ./twitter
# 下载单条推文的媒体
opencli twitter download --tweet-url "https://x.com/user/status/123" --output ./twitter
# 导出知乎文章为 Markdown
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu
# 导出并下载图片
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --download-imagesdownload step 可以在 YAML 管线中使用:
pipeline:
- fetch: https://api.example.com/media
- download:
url: ${{ item.imageUrl }}
dir: ./downloads
filename: ${{ item.title | sanitize }}.jpg
concurrency: 5
skip_existing: true所有内置命令都支持 --format / -f,可选值为 table、json、yaml、md、csv。
list 命令也支持同样的格式参数,同时继续兼容 --json。
opencli list -f yaml # 用 YAML 列出命令注册表
opencli bilibili hot -f table # 默认:富文本表格
opencli bilibili hot -f json # JSON(适合传给 jq 或者各类 AI Agent)
opencli bilibili hot -f yaml # YAML(更适合人类直接阅读)
opencli bilibili hot -f md # Markdown
opencli bilibili hot -f csv # CSV
opencli bilibili hot -v # 详细模式:展示管线执行步骤调试信息如果你是一个被要求查阅代码并编写新 opencli 适配器的 AI,请遵守以下工作流。
快速模式:只想为某个页面快速生成一个命令?看 CLI-ONESHOT.md — 给一个 URL + 一句话描述,4 步搞定。
完整模式:在编写任何新代码前,先阅读 CLI-EXPLORER.md。它包含完整的适配器探索开发指南、API 探测流程、5级认证策略以及常见陷阱。
# 1. Deep Explore — 网络拦截 → 响应分析 → 能力推理 → 框架检测
opencli explore https://example.com --site mysite
# 2. Synthesize — 从探索成果物生成 evaluate-based YAML 适配器
opencli synthesize mysite
# 3. Generate — 一键完成:探索 → 合成 → 注册
opencli generate https://example.com --goal "hot"
# 4. Strategy Cascade — 自动降级探测:PUBLIC → COOKIE → HEADER
opencli cascade https://api.example.com/data探索结果输出到 .opencli/explore/<site>/。
- "Extension not connected" 报错
- 确保你当前的 Chrome 已安装且开启了 opencli Browser Bridge 扩展(在
chrome://extensions中检查)。
- 确保你当前的 Chrome 已安装且开启了 opencli Browser Bridge 扩展(在
- 返回空数据,或者报错 "Unauthorized"
- Chrome 里的登录态可能已经过期。请打开当前 Chrome 页面,在新标签页重新手工登录或刷新该页面。
- Node API 错误 (如 parseArgs, fs 等)
- 确保 Node.js 版本
>= 20。
- 确保 Node.js 版本
- Daemon 问题
- 检查 daemon 状态:
curl localhost:19825/status - 查看扩展日志:
curl localhost:19825/logs
- 检查 daemon 状态:
npm version patch # 0.1.0 → 0.1.1
npm version minor # 0.1.0 → 0.2.0
# 推送 tag,GitHub Actions 将自动执行发版和 npm 发布
git push --follow-tags