Run agentmarkup on any static site with the CLI
Not every site uses a framework with a dedicated adapter. @agentmarkup/cli runs the same machine-readable pipeline over any built static output directory, and adds a CI check command that fails the build when machine-readability is broken.
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/cliAdd 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-rungenerateinjects discovery links and JSON-LD into your HTML and writesllms.txt,llms-full.txt, markdown mirrors,robots.txt, and_headers.generate --dry-runreports every planned write without touching any files.checkvalidates the files exactly as they are on disk and never writes. It exits non-zero on any error, and warns when a configured artifact is missing.
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 ./distUse --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.