PluginBench
Skill
Review
Audit score 70

opencli-usage

jackwener/opencli

Orientation layer for OpenCLI — discover adapters, learn universal flags, and route to specialized skills.

What is opencli-usage?

opencli-usage is the entry point for any OpenCLI session. It explains what OpenCLI does (turn websites and Electron apps into uniform CLI commands), how to discover available adapters and their prerequisites, and which specialized skill to load next. Use this when you need to understand the OpenCLI landscape or find the right command for a task.

  • Discover installed adapters and their strategies (PUBLIC, COOKIE, INTERCEPT, UI, LOCAL) via `opencli list` and `opencli list -f json`
  • Learn universal flags (`-f/--format`, `-v/--verbose`) that work on every adapter command
  • Understand output formats (json, plain, yaml, table, md, csv) and how to choose them for agents vs. humans
  • Route to specialized skills like `opencli-browser` for ad-hoc browser driving or `opencli-adapter-author` for writing custom adapters
  • Check browser bridge health with `opencli doctor` before running COOKIE/INTERCEPT/UI/browser-dependent commands

How to install opencli-usage

npx skills add https://github.com/jackwener/opencli --skill opencli-usage
Prerequisites
  • Node >= 20.18.1 (for global npm install)
  • Chrome with OpenCLI extension installed from Chrome Web Store (only for COOKIE/INTERCEPT/UI adapters and `opencli browser *` commands)
  • Target Electron app running (for desktop app adapters like cursor, discord-app, chatgpt-app)
Claude Code
Cursor
Windsurf
Cline

How to use opencli-usage

  1. 1.Install globally: `npm install -g @jackwener/opencli` or from source with `git clone` + `npm install`
  2. 2.Run `opencli doctor` to verify browser bridge health (daemon, extension, Chrome connectivity)
  3. 3.Run `opencli list` or `opencli list -f json` to discover available adapters and their strategy tags
  4. 4.Run `opencli <site> --help` or `opencli <site> <command> --help` to see available commands and flags for a specific site
  5. 5.Choose an output format with `-f json` (for agents), `-f plain` (for piping), or `-f table` (for humans)
  6. 6.If no adapter exists for your task, load `opencli-browser` skill for ad-hoc browser driving

Use cases

Good for
  • Agent asks 'what can opencli do?' — point here to learn the adapter landscape and strategy tags
  • Need to find a command for a specific site — run `opencli list -f json` or `opencli list | grep <site>`
  • Debugging a failed adapter command — use `--trace retain-on-failure` and follow the repair workflow in `opencli-autofix`
  • Setting up a new OpenCLI environment — run `opencli doctor` to verify browser bridge (daemon, extension, Chrome) before COOKIE/INTERCEPT/UI work
  • Writing a custom adapter — scaffold with `opencli browser init <site>/<command>`, validate with `opencli validate`, verify with `opencli verify`
Who it's for
  • Agents and developers starting an OpenCLI session for the first time
  • Anyone discovering what adapters are available or which strategy tag a command uses
  • Users troubleshooting browser-dependent commands (COOKIE, INTERCEPT, UI, or `opencli browser *`)
  • Adapter authors writing custom commands or plugins

opencli-usage FAQ

What's the difference between PUBLIC, COOKIE, INTERCEPT, UI, and LOCAL strategies?

PUBLIC needs no browser (pure HTTP). COOKIE and INTERCEPT need Chrome logged in + extension; INTERCEPT also opens an automation window. UI needs full DOM interaction. LOCAL talks to a dev endpoint with no browser. Check `opencli list` to see which strategy each command uses.

Do I need `opencli doctor` to pass before running any command?

No. `opencli doctor` only diagnoses the browser bridge (daemon, extension, Chrome wiring). It's required only for COOKIE/INTERCEPT/UI adapters and `opencli browser *` commands. PUBLIC, LOCAL, and plugin commands don't need it.

How do I find the right command for a site?

Run `opencli list -f json` to get machine-readable output, or `opencli list | grep <site>` to filter. Don't hard-code adapter lists — the registry changes weekly. For a specific site, run `opencli <site> --help` to see all commands.

