# Ax

Use the ax CLI instead of curl + throwaway parsing scripts whenever you fetch a URL...

- Repository: https://github.com/mxyhi/ok-skills (509 stars)
- Category: Writing
- License: Apache-2.0
- Last updated: 2026-10-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add mxyhi/ok-skills --skill ax -g -a claude-code -y`
Codex: `npx skills add mxyhi/ok-skills --skill ax -g -a codex -y`
Cursor: `npx skills add mxyhi/ok-skills --skill ax -g -a cursor -y`
Gemini CLI: `npx skills add mxyhi/ok-skills --skill ax -g -a gemini-cli -y`

## Description

Use the ax CLI instead of curl + throwaway parsing scripts whenever you fetch a URL, explore an unknown web page, or extract structured data from HTML. Trigger whenever you are about to write an inline script (python3 heredoc, node -e, regex over HTML) or a bare curl for one-off web fetching, scraping, or page exploration.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# ax, the AI-era curl: fetch, discover, extract

One command: `ax <url|file|-> [selector] [flags]`. Never write regex over
HTML, and never use bare curl (it returns nothing on empty bodies).

## Cheatsheet

```sh
ax https://api.site.example/users                    # {status, ok, url, redirected, ms, headers, body}
ax https://api.site.example/users -H 'authorization: Bearer x' -X POST -d '{"a":1}'
ax https://api.site.example/users -d @payload.json  # @file reads it, implies POST; --data-raw = literal @string
# curl reflexes work: -u -I -o -k -m -f --data-raw (and -L/-i/-s are no-ops)
ax https://site.example --outline                    # discover: repeating structures
ax https://site.example --locate 'some text'         # discover: which selector holds this
ax https://site.example '.card' --count              # confirm a hypothesis
ax https://site.example '.card' --row 'title=a, href=a@href, id=@data-id'
ax https://site.example '.private' -H 'authorization: Bearer x' --text
ax https://site.example 'table' --table --where 'Stars >= 30000'
ax https://site.example 'table' --table --where '`Col With Spaces` ~ /x/'
ax https://docs.site.example/guide --md --budget 800 # read docs as markdown
```

The workflow: fetch/--outline once → --locate/--count to confirm → ONE
--row/--table call. Repeat fetches of the same URL are cached ~2min, so
probing is free (--fresh to bypass). Parse requests with -H or -u bypass
the cache automatically.

## Speed discipline

Aim for ≤3 tool calls: one batched look (`ax URL --outline; ax URL '.guess' --count`),
one extraction call, then answer. Turns cost more than commands, semicolons
are free. Every --row/--table run prints `N rows extracted` + empty-field counts on stderr, that IS the verification; do not re-probe.
Answer with the data, concisely, no methodology narration.

## Output rules

The rest: https://github.com/mxyhi/ok-skills/blob/HEAD/ax/SKILL.md
