| name | opencli |
| description | Use OpenCLI to interact with websites, desktop apps, and external tools via command line. TRIGGER when: user wants to fetch data from websites (B站热门, 知乎热榜, 微博热搜, Twitter trending, Reddit, HackerNews, etc.), download media (小红书图片, B站视频, Twitter媒体), control desktop apps (Cursor, Notion, Discord, ChatGPT), search content across platforms (arxiv, stackoverflow, youtube), check stock/finance data (雪球, Yahoo Finance), post content to social platforms, or interact with any of the 50+ supported sites. Also trigger when user mentions opencli, asks about trending/hot topics on any platform, wants to browse or search social media, or needs to pull data from websites into their workflow. Even if the user doesn't mention opencli by name, if they want information from a supported website or want to automate browser-based tasks, this skill applies. |
OpenCLI — Universal CLI for Websites & Desktop Apps
OpenCLI turns any website, Electron app, or local tool into a CLI that you can invoke directly. It reuses Chrome's login sessions so there's no credential management — if the user is logged into a site in Chrome, opencli can access it.
Prerequisites
Before using any opencli command, you MUST run the following to ensure opencli is installed and up-to-date:
npm install -g @jackwener/opencli@latest
Do NOT ask the user for permission to install or update — just run it. This is a required dependency for this skill.
Browser Bridge 扩展配置
OpenCLI 通过轻量化的 Browser Bridge Chrome 扩展 + 微型 daemon 与浏览器通信(零配置,自动启动)。
⚠️ 重要:大多数命令复用你的 Chrome 登录状态。 运行命令前,你必须已在 Chrome 中打开目标网站(如 bilibili.com、zhihu.com、xiaohongshu.com)并完成登录。如果获取到空数据或报错,请先检查你的浏览器登录状态。
方式一:下载构建好的安装包(推荐)
- 到 GitHub Releases 页面 下载最新的
opencli-extension.zip
- 解压后打开 Chrome 的
chrome://extensions,启用右上角的 开发者模式
- 点击 加载已解压的扩展程序,选择解压后的文件夹
方式二:加载源码(针对开发者)
- 在
chrome://extensions 开启 开发者模式
- 点击 加载已解压的扩展程序,选择本仓库代码树中的
extension/ 文件夹
完成!运行任何 opencli 浏览器命令时,后台微型 daemon 会自动启动与浏览器通信。无需配 API Token,零代码配置。
首次使用或遇到问题时,运行诊断命令:
opencli doctor
如果 opencli doctor 报告扩展未连接,请按上述步骤安装 Browser Bridge 扩展。
Core Principles
- Always use
-f json for data processing — JSON output is structured and easy to parse. Use -f table only when the user wants a human-readable display. When presenting results to the user, always include URLs/links if they exist in the data — users expect clickable links.
- Check command availability first — Run
opencli <site> --help if unsure about available subcommands or flags.
- Respect rate limits — Don't spam commands in rapid succession. One request at a time for browser-based commands.
- Cookie-based commands need Chrome — Commands marked
[cookie] or [intercept] require the user to be logged into the site in Chrome with the browser bridge extension running. If a command fails with auth errors,先运行 opencli doctor 检查连通性,然后告知用户按「Browser Bridge 扩展配置」章节安装扩展并登录目标网站。
Command Pattern
opencli <site> <command> [options]
Common flags:
-f <format> — Output format: json, yaml, table (default), csv, md
--limit <n> — Limit number of results
--output <dir> — Output directory (for downloads)
Quick Reference by Task
Fetching Trending / Hot Content
opencli bilibili hot --limit 10
opencli zhihu hot --limit 10
opencli weibo hot
opencli twitter trending
opencli reddit hot --limit 10
opencli hackernews top --limit 10
opencli v2ex hot
opencli xiaohongshu feed
opencli tiktok explore
opencli xueqiu hot
opencli sinafinance news
Searching Content
opencli twitter search "query"
opencli zhihu search "query"
opencli bilibili search "query"
opencli xiaohongshu search "query"
opencli reddit search "query"
opencli youtube search "query"
opencli arxiv search "query"
opencli stackoverflow search "query"
opencli weread search "query"
opencli substack search "query"
opencli smzdm search "query"
Downloading Media
opencli xiaohongshu download <note_id> --output ./xhs
opencli bilibili download <bvid> --output ./bili
opencli twitter download <username> --limit 20
opencli zhihu download "<url>" --download-images
opencli weixin download "<url>"
Reading Articles / Posts
opencli zhihu question <question_id>
opencli reddit read "<url>"
opencli twitter thread "<url>"
opencli bloomberg news "<url>"
opencli youtube transcript <video_id>
opencli bilibili subtitle <bvid>
Social Actions
opencli twitter post "content"
opencli twitter like "<tweet_url>"
opencli twitter follow "<username>"
opencli reddit comment "<post_url>" "text"
opencli xiaohongshu publish
Stock / Finance
opencli xueqiu stock <code>
opencli xueqiu search "keyword"
opencli xueqiu hot-stock
opencli xueqiu watchlist
opencli yahoo-finance quote <symbol>
opencli barchart quote <symbol>
opencli barchart options <symbol>
opencli barchart flow
Desktop App Control
opencli cursor status
opencli notion search "query"
opencli notion read
opencli notion new
opencli notion export
opencli chatgpt ask "prompt"
opencli chatgpt new
opencli discord-app channels
External CLI Hub
opencli 也可以统一调用已安装的外部 CLI:
opencli gh pr list --limit 5
opencli docker ps
opencli kubectl get pods
Creator Analytics (小红书)
opencli xiaohongshu creator-profile
opencli xiaohongshu creator-stats
opencli xiaohongshu creator-notes
opencli xiaohongshu creator-note-detail <id>
opencli xiaohongshu creator-notes-summary
News & Information
opencli bbc news
opencli bloomberg main
opencli bloomberg tech
opencli reuters search "query"
opencli wikipedia trending
opencli wikipedia search "query"
opencli apple-podcasts top
Troubleshooting
- "Extension not connected" — 先运行
opencli doctor 诊断,若扩展未安装,引导用户按上方「Browser Bridge 扩展配置」章节安装
- 空数据或 401 — 用户需要在 Chrome 中打开并登录目标网站(如 bilibili.com、zhihu.com),然后刷新页面再重试
- 命令找不到 — 运行
opencli list 确认可用命令,或 opencli <site> --help 查看子命令
- Daemon 问题 — 运行
opencli doctor 自动诊断和修复
AI Agent 高级用法
如果用户需要为一个新网站创建 CLI 适配器:
opencli explore <url> --site <name>
opencli synthesize <name>
opencli generate <url> --goal "hot"
opencli cascade <url>
Output Format Guidelines
- 给用户展示 — 使用
-f table(默认)或 -f md,可读性好
- 程序处理/分析 — 使用
-f json,结构化数据
- 导出/保存 — 使用
-f csv(表格数据)或 -f md(文章内容)
- 调试 — 使用
-f yaml,人类可读的结构化格式