What output format should I use for agent integration?

Use `-f json` (pretty-printed, 2-space indent). For chat-style commands that return a single field, `-f plain` pipes cleanly to other tools. Humans prefer `-f table` (color-coded, grouped by site).

How do I repair an adapter when the site changes?

Re-run the command with `--trace retain-on-failure`. The error includes a `trace` block pointing to `summary.md`. Patch the `adapterSourcePath` and retry. For full guidance, load the `opencli-autofix` skill.

Full instructions (SKILL.md)

Source of truth, from jackwener/opencli.


name: opencli-usage description: Use at the start of any OpenCLI session — this is the top-level map of what opencli can do, how to discover adapters, what flags and output formats are universal, and which specialized skill to load next. Point here when an agent asks "what can opencli do?" or "how do I find the right command?". allowed-tools: Bash(opencli:*), Read

opencli-usage

OpenCLI turns websites and Electron desktop apps into a uniform opencli <site> <command> surface that agents can drive without screen-scraping. This skill is the orientation layer — once you know what you want to do, load one of the specialized skills below.

Main capabilities

  • Adapter commands — opencli <site> <command> [...]. Built-in adapters live in clis/, user adapters in ~/.opencli/clis/. Each is backed by a strategy (PUBLIC | COOKIE | INTERCEPT | UI | LOCAL) that tells you whether a Chrome session is needed.
  • Browser driving — opencli browser * subcommands (open, state, click, type, select, find, extract, network, …) for ad-hoc interaction and scraping when no adapter covers the task. See opencli-browser.
  • Current-tab binding — opencli browser <session> bind attaches the Chrome tab the user already opened/logged into to that browser session. Follow-up commands use opencli browser <session> .... See opencli-browser before using it; bound sessions still block tab mutation.

Install

# npm global
npm install -g @jackwener/opencli          # binary: opencli, requires Node >= 20.18.1
opencli doctor                              # run before browser-dependent work (see below)

# From source
git clone git@github.com:jackwener/OpenCLI.git
cd OpenCLI && npm install
npx tsx src/main.ts <command>               # same surface, no global install

opencli doctor prints a structured DoctorReport — daemon status, extension connection, version checks, and a live browser connectivity probe. Scope is narrow: it diagnoses the browser bridge (daemon + extension + Chrome wiring). PUBLIC / LOCAL adapters, opencli list, validate, verify, and plugin commands don't need it to be green — only COOKIE / INTERCEPT / UI adapters and the opencli browser * subcommands do. Flag: -v (verbose).

Prerequisites by command type

Strategy tag on opencli listWhat it needs
PUBLICNothing — pure HTTP, no browser.
COOKIEChrome logged into the target site + OpenCLI extension installed from the Chrome Web Store. Command captures the credential from your live session — no re-login.
INTERCEPTSame as COOKIE, plus opencli opens an automation window to capture a signed request.
UISame as COOKIE, full DOM interaction.
LOCALNo browser; talks to a local/dev endpoint.

Electron desktop apps (cursor, codex, chatwise, discord-app, doubao-app, antigravity, chatgpt-app) route through CDP against the running app — same cookie-less flow as a logged-in browser. Make sure the app is running before invoking.

Discover what's installed — don't read this file, run a command

opencli list                    # table, grouped by site
opencli list -f json            # machine-readable; pipe to jq or your agent
opencli list | grep -i twitter  # find commands for a specific site
opencli <site> --help           # see that site's commands + flags
opencli <site> <command> --help # see positional args and command-specific flags

Do not hard-code adapter lists — there are 100+ sites and the count moves every week. opencli list -f json is the source of truth; it emits one entry per command with {site, name, aliases, description, strategy, browser, args, columns, ...}. For an agent, that is always better than grepping a doc.

Before falling back to raw opencli browser commands on high-change authenticated sites, check whether a site adapter already exposes the workflow. For example, ChatGPT web has higher-level commands for conversation reads and Deep Research result extraction; discover the current surface with opencli chatgpt --help or opencli list -f json.

Universal flags (work on every adapter command)

