GitHub - only-cli/oc: Turn any website into a compact CLI tailored for AI agents. Browse the web in hundreds of tokens, not tens of thousands. · GitHub
/" data-turbo-transient="true" />
Skip to content
Search/
Sign in<br>Sign upAppearance settings
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
only-cli
oc
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star<br>53
main
BranchesTags
Go to file
CodeOpen more actions menu
Latest commit
History<br>52 Commits<br>52 Commits
Folders and files<br>NameNameLast commit message<br>Last commit date<br>.github
.github
clis
clis
docs
docs
skills/only-cli
skills/only-cli
src
src
tests
tests
.gitignore
.gitignore
CONTRIBUTING.md
CONTRIBUTING.md
README.md
README.md
llms.txt
llms.txt
package-lock.json
package-lock.json
package.json
package.json
View all files
Repository files navigation
only-cli
Turns websites into a command line interface for AI agents. oc open fetches 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.
| read | next | raw
$ oc do 1">$ oc open news.ycombinator.com<br># Hacker News<br>[1] Show HN: I built a tiny CSV toolkit<br>[2] 312 comments<br>...<br>actions: do | read | next | raw
$ oc do 1
A 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.
If you are an LLM reading this repository, llms.txt is the short version.
Install
npm install -g @only-cli/oc
Requires Node 20+. Requests impersonate Chrome via impers; falls back to native fetch if impers is unavailable.
For AI agents
Add one line to your agent's instructions file (CLAUDE.md, AGENTS.md, or equivalent):
When you need content from a web page, run npx @only-cli/oc open instead of fetching raw HTML. Run npx @only-cli/oc --help once to learn the commands.
Claude Code users can install the skill instead: copy skills/only-cli/ into .claude/skills/, or run npx skills add only-cli/oc, which also works in Cursor, Codex, Copilot, and others via skills.sh.
No setup at all also works: npx @only-cli/oc runs without a global install, and teaches its own commands through --help and the actions: line on every render.
Commands
fetch and render a page with numbered actions<br>oc do follow the numbered link [n], or read [n] if it is text<br>oc find where a string appears on the page already open<br>oc read full text of the region at [n], up to 2000 tokens<br>oc next the next budget worth of the page already open<br>oc raw [url] distilled markdown of the whole page<br>oc fill type into a numbered input (v0.2)<br>oc submit [n] submit a form (v0.2)">oc open fetch and render a page with numbered actions<br>oc do follow the numbered link [n], or read [n] if it is text<br>oc find where a string appears on the page already open<br>oc read full text of the region at [n], up to 2000 tokens<br>oc next the next budget worth of the page already open<br>oc raw [url] distilled markdown of the whole page<br>oc fill type into a numbered input (v0.2)<br>oc submit [n] submit a form (v0.2)
Flags: --budget (default 500), --json, --html (raw as cleaned HTML), --session , --verbose/-v (metrics on stderr, or export OC_VERBOSE=1).
oc open remembers the page it rendered in a JSON file per session under ~/.only-cli (override with OC_HOME), so oc do 3 follows [3] without the agent ever handling a URL. Pages longer than the budget say what they left out; oc find, oc read , and oc next read 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.
Supported websites
Works on any mostly-static site with no per-site setup: news sites, blogs, documentation, forums, search engines. On top of that, clis/ ships tuned shortcuts for:
website<br>domain<br>shortcuts
Hacker News<br>news.ycombinator.com<br>top, new, item , user
Reddit<br>reddit.com (via old.reddit.com)<br>sub , post , user , search
GitHub<br>github.com<br>repo , user , search , trending, issues
x.com<br>user , post
LinkedIn<br>linkedin.com<br>profile , company , jobs (public guest views)
DuckDuckGo<br>duckduckgo.com<br>search , lite
Bing<br>bing.com<br>search , news
Stack Overflow<br>stackoverflow.com (via Atom feeds)<br>question , tag , user , recent
Yahoo Finance<br>finance.yahoo.com<br>quote , news , history , lookup , markets, gainers, losers, trending
YouTube<br>youtube.com<br>video , channel
A few of these (X, Stack Overflow, YouTube) read pages that look login-gated or JS-only from the outside, by...