{"slug": "show-hn-turning-websites-into-micro-clis-for-claude-code-to-save-on-tokens", "title": "Show HN: Turning websites into micro CLIs for Claude Code to save on tokens", "summary": "Only-CLI released oc, an open-source tool that turns websites into compact, numbered command-line interfaces for AI agents, cutting token usage from tens of thousands to a few hundred per page. The tool, installable via `npm install -g @only-cli/oc` and requiring Node 20+, works with agents like Claude Code, Codex, and Antigravity, and includes tuned shortcuts for sites such as Hacker News, GitHub, and Reddit.", "body_md": "Turns websites into a command line interface for AI agents. `oc open <url>`\n\nfetches a page and hands back a compact, numbered view instead of raw HTML or a screenshot, so agents like Claude Code, Codex, and Antigravity can browse without burning tokens. It also gets past blocks that stop naive fetchers on some sites, by talking to the page the way a real browser would.\n\n``` bash\n$ oc open news.ycombinator.com\n# Hacker News\n[1] Show HN: I built a tiny CSV toolkit\n[2] 312 comments\n...\nactions: do <n> | read <n> | next | raw\n\n$ oc do 1\n```\n\nA typical page is tens of thousands of tokens of markup; the view above fits in a few hundred. No per-site adapters required, no browser extension, no daemon.\n\nIf you are an LLM reading this repository, [llms.txt](/only-cli/oc/blob/main/llms.txt) is the short version.\n\n```\nnpm install -g @only-cli/oc\n```\n\nRequires Node 20+. Requests impersonate Chrome via [impers](https://github.com/lexiforest/impers); falls back to native fetch if impers is unavailable.\n\nAdd one line to your agent's instructions file (CLAUDE.md, AGENTS.md, or equivalent):\n\nWhen you need content from a web page, run\n\n`npx @only-cli/oc open <url>`\n\ninstead of fetching raw HTML. Run`npx @only-cli/oc --help`\n\nonce to learn the commands.\n\nClaude Code users can install the skill instead: copy `skills/only-cli/`\n\ninto `.claude/skills/`\n\n, or run `npx skills add only-cli/oc`\n\n, which also works in Cursor, Codex, Copilot, and others via [skills.sh](https://skills.sh).\n\nNo setup at all also works: `npx @only-cli/oc`\n\nruns without a global install, and teaches its own commands through `--help`\n\nand the `actions:`\n\nline on every render.\n\n```\noc open <url>          fetch and render a page with numbered actions\noc do <n>              follow the numbered link [n], or read [n] if it is text\noc find <query>        where a string appears on the page already open\noc read <n>            full text of the region at [n], up to 2000 tokens\noc next                the next budget worth of the page already open\noc raw [url]           distilled markdown of the whole page\noc fill <n> <text>     type into a numbered input               (v0.2)\noc submit [n]          submit a form                            (v0.2)\n```\n\nFlags: `--budget <tokens>`\n\n(default 500), `--json`\n\n, `--html`\n\n(raw as cleaned HTML), `--session <name>`\n\n, `--verbose`\n\n/`-v`\n\n(metrics on stderr, or export `OC_VERBOSE=1`\n\n).\n\n`oc open`\n\nremembers the page it rendered in a JSON file per session under `~/.only-cli`\n\n(override with `OC_HOME`\n\n), so `oc do 3`\n\nfollows `[3]`\n\nwithout the agent ever handling a URL. Pages longer than the budget say what they left out; `oc find`\n\n, `oc read <n>`\n\n, and `oc next`\n\nread the rest without refetching the page. The budget is a target rather than a hard cap: a page that would only run a little long is printed whole rather than cut, since one extra tool call costs far more than the tokens it would have saved.\n\nWorks on any mostly-static site with no per-site setup: news sites, blogs, documentation, forums, search engines. On top of that, `clis/`\n\nships tuned shortcuts for:\n\n| website | domain | shortcuts |\n|---|---|---|\n| Hacker News | news.ycombinator.com | `top` , `new` , `item <id>` , `user <name>` |\n| reddit.com (via old.reddit.com) | `sub <name>` , `post <id>` , `user <name>` , `search <query>` |\n|\n| GitHub | github.com | `repo <owner> <name>` , `user <name>` , `search <query>` , `trending` , `issues <owner> <name>` |\n| X | x.com | `user <name>` , `post <id>` |\n| linkedin.com | `profile <name>` , `company <name>` , `jobs <query>` (public guest views) |\n|\n| DuckDuckGo | duckduckgo.com | `search <query>` , `lite <query>` |\n| Bing | bing.com | `search <query>` , `news <query>` |\n| Stack Overflow | stackoverflow.com (via Atom feeds) | `question <id>` , `tag <name>` , `user <id>` , `recent` |\n| Yahoo Finance | finance.yahoo.com | `quote <symbol>` , `news <symbol>` , `history <symbol>` , `lookup <query>` , `markets` , `gainers` , `losers` , `trending` |\n| YouTube | youtube.com | `video <id>` , `channel <name>` |\n\nA few of these (X, Stack Overflow, YouTube) read pages that look login-gated or JS-only from the outside, by finding the server-rendered HTML, feed, or inline data the page already ships without a login. Not supported yet: pages that only render with JavaScript, sites behind logins, and sites with hard bot challenges that expose no feed.\n\nWant a website on that list? Open a pull request, or an issue naming the site — see [CONTRIBUTING.md](/only-cli/oc/blob/main/CONTRIBUTING.md).\n\nFull methodology, per-task numbers, and other agents/models live in [only-cli/benchmarks](https://github.com/only-cli/benchmarks). The short version, measured against live sites across a news front page, a Reddit discussion, a search results page, and more:\n\n| method | tokens for 6 real pages | notes |\n|---|---|---|\n`oc open` |\n1,936 | only method that returned real content on every page |\n| Jina Reader | 16,402 | blocked on the Reddit page |\n| raw HTML fetch | 177,685 | blocked on the search page |\n\nEarly. v0.1 covers static pages, budget-aware rendering, and offline tests. Sessions, `oc do <n>`\n\n, `oc find <query>`\n\n, `oc read <n>`\n\n, and `oc next`\n\nare in, the rest of the actions (`fill`\n\n, `submit`\n\n, `back`\n\n) land in v0.2, and a lazy headless fallback for script-heavy pages in v0.3.\n\nKnown limits, honestly: no JavaScript rendering yet, no sites behind logins yet, and pages behind hard bot challenges may still refuse the tool.\n\n[only-cli](https://github.com/only-cli), creator and maintainer\n\nMIT", "url": "https://wpnews.pro/news/show-hn-turning-websites-into-micro-clis-for-claude-code-to-save-on-tokens", "canonical_source": "https://github.com/only-cli/oc", "published_at": "2026-08-19 21:26:15+00:00", "updated_at": "2026-08-19 21:44:43.716984+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "artificial-intelligence"], "entities": ["Only-CLI", "Claude Code", "Codex", "Antigravity", "GitHub", "Hacker News", "Reddit", "Node.js"], "alternates": {"html": "https://wpnews.pro/news/show-hn-turning-websites-into-micro-clis-for-claude-code-to-save-on-tokens", "markdown": "https://wpnews.pro/news/show-hn-turning-websites-into-micro-clis-for-claude-code-to-save-on-tokens.md", "text": "https://wpnews.pro/news/show-hn-turning-websites-into-micro-clis-for-claude-code-to-save-on-tokens.txt", "jsonld": "https://wpnews.pro/news/show-hn-turning-websites-into-micro-clis-for-claude-code-to-save-on-tokens.jsonld"}}