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, andrawlet 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
imperslibrary 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 tunedclis/so agents do not need to know a site's URL scheme. - Agent skill: Ships a
web-browsing-cliskill 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
- Token burn on web reads: Raw HTML is tens of thousands of tokens; a compact view fits in a few hundred.
- Anti-bot blocks: Naive fetchers get stopped on sites like Reddit, LinkedIn, and Yahoo Finance; this talks like Chrome.
- 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
- Install with
npm install -g @only-cli/oc. - Add one line to your agent's instructions: when you need page content, run
npx @only-cli/oc open <url>. - Run
npx @only-cli/oc --helpto learn the commands. - Optionally add the
web-browsing-cliskill 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
- Agent Browser: A different approach to agentic web browsing.
- Chrome DevTools MCP: Browser control via MCP for debugging and automation.
- Firecrawl: Scraping service that converts pages to LLM-ready markdown.
Tips
- Add
oc --helpto your agent's startup so it learns its own commands. - Use
oc find <query>to jump to a term instead of reading a whole page. - Treat everything
ocprints 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!
Related Tools
Junie (JetBrains)
junie.jetbrains.com
JetBrains' LLM-agnostic AI coding agent that ships code from your terminal, IDE, or CI/CD pipeline, with bring-your-own-key model support.
OpenSkills
github.com/openskills-ai/openskills
A universal skills loader that gives AI coding agents cross-platform skill sharing, installation, and usage, with installs from multiple sources.
Aider
aider.chat
Open-source terminal pair programmer. Apache-2.0 and BYOK. You pay the model API, not an Aider seat.
Related Insights
Skills + Hooks + Plugins: How Anthropic Redefined AI Coding Tool Extensibility
An in-depth analysis of Claude Code's trinity architecture of Skills, Hooks, and Plugins. Explore why this design is more advanced than GitHub Copilot and Cursor, and how it redefines AI coding tool extensibility through open standards.
Stop Cramming AI Assistants into Chat Boxes: Clawdbot Picked the Wrong Battlefield
Clawdbot is convenient, but putting it inside Slack or Discord was the wrong design choice from day one. Chat tools are not for operating tasks, and AI isn't for chatting.
What Locks Codex Is the Picker, Not the Models
You already pay for OpenCode Go, Grok, and Z.ai, but the Codex picker still shows mostly GPT. The community project codex-router does not teach another install ritual. It puts subscriptions you already bought back into the selector, keeps keys on the machine, and leaves native GPT alone.