
opencli-generate
Use when a user asks to automatically generate a CLI command for a website. Takes a URL and optional goal, runs the full verified generation pipeline (explore, synthesize, cascade, verify), and returns a structured outcome. This is the primary entry point for "帮我生成 xxx.com 的 cli".
- Installs
- 67
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/jackwener/opencli --skill opencli-generate- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads opencli-generate automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
CLI-GENERATE — Verified CLI Generation Skill
One-shot automated CLI generation: give a URL, get a verified command or a structured explanation of why not.
When to Use This Skill
- User says "帮我生成 xxx.com 的 cli" or similar
- User wants to add a website to opencli automatically
- User provides a URL and expects a working CLI command
Not for: manual API exploration (use opencli-explorer), single-page quick generation (use opencli-oneshot), or browser-based debugging (use opencli-operate).
Input
| Field | Required | Type | Description |
|---|---|---|---|
url | Yes | string | Target website URL |
goal | No | string | Natural language intent hint (e.g. "热榜", "搜索", "最新帖子") |
goal is a user-intent hint, not a command name, capability schema, or execution parameter.
How to Invoke
opencli generate <url> [--goal <goal>] [--format json]
The skill calls generateVerifiedFromUrl internally. The agent does not need to know about explore, synthesize, cascade, or verify stages.
Output: SkillOutput
interface SkillOutput {
// Machine-readable decision fields (agent uses these for routing)
conclusion: 'success' | 'blocked' | 'needs-human-check';
reason?: StopReason | EscalationReason;
suggested_action?: SuggestedAction;
reusability?: Reusability;
// Structured data
command?: string; // e.g. "demo/hot"
strategy?: string; // "public" | "cookie"
path?: string; // YAML artifact path
// Human-readable summary (agent can relay to user directly)
message: string;
}
Decision Language (shared with code layer)
StopReason (blocked):
no-viable-api-surface— site has no discoverable JSON APIsauth-too-complex— all endpoints require auth beyond PUBLIC/COOKIEno-viable-candidate— APIs found but no valid CLI candidate synthesizedexecution-environment-unavailable— browser not connected
EscalationReason (needs-human-check):
empty-result— pipeline ran but returned nothingsparse-fields— result has too few populated fieldsnon-array-result— result is not an arrayunsupported-required-args— candidate needs args we can't auto-filltimeout— execution timed outselector-mismatch— DOM/JSON path didn't matchverify-inconclusive— catch-all for ambiguous verify failures
SuggestedAction (what to do next):
stop— nothing more to tryinspect-with-operate— use opencli-operate skill to debugask-for-login— user needs to log in firstask-for-sample-arg— user needs to provide a real argument valuemanual-review— general human review needed
Reusability (is the artifact worth keeping?):
verified-artifact— fully verified, can be used directlyunverified-candidate— candidate exists but not verifiednot-reusable— nothing worth keeping
Decision Tree
Input: url + goal?
|
v
Call generateVerifiedFromUrl(url, goal)
|
v
Receive GenerateOutcome
|
+-- status = 'success'
| conclusion: 'success'
| reusability: 'verified-artifact'
| command: outcome.adapter.command
| strategy: outcome.adapter.strategy
| path: outcome.adapter.path
| message: "已生成 {command},可直接使用 (策略: {strategy})"
| → END
|
+-- status = 'blocked'
| conclusion: 'blocked'
| reason: outcome.reason
| message: (see message templates below)
| → END
|
+-- status = 'needs-human-check'
conclusion: 'needs-human-check'
reason: outcome.escalation.reason
suggested_action: outcome.escalation.suggested_action
reusability: outcome.reusability
path: outcome.escalation?.candidate?.path (optional, only when reusable candidate exists)
message: (see message templates below)
→ END (upper-level agent decides next step)
Message Templates
| conclusion | reason | message |
|---|---|---|
success | — | "已生成 {command},可直接使用。策略: {strategy}" |
blocked | no-viable-api-surface | "该站点没有发现可用的 JSON API 接口,无法自动生成 CLI" |
blocked | auth-too-complex | "所有接口都需要超出自动化能力的认证方式(如 signature/bearer),无法自动生成" |
blocked | no-viable-candidate | "发现了 API 接口,但未能合成有效的 CLI 候选" |
blocked | execution-environment-unavailable | "浏览器未连接,请先运行 opencli doctor 检查环境" |
needs-human-check | unsupported-required-args | "候选需要参数 {args},请提供示例值后重试" |
needs-human-check | empty-result | "候选验证返回空结果,建议用 opencli-operate 检查" |
needs-human-check | sparse-fields | "候选验证结果字段不足,建议人工检查" |
needs-human-check | non-array-result | "返回结果不是数组格式,建议用 opencli-operate 检查接口返回结构" |
needs-human-check | timeout | "验证超时,建议用 opencli-operate 手动检查接口响应" |
needs-human-check | selector-mismatch | "数据路径不匹配,建议用 opencli-operate 检查实际返回结构" |
needs-human-check | verify-inconclusive | "验证结果不确定,候选已保存在 {path},需要人工审查" |
Guardrails
-
Skill does not orchestrate internal pipeline stages. It does not decide whether to explore, synthesize, cascade, or verify. That is the code layer's job.
-
Skill does not auto-escalate to operate. When
needs-human-check, skill reports the recommendation but does not automatically invokeopencli-operate. The upper-level agent decides. -
No new taxonomy. All
reason,suggested_action,reusabilityvalues are shared with the code layer (GenerateOutcome). Skill does not invent new status words. -
Machine-readable fields are the contract;
messageis just a summary. Callers must not parsemessagefor decision-making. -
goalis a natural language intent hint. Not a command name, not a capability schema, not an execution parameter.
Relationship to Other Primitives
P1: Terminal Contract (GenerateOutcome)
- Skill's single source of truth for final decisions
- Skill maps
GenerateOutcome→SkillOutput(thin translation, no re-orchestration)
P2: Early-Hint Contract (EarlyHint)
- Lives inside the orchestrator, transparent to skill
- Drives early exit (cost optimization) before verify stage
- Skill does not consume
EarlyHintdirectly in v1 - May be exposed as optional progress channel in future versions
v1 Scope
- JSON API + PUBLIC/COOKIE auth + structured array result + read-only list-like capabilities
- Single browser session lifecycle (probe + verify share one session)
- Bounded repair: only itemPath relocation, one attempt
FAQ
What does the opencli-generate skill do?
Use when a user asks to automatically generate a CLI command for a website. Takes a URL and optional goal, runs the full verified generation pipeline (explore, synthesize, cascade, verify), and returns a structured outcome. This is the primary entry point for "帮我生成 xxx.com 的 cli".
How do I install opencli-generate?
Run npx skills add https://github.com/jackwener/opencli --skill opencli-generate in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/opencli-generate/ (personal) or .claude/skills/opencli-generate/ (project).
Which AI agents can use opencli-generate?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is opencli-generate safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains opencli-generate?
It is published by jackwener in jackwener/opencli. It has 67 recorded installs.
More from jackwener/opencli
opencli-usage
jackwener/opencli
Discover and invoke OpenCLI capabilities for websites and Chrome. Find commands, inspect schemas, interpret results and choose browser or adapter tools.
opencli-browser
jackwener/opencli
Drive Chrome with OpenCLI to inspect pages, interact with logged-in sites, capture API evidence, and manage native tabs, groups and windows. For reusable adapters, see opencli-adapter-author.
opencli-autofix
jackwener/opencli
Automatically fix broken OpenCLI adapters when commands fail. Load this skill when an opencli command fails — it guides you through collecting a trace artifact, patching the adapter, retrying, and filing an upstream GitHub issue after a verified fix. Works with any AI agent.
smart-search
jackwener/opencli
基于 opencli 命令的智能搜索路由器。当用户想要使用 OpenCLI、CLI 或 API 搜索、查询、查找或研究信息时,尤其是涉及指定网站、社交媒体、技术资料、新闻、购物、旅游、求职、金融或中文内容时,务必使用此 skill
opencli-adapter-author
jackwener/opencli
Build or improve an OpenCLI JS adapter using observed site behavior, existing adapters and browser API evidence. For ad-hoc browser interaction, see opencli-browser.
opencli-browser-sitemap
jackwener/opencli
Use when driving a website with opencli browser and sitemap context is available, requested, or needed to avoid blind navigation. Guides agents to consume site sitemap files lazily, choose adapter/browser fallback paths, resume from state signatures, and mark stale sitemap entries without trusting them over live browser state.
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.