Skip to content

Latest commit

 

History

History
66 lines (46 loc) · 1.75 KB

File metadata and controls

66 lines (46 loc) · 1.75 KB

ax-grep

ax-grep promo image

npm version coverage: 100% license: MIT

Compact semantic trees and agent-ready page checks from HTML, URLs, WebViews, and live browser pages.

Core features:

  • readable semantic trees from URLs, files, stdin, or captured browser HTML
  • compact --agent JSON for search, page checks, and browser handoff loops

1. Install The CLI Skill

curl -fsSL https://raw.githubusercontent.com/hmmhmmhm/ax-grep/main/skills.sh | sh

The skill prompt teaches subagents to call ax-grep before opening a browser:

npx ax-grep https://example.com
npx ax-grep https://example.com --agent

2. Use From A Server

npm install ax-grep
import { extract, formatSemanticTreeText } from "ax-grep";

const html = await fetch("https://example.com").then((r) => r.text());
const tree = extract(html);
const promptText = formatSemanticTreeText(tree);

3. Use In WebViews Or Pages

import { createExtractorScript } from "ax-grep";

const script = createExtractorScript({ format: "text" });
// Playwright/Puppeteer: await page.evaluate(script)
// iOS/Android WebView: evaluateJavaScript(script)

Docs