跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

web-browsing-cli

Token-efficient web browsing and web content extraction for AI agents. Use when reading a URL, browsing websites, checking links, extracting static page content, or replacing raw HTML and browser screenshots.

only-cli · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add only-cli/oc --skill web-browsing-cli

技能说明


name: web-browsing-cli description: Token-efficient web browsing and web content extraction for AI agents. Use when reading a URL, browsing websites, checking links, extracting static page content, or replacing raw HTML and browser screenshots.

only-cli

Renders a web page as a compact, numbered terminal view instead of raw HTML. A typical page is under 500 tokens.

npx --yes @only-cli/oc@0.5.8 open <url>     compact view, numbered elements
npx --yes @only-cli/oc@0.5.8 do <n>         follow link [n], or read it if [n] is text
npx --yes @only-cli/oc@0.5.8 find <query>   where a string appears, or that place itself
                                            when only one matches
npx --yes @only-cli/oc@0.5.8 next           next ~500 tokens of the page already open
npx --yes @only-cli/oc@0.5.8 read <n>       full text of region [n]
npx --yes @only-cli/oc@0.5.8 raw [url]      whole page as markdown (--html for cleaned HTML)
npx --yes @only-cli/oc@0.5.8 login            seed cookies (--cookie, --domain, --expires)
npx --yes @only-cli/oc@0.5.8 logout [session] forget a session: cookies and saved page
npx --yes @only-cli/oc@0.5.8 session ls       list saved sessions (name, url, title)
npx --yes @only-cli/oc@0.5.8 session rm [name] forget a saved session: page and cookies

None of these except open/do/raw <url> fetch anything; they replay the page open already saved.

Site shortcuts

oc <site> <verb> [args] resolves to a URL and then behaves exactly like open on it, so it costs the same and reads the same. It saves guessing a URL shape and, on a few sites, points at the feed or public API that answers without a login. search on py, node, and ruby ranks the docs' own index locally, and on mdn asks the site's API; each prints a normal numbered result page.

oc hn top                      oc reddit sub ClaudeAI          oc gh repo only-cli oc
oc wiki article Eiffel Tower   oc wiki search anthropic        oc wiki lang de Berlin
oc ddg search claude code      oc so question 231767           oc learn doc azure/aks/what-is-aks
oc py library json             oc mdn js Array/map             oc node api fs

Sites: hn, reddit, gh, x, linkedin, ddg, bing, so, yahoo, yt, aws, gcp, learn, wiki, py, mdn, node, ruby, go, rust, java, php, cpp, ts, npm, pip, cargo, gem, docker. Name one by short name, bare name, or domain. The last argument takes every word after it, so a query or title needs no quoting. oc sites lists every site with its verbs, which is cheaper than guessing one. Reddit reads through its Atom feeds: a reddit.com page URL given to open meets a login wall or a 403, so use oc reddit post <id> or add /.rss to the URL, and keep Reddit calls under about ten a minute or the site answers 429.

Prefer a shortcut over a hand-built URL when one exists for the site, and prefer oc wiki article <title> over a search when you already know the article's name.

Output

  • Line 1 is the title, then main content (article/thread/results); nav/sidebar/footer follow after --- rest of page ---, still numbered.
  • --- repeated controls hidden ---: per-item chrome (save/report/reply) dropped as repetitive; raw keeps it.
  • [n] marks a link, button, input, heading, or a text block long enough to be cut.
  • Code blocks arrive as the page wrote them, lines and indentation intact, so a command in one can be run as printed.
  • ... +820 chars: block was cut there; read <n> prints it whole. The cut lands on the end of a sentence, or of a line in code, so what is shown is never half of one.
  • ... 164 more blocks (~7,100 tokens): rest of page past budget: a cost estimate, not a fetch. Omitted when the page would finish only a little over budget; then it's printed whole instead.
  • actions: footer lists valid next commands.

Going further, cheapest first

  • find <query>: every place a string appears, one line + number each. Matches as a phrase (case-insensitive), falling back to separate words; reports how many matches didn't fit. When one place matches, or when the matches all fit, it prints them in full: no read <n> afterwards.
  • read <n>: one region in full: the block at [n] plus a little context, or the whole section for a heading.
  • next: continues the same page from where the budget stopped.
  • raw: everything, ~10x the cost. Use only when you need the whole page, not to hunt for a link's URL (use do for that).

Following links

do <n> opens [n] exactly like open would; numbers then refer to the new page.

  • Numbers come from the most recent render, so re-read the latest output before picking one.
  • [6-9] 4 similar links markers still work despite the collapsed text.
  • Search result links resolve to the destination, not the tracking redirect.
  • do on an input/button reports that instead (typing/submitting not yet supported).
  • do on a heading/text block prints the read instead of refusing, since there's nothing to follow. A heading that is itself a link, which is what a search result title is, opens instead.
  • --session <name> keeps separate page state, for working on two sites at once.

Flags

  • --budget <tokens>: target size (default 500, 2000 for read); not a hard cap, since a page finishing within ~4x it prints whole instead of being cut.
  • --json: machine-stable JSON of the distilled page.
  • --html: with raw, cleaned HTML instead of markdown.
  • --verbose (-v/--stats): stderr metrics: tokens saved, HTTP status, client identity, timing, transfer size, memory. Costs tokens itself, so pass only when diagnosing; OC_VERBOSE=1 turns it on globally.

Proxies

HTTP_PROXY, HTTPS_PROXY, and NO_PROXY are honored automatically: no flag, no setup. An error starting proxy is the network between the machine and the site, not the page. blocked: private or internal URL means the target is private, or does not resolve while a proxy is set.

阅读完整来源 ↗