mirror of
https://github.com/only-cli/oc.git
synced 2026-09-15 10:40:56 +02:00
release: 0.3.0
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
"name": "only-cli",
|
||||
"source": { "source": "github", "repo": "only-cli/oc" },
|
||||
"description": "Browse websites from the terminal in a few hundred tokens",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.0",
|
||||
"homepage": "https://github.com/only-cli/oc",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "only-cli",
|
||||
"description": "Browse websites from the terminal in a few hundred tokens",
|
||||
"version": "0.2.0"
|
||||
"version": "0.3.0"
|
||||
}
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@only-cli/oc",
|
||||
"version": "0.3.0-beta.2",
|
||||
"version": "0.3.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@only-cli/oc",
|
||||
"version": "0.3.0-beta.2",
|
||||
"version": "0.3.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"linkedom": "^0.18.12",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@only-cli/oc",
|
||||
"version": "0.3.0-beta.2",
|
||||
"version": "0.3.0",
|
||||
"description": "Turn websites into a compact CLI so AI agents can browse without burning tokens.",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
||||
@@ -8,12 +8,13 @@ description: Token-efficient web browsing and web content extraction for AI agen
|
||||
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.2.0 open <url> compact view, numbered elements
|
||||
npx --yes @only-cli/oc@0.2.0 do <n> follow link [n], or read it if [n] is text
|
||||
npx --yes @only-cli/oc@0.2.0 find <query> lines where a string appears, with numbers
|
||||
npx --yes @only-cli/oc@0.2.0 next next ~500 tokens of the page already open
|
||||
npx --yes @only-cli/oc@0.2.0 read <n> full text of region [n]
|
||||
npx --yes @only-cli/oc@0.2.0 raw [url] whole page as markdown (--html for cleaned HTML)
|
||||
npx --yes @only-cli/oc@0.3.0 open <url> compact view, numbered elements
|
||||
npx --yes @only-cli/oc@0.3.0 do <n> follow link [n], or read it if [n] is text
|
||||
npx --yes @only-cli/oc@0.3.0 find <query> where a string appears, or that place itself
|
||||
when only one matches
|
||||
npx --yes @only-cli/oc@0.3.0 next next ~500 tokens of the page already open
|
||||
npx --yes @only-cli/oc@0.3.0 read <n> full text of region [n]
|
||||
npx --yes @only-cli/oc@0.3.0 raw [url] whole page as markdown (--html for cleaned HTML)
|
||||
```
|
||||
|
||||
None of these except `open`/`do`/`raw <url>` fetch anything — they replay the page `open` already saved.
|
||||
@@ -23,13 +24,14 @@ None of these except `open`/`do`/`raw <url>` fetch anything — they replay the
|
||||
- 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.
|
||||
- `... +820 chars`: block was cut there; `read <n>` prints it whole.
|
||||
- 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.
|
||||
- `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).
|
||||
@@ -42,7 +44,7 @@ None of these except `open`/`do`/`raw <url>` fetch anything — they replay the
|
||||
- `[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.
|
||||
- `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
|
||||
|
||||
Reference in New Issue
Block a user