Vanilla JS / Static HTML
aeo.js works on any project that produces static HTML. Use the CLI directly — no plugin, no module, no framework.
Quick Start
Section titled “Quick Start”npx aeo.js generate --url https://mysite.com --title "My Site" --out publicnpm install --save-dev aeo.jsnpx aeo.js generate --url https://mysite.com --title "My Site" --out publicgenerate walks your output directory, extracts page content, and emits robots.txt, llms.txt, sitemap.xml, ai-index.json, and schema.json next to your HTML.
How aeo.js Discovers Your Pages
Section titled “How aeo.js Discovers Your Pages”| Source | How to set | Use when |
|---|---|---|
Built HTML in outDir | --out public (CLI) | You have a built static site with *.html files |
contentDir | programmatic only — see below | You have handwritten .md / .mdx files |
pages array | programmatic only — see below | Explicit control for runtime-only routes |
The CLI exposes --out for outDir. For the richer options (contentDir, pages), call the package’s API directly:
import { generateAEOFiles, resolveConfig } from 'aeo.js';
await generateAEOFiles(resolveConfig({ title: 'My Site', url: 'https://mysite.com', contentDir: 'content', outDir: 'public', pages: [{ pathname: '/', title: 'Home' }],}));Common Setups
Section titled “Common Setups”Hand-rolled HTML site
Section titled “Hand-rolled HTML site”{ "scripts": { "build:aeo": "aeo.js generate --url https://mysite.com --title \"My Site\" --out ." }}Eleventy / Hugo / Jekyll
Section titled “Eleventy / Hugo / Jekyll”{ "scripts": { "build": "eleventy", "postbuild": "aeo.js generate --url https://mysite.com --title \"My Site\" --out _site" }}For Hugo use --out public; for Jekyll --out _site. The postbuild script runs automatically after npm run build.
Markdown blog (no framework)
Section titled “Markdown blog (no framework)”The CLI’s --out flag covers built HTML; to also pull .md front-matter and bodies from a contentDir, use the programmatic API:
import { generateAEOFiles, resolveConfig } from 'aeo.js';
await generateAEOFiles(resolveConfig({ title: 'My Blog', url: 'https://myblog.dev', contentDir: 'content', // pull post bodies from here outDir: 'public', // write generated files here}));{ "scripts": { "build:aeo": "node scripts/aeo.mjs" }}Adding the Widget
Section titled “Adding the Widget”<script type="module"> import { AeoWidget } from 'https://esm.sh/aeo.js/widget'; new AeoWidget({ config: { title: 'My Site', url: 'https://mysite.com', widget: { enabled: true, position: 'bottom-right', size: 'small' }, }, });</script>Or install and bundle locally with import { AeoWidget } from 'aeo.js/widget'.
CI Integration
Section titled “CI Integration”- run: npx aeo.js check --json | tee audit.json- run: | SCORE=$(jq '.audit.score' audit.json) [ "$SCORE" -ge 70 ] || { echo "GEO score $SCORE below 70"; exit 1; }Further Reading
Section titled “Further Reading”- CLI Reference — every command, every flag
- JSON-LD Recipes — FAQ, HowTo, Product, Article, Recipe, Event
- Configuration Reference