qiaomu-opencli-skills
repository·main·Indexed 21 days ago
https://github.com/joeseesun/qiaomu-opencli-skillsA collection of Claude Code Skills for OpenCLI providing CLI interfaces for 79+ websites and desktop applications. It enables AI agents to automate tasks such as searching, posting, and downloading content from platforms like Bilibili, Twitter/X, and YouTube, as well as controlling Electron-based apps like Cursor, ChatGPT, and Notion. Includes specialized skills for adapter repair (qiaomu-opencli-autofix) and browser automation.
What's inside qiaomu-opencli-skills
- Qiaomu OpenCLI Skills is a collection of Claude Code Skills built on top of jackwener/opencli. It transforms over 79 websites and various desktop applications into CLI interfaces, enabling AI Agents to perform tasks like searching, posting, downloading videos, and controlling browsers or Electron apps (e.g., Cursor, Notion, ChatGPT).
Explore related Qiaomu OpenCLI Skills
mainThe following specialized skills are available to extend the capabilities of OpenCLI:
- opencli-browser: Provides browser automation for AI agents, enabling them to navigate, click, type, and extract data via Chrome.
- opencli-explorer: A comprehensive guide and toolset for creating new adapters, covering API discovery, authentication strategies, and TypeScript implementation.
- opencli-oneshot: A streamlined 4-step template designed for quickly adding a single command from a specific URL.
- opencli-autofix: A utility to automatically repair broken adapters when command executions fail.
Use the qiaomu-smart-search skill for intelligent routing
mainThe
qiaomu-smart-searchskill acts as an intelligent router that directs queries to the best availableopenclisearch sources based on the topic and scenario. It is designed for searching, querying, or researching information across websites, social media, technical documentation, news, shopping, travel, finance, or Chinese-language content.Core Workflow:
- Identify Data Sources: Instead of relying on hardcoded commands, use
openclito discover real-time capabilities. - Route Queries:
- If a user specifies a site/platform, use that site directly.
- If no site is specified, select exactly one AI source (
grok,doubao, orgemini). - If the AI response is insufficient or requires authoritative/vertical data, supplement with 1-2 specialized sources.
- Report Results: Every query must end with a "Search Summary" (搜索摘要) detailing the sites used, queries performed, and counts.
搜索摘要 - 网站:<site1> | 查询词:<term1> | 次数:<n> - 网站:<site2> | 查询词:<term2>;<term3> | 次数:<n> - 已跳过:<site3>,原因:达到频率上限- Identify Data Sources: Instead of relying on hardcoded commands, use
Use shopping skills for product search and price comparison
mainThe shopping skills in Qiaomu OpenCLI allow you to search for products, compare prices, find deals, check reviews, and retrieve results from regional e-commerce platforms.
Available platforms include:
amazon: Global product search, price references, and English-language e-commerce.smzdm: Domestic (China) deals, discounts, shopping guides, and product discussions.coupang: South Korean e-commerce product search.douban: Supplementary reviews for books, movies, and music to aid consumer decision-making.
Select the appropriate AI source
mainWhen no specific website is requested, choose exactly one of the following AI sources based on the context:
grok: Best for real-time discussions, English-language internet discourse, Twitter/X context, and trending topics.doubao: Best for Chinese-language contexts, ByteDance/Douyin ecosystem, lifestyle content, and Chinese trending topics/Q&A.gemini: Best for global web content, English-language documentation, general information retrieval, and background summaries.
Constraint: Once an AI source has been queried for a specific problem, do not re-query it with different keywords. If the answer is insufficient, supplement with specialized sources instead.
Heuristics for Advanced API Discovery
mainIf automated exploration fails, use these high-priority heuristics to find APIs:
- Suffix Probing (
.json): Try adding.jsonto the URL (e.g.,/r/all.jsonon Reddit) to access clean REST data. - Global State Extraction (
__INITIAL_STATE__): For SSR sites (e.g., Xiaohongshu, Bilibili), usepage.evaluate('() => window.__INITIAL_STATE__')to grab the full data tree from the window object. - Active Interaction: Manually click buttons (e.g., "Expand All", "CC") via
evaluateto trigger hidden Network Fetches. - Framework Store Interception: For Vue + Pinia sites, call Store Actions directly to bypass complex authentication/signing.
- XHR/Fetch Interception: As a last resort, use TypeScript adapters for non-intrusive request capturing.
- Suffix Probing (
Understand OpenCLI Authentication Levels
mainOpenCLI uses a 5-level authentication system to access different types of data and services:
- public: Public APIs that require no authentication.
- cookie: Reuses existing browser cookies (the most common method for web scraping/automation).
- header: Requires an API Token passed in the request header.
- intercept: Intercepts requests to capture necessary tokens.
- ui: Uses Chrome DevTools Protocol (CDP) to control desktop applications directly.
Choose the right Strategy for adapters
mainWhen writing an adapter in
~/.opencli/clis/, select the appropriateStrategybased on how you access data:Strategy When to use browser:settingStrategy.PUBLICUsing a public API, no auth required falseStrategy.COOKIENeeds existing login cookies/session trueStrategy.UIDirect DOM interaction/scraping trueNote: Always prefer
Strategy.PUBLIC(API) overStrategy.UI(DOM) if an API is available.// Example Strategy.PUBLIC implementation import { cli, Strategy } from '@jackwener/opencli/registry'; cli({ site: 'hn', name: 'top', strategy: Strategy.PUBLIC, browser: false, // ... });Use the Intercept Strategy for complex sites (Pinia/XHR)
mainFor sites that use complex JavaScript logic, XHR signatures, or state management like Pinia (e.g., Xiaohongshu), use
Strategy.INTERCEPT.Instead of trying to replicate complex request signatures, you can use
page.installInterceptor(pattern)to hijack the site's ownXMLHttpRequestorfetchcalls.Workflow:
- Set
strategy: Strategy.INTERCEPTandbrowser: true. - Navigate to the target page and wait for loading.
- Call
await page.installInterceptor('url_pattern')to start listening for specific requests. - Trigger the request by interacting with the page (e.g.,
page.autoScroll()or calling a Pinia store action viapage.evaluate()). - Retrieve the captured data using
await page.getInterceptedRequests().
import { cli, Strategy } from '@jackwener/opencli/registry'; cli({ site: 'xiaohongshu', name: 'notifications', description: '小红书通知', domain: 'www.xiaohongshu.com', strategy: Strategy.INTERCEPT, browser: true, args: [ { name: 'type', type: 'str', default: 'mentions' }, { name: 'limit', type: 'int', default: 20 }, ], columns: ['rank', 'user', 'action', 'content', 'note', 'time'], func: async (page, kwargs) => { await page.goto('https://www.xiaohongshu.com/notification'); await page.wait(3); // Install interceptor for specific URL pattern await page.installInterceptor('/you/'); // Trigger API via Pinia store action await page.evaluate(`(async () => { const app = document.querySelector('#app')?.__vue_app__; const pinia = app?.config?.globalProperties?.$pinia; const store = pinia?._s?.get('notification'); if (store?.getNotification) { await store.getNotification('${kwargs.type}'); } })()`); const requests = await page.getInterceptedRequests(); if (!requests?.length) return []; let results: any[] = []; for (const req of requests) { const items = req.data?.data?.message_list || []; results.push(...items); } return results.slice(0, kwargs.limit).map((item, i) => ({ rank: i + 1, user: item.user_info?.nickname || '', action: item.title || '', content: item.comment_info?.content || '', })); }, });- Set
Use Social Media skills for original content and discussions
mainThe Social Media skills are designed for scenarios where you need original posts, original user results, or community discussions in either Chinese or English. Use these skills when an AI provides only a summary and you require the actual source posts to verify information or dive deeper into specific platform discussions.Routing logic for technical search queries
mainWhen using the OpenCLI skills, you can optimize your results by selecting the appropriate source based on the user's intent. Use the following routing logic to decide which skill to invoke:
- Research/Papers: If the query mentions "papers" (论文) or "research" (研究), prioritize
arxiv. - Code/Errors: If the query mentions "errors" (报错) or "API usage" (API 怎么用), prioritize
stackoverflow. - Community/Opinions: If the query seeks "community discussion" (社区讨论) or "developer opinions" (开发者观点), prioritize
hackernewsorreddit. - General/Fallback: If no specific site is mentioned, start with general models like
geminiorgrok. If the information provided by those models is insufficient, supplement the results using the specialized technical sources listed above.
- Research/Papers: If the query mentions "papers" (论文) or "research" (研究), prioritize
Determine the correct authentication strategy
mainChoose your
Strategybased on how easily the API can be called via afetchrequest in the browser console:Result of fetch(url)Strategy Implementation Detail Works directly Strategy.PUBLICUse browser: falseWorks with {credentials: 'include'}Strategy.COOKIEUse func()patternWorks with Bearer/CSRF headers Strategy.HEADERUse TS func()Fails via fetchbut works on pageStrategy.INTERCEPTUse installInterceptor