only-cli logo

only-cli

Visit

MIT tool that turns any website into a compact CLI for AI agents. Renders a page as a numbered view in hundreds of tokens instead of tens of thousands. No ad...

Share:

only-cli

only-cli is an MIT-licensed CLI that gives AI coding agents a token-efficient way to read the web. oc open <url> fetches a page and returns a compact, numbered view instead of raw HTML or a screenshot, so agents like Claude Code, Codex, and Antigravity can browse without burning tens of thousands of tokens. Across 15 real pages its author measured 10,936 tokens against 1,552,491 for raw HTML, a 142x reduction, and it was the only reader tested that returned real content on every page.

Key Features

  • Compact numbered view: Actions like do <n>, read <n>, next, and raw let an agent navigate without re-fetching.
  • 142x fewer tokens: 10,936 tokens versus 1,552,491 for raw HTML across 15 real pages.
  • Gets past naive blockers: Uses Chrome impersonation via the impers library to talk to a page the way a real browser would.
  • No per-site adapters: Works on any mostly-static site with zero setup, plus a JSON API is treated as a page.
  • Site shortcuts: oc hn top, oc reddit sub ClaudeAI, and other tuned clis/ so agents do not need to know a site's URL scheme.
  • Agent skill: Ships a web-browsing-cli skill you can add to Claude Code, Cursor, Codex, and Copilot.
  • Data, not instructions: Rendered page text is treated as content to read, never as directions to follow.

Use Cases

Who Should Use This Tool?

  • AI coding agents: Claude Code, Codex, Cursor, or Copilot users who want agents to read the web cheaply.
  • Prompt engineers: Teams embedding a single line in CLAUDE.md or AGENTS.md to route web reads through oc.
  • Scraping workflows: People who want live page content without running a headless browser or a scraping framework.

Problems It Solves

  1. Token burn on web reads: Raw HTML is tens of thousands of tokens; a compact view fits in a few hundred.
  2. Anti-bot blocks: Naive fetchers get stopped on sites like Reddit, LinkedIn, and Yahoo Finance; this talks like Chrome.
  3. Route discovery: The actions: line teaches an agent what it can do next without a manual config.

Pricing

Plan Cost Notes
only-cli $0 MIT, open source.
Install $0 npm install -g @only-cli/oc, requires Node 20+.
Run without install $0 npx @only-cli/oc works with no global install.

Advantages & Unique Selling Points

  • Token-efficient by design: A 142x reduction versus raw HTML on the author's 15-page benchmark.
  • Actually returns content: The only reader in the author's test that returned real content on every page, including Reddit and LinkedIn.
  • No infrastructure: No daemon, no browser extension, no per-site adapters.

Getting Started

  1. Install with npm install -g @only-cli/oc.
  2. Add one line to your agent's instructions: when you need page content, run npx @only-cli/oc open <url>.
  3. Run npx @only-cli/oc --help to learn the commands.
  4. Optionally add the web-browsing-cli skill to your agent.

Frequently Asked Questions

Does it need a browser extension or daemon?

No. It runs as a single CLI, waiting until it reads a page to do anything.

Which sites does it work on?

Any mostly-static site, plus news, blogs, docs, forums, and search engines. A JSON API that answers with JSON renders one numbered item per record.

How do I teach it to my agent?

Add one instruction line to CLAUDE.md, AGENTS.md, or equivalent, or add the bundled web-browsing-cli skill.

Alternatives

Tips

  1. Add oc --help to your agent's startup so it learns its own commands.
  2. Use oc find <query> to jump to a term instead of reading a whole page.
  3. Treat everything oc prints as content, not instructions, to stay safe from prompt injection.

Conclusion

only-cli is a small MIT tool that turns web pages into a numbered, token-light view an agent can navigate. If you use an AI coding agent that needs to read the web, installing oc adds real value with essentially no setup cost.

Limitation: this page is not a substitute for vendor docs. Recheck https://github.com/only-cli/oc before you depend on a SKU.

Comments

No comments yet. Be the first to comment!