flageffect
-f, --format <fmt>table (default in TTY) · yaml (default in non-TTY) · json · plain · md · csv. Pass explicitly when you want a specific shape; agents almost always want -f json.
-v, --verboseDebug logs + stack traces on failure; also sets OPENCLI_VERBOSE=1 for the process.

Command-specific flags (--limit, --tab, --filter, …) are not universal — consult <site> <command> --help.

Output formats

  • json — pretty-printed, 2-space indent. Default choice for agents.
  • plain — prints a single primary field for chat-style commands (response/content/text/value). Useful for piping to another tool.
  • yaml — fallback when output is not a TTY and -f is not explicit.
  • table — color-coded, site-grouped; meant for humans.
  • md, csv — straightforward tabular dumps.

A few commands override the default via cmd.defaultFormat (e.g. chat commands default to plain), so don't assume without reading --help.

Environment variables

variabledefaultpurpose
OPENCLI_BROWSER_CONNECT_TIMEOUT45Seconds to wait for the browser bridge.
OPENCLI_BROWSER_COMMAND_TIMEOUT60Per-command timeout.
OPENCLI_CDP_ENDPOINT—Manual CDP endpoint override (dev / remote Chrome / Electron).
OPENCLI_CACHE_DIR~/.opencli/cacheNetwork capture + browser-state cache.
OPENCLI_WINDOWcommand-specificforeground or background browser window mode.
OPENCLI_VERBOSEfalseVerbose logging (also triggered by -v).

Self-repair

When an adapter command fails because the site changed (selectors drifted, API rotated, response schema shifted), re-run with --trace retain-on-failure. The error envelope includes a trace block pointing at summary.md; patch only the adapterSourcePath from that summary and retry. Max 3 repair rounds. The full flow is in opencli-autofix.

Writing your own adapter

Two-path storage:

  • Private: ~/.opencli/clis/<site>/<command>.js — no build step, hot-available, not visible in the public package.
  • Public / PR: clis/<site>/<command>.js — for upstream contribution; requires build.

Scaffolding & verification:

opencli browser init <site>/<command>   # generates a skeleton
opencli validate [target]               # semantic checks on the loaded registry (description, domain, pipeline step names, func|pipeline|_lazy presence, arg duplicates) — no network, no browser
opencli verify [target] [--smoke]       # run the command with synthetic args
opencli browser verify <site>/<command> # end-to-end smoke inside the bridge

Adapters import only @jackwener/opencli/registry and @jackwener/opencli/errors. columns must align 1:1 (in name and order) with keys of the object returned by func. For the full workflow see opencli-adapter-author.

Plugins

Plugins are third-party extensions pulled from git, separate from the main adapter registry:

opencli plugin install github:user/repo    # install
opencli plugin list [-f json]              # see installed
opencli plugin update [name] | --all       # keep current
opencli plugin uninstall <name>
opencli plugin create <name>               # scaffold a new plugin

Shell completion

opencli completion bash   # also: zsh, fish
# -> script on stdout; source or save per your shell's convention

Where to go next

If you're about to…Load this skill
Drive a live browser ad-hoc (no adapter available, or prototyping)opencli-browser
Write a new adapter, or add a command to an existing siteopencli-adapter-author
Fix a broken adapter after a command failureopencli-autofix
Route a search / lookup / research request to the right adaptersmart-search

Commands that used to exist

The following were removed in the PR #1094 consolidation — don't try to invoke them:

  • opencli explore <url> — superseded by opencli browser network + opencli browser find for live API discovery, and by the opencli-adapter-author workflow for capture.
  • opencli record <url> — removed; manual capture now lives in opencli browser network --detail.
  • opencli web read / opencli desktop * as top-level groups — folded into their respective adapters (opencli web read still exists as the web adapter's read command, but there is no standalone web / desktop top-level group command).

Don't

  • Don't paste this skill's command list into your plan; it will rot. Call opencli list -f json at the start of a task instead.
  • Don't assume every adapter needs a browser — strategy PUBLIC and LOCAL don't. Check the strategy field.
  • Don't silently fall back from a failing adapter to a hand-rolled fetch — --trace retain-on-failure gives you the browser evidence and adapter source path. Do that first.