agentmarkup cli any static site.md

Run agentmarkup on any static site with the CLI

Use @agentmarkup/cli to run llms.txt, JSON-LD, markdown mirrors, and AI crawler controls over any built static output, with a CI check command.

Why a CLI

The Vite, Astro, Next.js, and Nuxt adapters each hook a specific build. The CLI has zero framework coupling: point it at a directory of emitted HTML and it generates llms.txt, markdown mirrors, JSON-LD, AI-crawler robots.txt, and _headers, then validates the result. That makes it the right tool for Eleventy, Gatsby, Hugo, Jekyll, Docusaurus, plain static HTML, and any pipeline without a dedicated adapter.

Setup

Install the CLI:

pnpm add -D @agentmarkup/cli

Add a config file in your project root:

// agentmarkup.config.mjs
export default {
 site: 'https://example.com',
 name: 'Example',
 outDir: 'dist', // optional default; or pass the directory as an argument
 llmsTxt: {
 sections: [
 {
 title: 'Docs',
 entries: [
 { title: 'Home', url: 'https://example.com/', description: 'Start here' },
 ],
 },
 ],
 },
 markdownPages: { enabled: true },
 aiCrawlers: { GPTBot: 'disallow' },
}

The config is the same AgentMarkupConfig the adapters use, plus an optional CLI-only outDir for path resolution.

Three modes

# Inject + write llms.txt, markdown mirrors, JSON-LD, robots.txt, _headers
agentmarkup generate ./dist

# Validate what is already on disk (CI gate) - exits non-zero on errors
agentmarkup check ./dist

# Preview without writing anything
agentmarkup generate ./dist --dry-run

A real CI gate

check is the piece the build-time adapters cannot offer on their own: a standalone command that fails CI when your deployed output would not be machine-readable. Add it after your build step:

# .github/workflows/ci.yml (excerpt)
- run: pnpm build
- run: pnpm exec agentmarkup check ./dist

Use --strict to also fail on warnings (for example a configured artifact that never got generated).

Coexistence by default

Existing curated llms.txt, existing robots.txt rules, and existing page JSON-LD are preserved by default; the CLI only fills gaps. Opt into replacement per feature in the config when you want the CLI to take over an output.

One safety note worth knowing: the CLI never auto-guesses public/ as an output directory, because it is a source asset directory in many frameworks. Pass it explicitly if you really mean it.

The bottom line

If your site emits static HTML, @agentmarkup/cli gives you the full agentmarkup pipeline without an adapter, plus a CI gate to keep your machine-readable output honest over time.

For more on the underlying pieces, read the llms.txt guide, the JSON-LD guide, and the AI crawlers guide.