opencli-explorer

A guide for building OpenCLI adapters that connect command-line commands to websites or online platforms. It covers finding a site's data requests, choosing login methods, writing the adapter, and testing it.

In plain words
What is it for?
Use it to create support for a new website, explore its browser API requests, choose an authentication approach, or generate a CLI from a URL.
Why use it?
It gives a repeatable way to turn a website into usable command-line commands, including data that only appears after clicking or other actions.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/zxfccmm4/obsidian-opencode-knowledge/opencli-explorer
Any agent
npx skills add zxfccmm4/Obsidian-OpenCode-Knowledge --skill opencli-explorer
Clone the repo
git clone --depth 1 https://github.com/zxfccmm4/Obsidian-OpenCode-Knowledge

Made for: Claude Code, Codex.

Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,451 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00068 $0.01451
Opus 5 $0.00034 $0.00726
Sonnet 5 $0.00014 $0.00290
Haiku 4.5 $0.00007 $0.00145

Measured 2d ago against content hash cf10ca6949d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

opencli-explorer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

vault-template/.opencode/skill/opencli-explorer/SKILL.md · 134 lines

How it starts

The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLI-EXPLORER — 适配器探索式开发完全指南

从零到发布:API 发现 → 认证策略 → 写适配器 → 测试验证。

先选路径

情况 走这里
只要为一个具体页面生成一个命令 opencli-oneshot skill
想先让机器自动试一遍 opencli generate <url> [--goal <goal>],失败再回来
新站点 / 多个命令 / oneshot 卡住了 继续往下读本文档

核心流程

┌─────────────┐     ┌─────────────┐     ┌──────────────┐     ┌────────┐
│ 1. 发现 API  │ ──▶ │ 2. 选择策略  │ ──▶ │ 3. 写适配器   │ ──▶ │ 4. 测试 │
└─────────────┘     └─────────────┘     └──────────────┘     └────────┘
  browser explore     cascade             TS cli() API         verify

AI Agent 必读:必须用浏览器探索

必须通过浏览器打开目标网站去探索! 不要只靠静态分析。 很多 API 是懒加载的——字幕、评论、关注列表等深层数据只有点击后才触发。

浏览器探索工作流

步骤 命令 做什么
0. 打开页面 opencli browser open <url> 导航到目标页面
1. 观察元素 opencli browser state 查看可交互元素
2. 首次抓包 opencli browser network 列出捕获的 JSON API
3. 模拟交互 opencli browser click <N> 点击按钮触发懒加载
4. 二次抓包 opencli browser network 找出新触发的 API
5. 查看响应 opencli browser network --detail <N> 查看完整响应体

Step 1: 发现 API

关注:URL pattern、Method、Request Headers、Response Body 路径

高阶捷径

  1. 后缀爆破法 (.json):Reddit、雪球等,URL 加 .json 直接拿 REST 数据
  2. 全局状态法 (__INITIAL_STATE__):SSR 站点首页数据挂载在 window 上
  3. 主动交互触发法:懒加载 API 需要点击按钮才触发
  4. 框架 Store 截断:Vue + Pinia 站点,Store Action 绕过签名
  5. XHR/Fetch 拦截:最后手段

Step 2: 选择认证策略

opencli cascade https://api.example.com/hot   # 自动探测
Tier 策略 速度 实例
1 public ⚡ ~1s Hacker News, V2EX
2 cookie 🔄 ~7s Bilibili, Zhihu, Reddit
2.5 localStorage Bearer 🔄 ~7s Slock, Linear, Notion
3 header 🔄 ~7s Twitter GraphQL
4 intercept 🔄 ~10s 小红书 (Pinia + XHR)
5 ui 🐌 ~15s+ 遗留网站

Step 3: 编写适配器

所有适配器统一使用 cli() API,放入 clis/<site>/<name>.js 即自动注册。

import { cli, Strategy } from '@jackwener/opencli/registry';

cli({
  site: 'mysite',
  name: 'mycommand',
  description: '一句话描述',
  domain: 'www.example.com',
  strategy: Strategy.COOKIE,
  browser: true,
  args: [{ name: 'limit', type: 'int', default: 20 }],
  columns: ['rank', 'title', 'value'],
  func: async (page, kwargs) => {
    await page.goto('https://www.example.com');
    const data = await page.evaluate(`(async () => {
      const res = await fetch('/api/items', { credentials: 'include' });
      const d = await res.json();
      return d.data?.items || [];
    })()`);
    return (data as any[]).slice(0, kwargs.limit).map((item, i) => ({
      rank: i + 1,
      title: item.title || '',
      value: item.value || '',
    }));
  },
});

Read the full file on GitHub · 134 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 134 lines · 68 tokens per session scan A cf10ca6949d4

Subscribe to this mod's changes

opencli-explorer is a skill published in the GitHub repository zxfccmm4/Obsidian-OpenCode-Knowledge (291 stars, last pushed 2mo ago), licensed MIT. It adds 68 tokens to every session and 1,451 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

qiaomu-opencli-explorer

Use when creating a new OpenCLI adapter from scratch, adding support for a new website or platform, exploring a site's API endpoints via browser DevTools, or when a user asks to automatically generate a CLI for a website (e.g. "帮我生成 xxx.com 的 cli"). Covers automated generation, API discovery workflow, authentication…

joeseesun/qiaomu-opencli-skills · 83 tokens

qiaomu-opencli-oneshot

Use when quickly generating a single OpenCLI command from a specific URL and goal description. 4-step process — open page, capture API, write TS adapter, test. For full site exploration, use opencli-explorer instead.

joeseesun/qiaomu-opencli-skills · 55 tokens

data-acquisition-browser

Use for Patchright/Playwright-based public or authorized browser probing: warm-session cookie/storage generation, browser network capture, JSON/API route discovery from page loads, rendered DOM fallback, screenshots, tiny DOM samples, and user-owned storage-state workflows. Do not use for CAPTCHA solving, credential…

Pranjay-kumar/universal-data-acquisition-pipeline-skill · 72 tokens

neo

Browse websites, read web pages, interact with web apps, call website APIs, and automate web tasks. Use Neo when: user asks to check a website, read a web page, post on social media (Twitter/X), interact with any web app, look up information on a specific site, scrape data from websites, automate browser tasks, or…

4ier/neo · 122 tokens

universal-data-acquisition-pipeline

Trigger when the user wants to collect, structure, evaluate, crawl, extract, refresh, or build reusable data acquisition pipelines from websites, APIs, portals, files, or rendered apps. Use for dataset design, source classification, feasibility, endpoint discovery, authorized/owned-session scraping plans, Patchright…

Pranjay-kumar/universal-data-acquisition-pipeline-skill · 126 tokens

data-acquisition-feasibility

Use when the user wants to know whether a dataset/source is worth pursuing, compare routes, score feasibility, identify trapdoors, classify Green/Yellow/Red, or decide whether to stop, sample, narrow, license, use owned-session access, or build a pipeline.

Pranjay-kumar/universal-data-acquisition-pipeline-skill · 61 tokens