OpenCLI Tool Integration
使用 OpenCLI 工具从各种网站和桌面应用获取数据、下载媒体内容、控制外部 CLI 工具。支持 Bilibili、知乎、小红书、Twitter/X、Reddit、YouTube、Boss直聘、即刻、微博等 30+ 平台,以及 Cursor、Codex、ChatGPT、Notion 等桌面应用。当用户需要:从社...
Wike-CHI
@wike-chi
What This Skill Does
Unified command-line interface that accesses 30+ websites (Bilibili, Zhihu, Xiaohongshu, Twitter, Reddit, YouTube, etc.), controls desktop apps (Cursor, ChatGPT, Notion, Discord), and manages external CLI tools (gh, docker, kubectl). Supports data fetching, media downloading, and app automation through a single tool.
Replaces building separate scrapers or integrations for each platform by providing a single CLI with consistent commands and browser-session reuse.
When to Use It
- Fetch trending content from Bilibili, Zhihu, or Hacker News
- Search and download videos or images from Xiaohongshu, Twitter, or Bilibili
- Control Cursor, ChatGPT, or Notion desktop apps from the terminal
- Run GitHub CLI, Docker, or kubectl commands through the unified interface
- Export Zhihu articles or Reddit posts as structured data (JSON, Markdown, CSV)
Install
$ openclaw skills install @wike-chi/opencli-toolOpenCLI Skill
通过 OpenCLI 工具,让 AI Agent 能够访问和操作 30+ 网站、桌面应用和外部 CLI 工具。
核心能力
1. 网站数据获取
支持通过浏览器复用 Chrome 登录状态,从以下平台获取数据:
- 社交媒体: Twitter/X, Reddit, 微博, 即刻
- 视频平台: Bilibili, YouTube, 小红书
- 问答社区: 知乎, V2EX, StackOverflow, Linux-Do
- 新闻资讯: BBC, Bloomberg, Reuters, HackerNews, Dev.to
- 求职招聘: Boss直聘, LinkedIn
- 电商购物: Coupang, 什么值得买
- 金融财经: 雪球, Yahoo Finance, Barchart
- 其他: 微信读书, 携程, Wikipedia, arXiv, Steam
2. 桌面应用控制
控制本地安装的桌面应用(需要应用正在运行):
- Cursor: 控制 Composer、提取代码、历史记录
- Codex: 驱动 OpenAI Codex CLI
- ChatGPT: 自动化 ChatGPT macOS 应用
- ChatWise: 多 LLM 客户端控制
- Notion: 搜索、读取、写入 Notion 页面
- Discord: 消息、频道、服务器操作
- Antigravity: 从终端控制 Antigravity Ultra
- Grok: Grok 桌面应用
3. 外部 CLI Hub
发现、自动安装和传递命令到外部 CLI:
gh- GitHub CLIdocker- Docker 命令行kubectl- Kubernetes 工具obsidian- Obsidian vault 管理readwise- Readwise & Reader CLI
4. 媒体下载
下载图片、视频和文章:
- 小红书: 图片、视频
- Bilibili: 视频(需要 yt-dlp)
- Twitter: 图片、视频
- 知乎: 文章(Markdown 格式)
使用前准备
安装 OpenCLI
npm install -g @jackwener/opencli
安装 Browser Bridge 扩展
- 访问 GitHub Releases 页面下载最新扩展
- 在 Chrome 打开
chrome://extensions - 启用开发者模式
- 拖放 .crx 文件或解压后的文件夹
验证安装
opencli list # 查看所有可用命令
opencli doctor # 检查扩展和守护进程连接
opencli doctor --live # 测试实时浏览器命令
命令格式
基本格式
opencli <site> <command> [options]
# 示例
opencli bilibili hot --limit 10
opencli zhihu search --keyword "AI"
opencli twitter trending --limit 5
输出格式
支持多种输出格式:
opencli bilibili hot -f table # 表格(默认)
opencli bilibili hot -f json # JSON
opencli bilibili hot -f yaml # YAML
opencli bilibili hot -f md # Markdown
opencli bilibili hot -f csv # CSV
详细模式
opencli bilibili hot -v # 显示管道调试步骤
常用命令示例
获取热门内容
# Bilibili 热门
opencli bilibili hot --limit 10
# 知乎热榜
opencli zhihu hot
# Hacker News 热门
opencli hackernews top --limit 5
# 微博热搜
opencli weibo hot
# Reddit 热门
opencli reddit hot --limit 10
搜索
# Bilibili 搜索
opencli bilibili search --keyword "AI教程" --limit 10
# 知乎搜索
opencli zhihu search --keyword "机器学习"
# YouTube 搜索
opencli youtube search --keyword "OpenAI"
# arXiv 论文搜索
opencli arxiv search --keyword "transformer"
# 小红书搜索
opencli xiaohongshu search --keyword "美食"
下载媒体
# 下载 Bilibili 视频(需要 yt-dlp)
opencli bilibili download --bvid BV1xxx --output ./videos
# 下载小红书笔记媒体
opencli xiaohongshu download --note-id abc123 --output ./xhs
# 下载 Twitter 媒体
opencli twitter download elonmusk --limit 20 --output ./twitter
# 导出知乎文章
opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu
桌面应用控制
# Cursor 状态
opencli cursor status
# Notion 搜索
opencli notion search --query "项目"
# ChatGPT 发送消息
opencli chatgpt send --message "Hello"
# Discord 读取消息
opencli discord-app read
外部 CLI
# GitHub CLI
opencli gh pr list --limit 5
# Docker
opencli docker ps
# kubectl
opencli kubectl get pods
重要注意事项
浏览器命令
⚠️ 重要: 浏览器命令会复用 Chrome 的登录状态。在运行命令前,确保:
- Chrome 正在运行
- 已在 Chrome 中登录目标网站
- 如果返回空数据或未授权错误,检查登录状态
视频下载
视频下载需要安装 yt-dlp:
pip install yt-dlp
# 或
brew install yt-dlp
公开 API vs 浏览器命令
- 公开 API: 不需要浏览器,直接访问(如 hackernews, bbc, wikipedia)
- 浏览器命令: 需要Chrome 运行并登录(如 bilibili, zhihu, xiaohongshu)
探索和发现
查看所有可用命令
opencli list
opencli list -f yaml # YAML 格式
探索新网站
# 深度探索网站API
opencli explore https://example.com --site mysite
# 生成 YAML 适配器
opencli synthesize mysite
# 一键生成
opencli generate https://example.com --goal "hot"
注册自己的 CLI
opencli register mycli
故障排除
扩展未连接
- 确保 Browser Bridge 扩展已安装并启用
- 检查
chrome://extensions
空数据或未授权错误
- 在 Chrome 中打开目标网站并登录
- 刷新页面确保会话有效
Node API 错误
- 确保使用 Node.js >= 20.0.0
守护进程问题
curl localhost:19825/status # 检查状态
curl localhost:19825/logs # 查看日志
最佳实践
- 先检查登录状态: 浏览器命令前确保已在 Chrome 登录
- 使用合适的输出格式: JSON 适合管道处理,YAML 适合人类阅读
- 限制结果数量: 使用
--limit避免返回过多数据 - 验证安装: 使用
opencli doctor定期检查连接状态 - 查看命令列表: 定期运行
opencli list发现新功能
项目信息
- GitHub: https://github.com/jackwener/opencli
- NPM: https://www.npmjs.com/package/@jackwener/opencli
- License: Apache-2.0
- Node.js 要求: >= 20.0.0
Top skills in this category
Gog
@steipeteGoogle Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs.
API Gateway
@byungkyuCall third-party APIs through the Maton gateway, which injects the credential for an app the user has already connected. Use this skill when the user names a connected app and a concrete action in it - read a mailbox, query a CRM, file an issue, update a spreadsheet, run a query through a connected
Notion
@steipeteNotion API for creating and managing pages, databases, and blocks.
Mcporter
@steipeteUse the mcporter CLI to list, configure, auth, and call MCP servers/tools directly (HTTP or stdio), including ad-hoc servers, config edits, and CLI/type generation.
Caldav Calendar
@asleep123Sync and query CalDAV calendars (iCloud, Google, Fastmail, Nextcloud, etc.) using vdirsyncer + khal. Works on Linux.