### Run or install ax with Nix
Source: https://github.com/yusukebe/ax/blob/main/README.md
Utilize the Nix flake to run the binary without installation or to add it to your profile.
```bash
# Run without installing
nix run github:yusukebe/ax
# Install into your profile
nix profile install github:yusukebe/ax
```
--------------------------------
### Install ax
Source: https://github.com/yusukebe/ax/blob/main/src/agent-context.txt
Installs the ax command-line tool using a curl script.
```bash
curl -fsSL https://ax.yusuke.run/install | sh
```
--------------------------------
### Run Bun Server with Hot Module Replacement
Source: https://github.com/yusukebe/ax/blob/main/CLAUDE.md
Command to start the Bun server with hot module replacement enabled for development.
```sh
bun --hot ./index.ts
```
--------------------------------
### Common ax command patterns
Source: https://github.com/yusukebe/ax/blob/main/README.md
Basic usage examples for fetching, outlining page structure, and extracting data from URLs.
```sh
ax https://api.example.com/users # curl parity — but never silent
ax https://example.com --outline # discover the page's structure
ax https://example.com '.item' --row 'title=a, href=a@href'
ax https://docs.example.com/guide --md --budget 800 # read docs as markdown
```
--------------------------------
### Install or Upgrade ax
Source: https://github.com/yusukebe/ax/blob/main/SECURITY.md
Use this command to install or upgrade the ax CLI to the latest version. It verifies the SHA-256 checksum for security.
```sh
curl -fsSL https://ax.yusuke.run/install | sh # verifies SHA-256
brew upgrade ax
```
--------------------------------
### Bun Test Example
Source: https://github.com/yusukebe/ax/blob/main/CLAUDE.md
A basic test case using Bun's built-in testing framework.
```typescript
import { test, expect } from "bun:test";
test("hello world", () => {
expect(1).toBe(1);
});
```
--------------------------------
### Bun HTTP Server with WebSockets
Source: https://github.com/yusukebe/ax/blob/main/CLAUDE.md
Example of a Bun server supporting HTTP routes and WebSocket connections. It demonstrates basic request handling and WebSocket message echoing.
```typescript
import index from "./index.html"
Bun.serve({
routes: {
"/": index,
"/api/users/:id": {
GET: (req) => {
return new Response(JSON.stringify({ id: req.params.id }));
},
},
},
// optional websocket support
websocket: {
open: (ws) => {
ws.send("Hello, world!");
},
message: (ws, message) => {
ws.send(message);
},
close: (ws) => {
// handle close
}
},
development: {
hmr: true,
console: true,
}
})
```
--------------------------------
### Basic HTML Structure for Bun Frontend
Source: https://github.com/yusukebe/ax/blob/main/CLAUDE.md
A simple HTML file that imports a JavaScript module for frontend rendering.
```html
Hello, world!
```
--------------------------------
### Convert page to Markdown with ax
Source: https://github.com/yusukebe/ax/blob/main/src/agent-context.txt
Converts the content of a URL into readable Markdown format.
```bash
ax URL --md
```
--------------------------------
### Perform Web Requests and Data Extraction with ax
Source: https://github.com/yusukebe/ax/blob/main/skills/ax/SKILL.md
Common usage patterns for the ax CLI, including basic fetching, header/data handling, and structured data extraction.
```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
```
--------------------------------
### Fetch data with ax (curl parity)
Source: https://github.com/yusukebe/ax/blob/main/src/agent-context.txt
Fetches data from a URL, supporting common curl options like -X, -H, -d, -u, -I, -o, -k, -m, and --data-raw. Output includes status, ok, url, redirected, ms, headers, and body.
```bash
ax https://api.site.example/users [-X POST] [-H 'k: v'] [-d body|@file]
```
--------------------------------
### Discover page outline with ax
Source: https://github.com/yusukebe/ax/blob/main/src/agent-context.txt
Discovers the page outline by listing repeating tags and their counts.
```bash
ax https://site.example --outline
```
--------------------------------
### Add ax skill
Source: https://github.com/yusukebe/ax/blob/main/src/agent-context.txt
Adds the ax skill to your npx environment for easier access.
```bash
npx skills add yusukebe/ax
```
--------------------------------
### React Frontend Component with CSS Import
Source: https://github.com/yusukebe/ax/blob/main/CLAUDE.md
A React component written in TypeScript that renders a heading and imports a CSS file. This is intended to be bundled by Bun.
```tsx
import React from "react";
import { createRoot } from "react-dom/client";
// import .css files directly and it works
import './index.css';
const root = createRoot(document.body);
export default function Frontend() {
return Hello, world!
;
}
root.render();
```
--------------------------------
### Locate text on a page with ax
Source: https://github.com/yusukebe/ax/blob/main/src/agent-context.txt
Locates which selector on a page contains specific text.
```bash
ax https://site.example --locate 'text'
```
--------------------------------
### Extract text with authorization header using ax
Source: https://github.com/yusukebe/ax/blob/main/src/agent-context.txt
Extracts text content from a URL, including custom authorization headers. Parse requests support -H and -u options and bypass the URL cache.
```bash
ax URL '.private' -H 'authorization: Bearer x' --text
```
--------------------------------
### Count elements matching a selector with ax
Source: https://github.com/yusukebe/ax/blob/main/src/agent-context.txt
Tests a selector hypothesis by counting the number of matching elements on a page.
```bash
ax https://site.example '.card' --count
```
--------------------------------
### Extract table data with ax
Source: https://github.com/yusukebe/ax/blob/main/src/agent-context.txt
Extracts table data from a URL, converting HTML tables into rows keyed by headers.
```bash
ax URL 'table' --table
```
--------------------------------
### Extract specific attribute or text with ax
Source: https://github.com/yusukebe/ax/blob/main/src/agent-context.txt
Extracts a specific attribute (e.g., href), text content, or HTML from elements matching a selector.
```bash
ax URL '.item a' --attr href | --text | --html
```
--------------------------------
### Extract structured rows with ax
Source: https://github.com/yusukebe/ax/blob/main/src/agent-context.txt
Extracts structured rows from a URL using CSS selectors, mapping elements to specific fields like title, href, and level. Supports reading attributes with '@attr'.
```bash
ax URL '.item' --row 'title=a, href=a@href, level=.cefr'
```
--------------------------------
### Filter extracted rows with ax
Source: https://github.com/yusukebe/ax/blob/main/src/agent-context.txt
Filters extracted rows based on a condition using a safe expression. Column names with spaces can be backticked.
```bash
--where 'price > 100 && name ~ /^foo/i'
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.