# Run agentmarkup on any static site with the CLI - agentmarkup

> 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.

Source: https://agentmarkup.dev/blog/agentmarkup-cli-any-static-site/

By [Sebastian Cochinescu](/authors/sebastian-cochinescu/) · June 21, 2026 · 6 min read

# 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/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
```

- **`generate`** injects discovery links and JSON-LD into your HTML and writes `llms.txt`, `llms-full.txt`, markdown mirrors, `robots.txt`, and `_headers`.
- **`generate --dry-run`** reports every planned write without touching any files.
- **`check`** validates 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 ./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](https://www.npmjs.com/package/@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](/docs/llms-txt/), the [JSON-LD guide](/docs/json-ld/), and the [AI crawlers guide](/docs/ai-crawlers/).

## Make your website machine-readable

agentmarkup is an open-source build-time toolkit for Vite, Astro, Next.js, and Nuxt (plus a framework-agnostic CLI) that generates llms.txt, injects JSON-LD structured data, creates optional markdown mirrors from final HTML when raw pages need a cleaner agent-facing fetch path, manages AI crawler robots.txt rules, patches optional Content-Signal and canonical mirror headers, and validates everything at build time. Zero runtime cost.

 Learn more GitHub
```
pnpm add -D @agentmarkup/vite # or @agentmarkup/astro, @agentmarkup/next, @agentmarkup/nuxt, @agentmarkup/cli
```

Written by

[Sebastian Cochinescu](/authors/sebastian-cochinescu/) · Developer of agentmarkup

Builder of developer tools for machine-readable websites. Developer of agentmarkup. Founder of Anima Felix.

## More from the blog

### How to add llms.txt, JSON-LD, and AI crawler controls to Nuxt

Use @agentmarkup/nuxt to generate llms.txt, inject JSON-LD, create markdown mirrors, and manage AI crawler rules from prerendered Nuxt output.

 June 21, 2026 · 7 min read

### How to add llms.txt, JSON-LD, and AI crawler controls to Next.js

Use @agentmarkup/next to generate llms.txt, inject JSON-LD, manage AI crawler rules, and understand the dynamic SSR boundary in Next.js.

 March 23, 2026 · 8 min read

### When markdown mirrors help, and when they do not

A practical guide to when generated markdown mirrors add signal, when HTML is already enough, and how to avoid unnecessary downsides.

 March 20, 2026 · 7 min read

### Is your website ready for AI? Free LLM discoverability checker

Audit your website for llms.txt, JSON-LD, robots.txt, markdown mirrors, and sitemap. Free tool for e-commerce and brand websites.

 March 20, 2026 · 8 min read

### Build-time markdown mirrors for agent readability: Cloudflare comparison

Build-time markdown generation for AI readability, including when it helps and how it compares to Cloudflare runtime extraction.

 March 20, 2026 · 7 min read

### How to make your brand appear in AI conversations

Organization schema, llms.txt, and FAQ markup make your brand visible in ChatGPT, Claude, and Perplexity answers.

 March 20, 2026 · 7 min read

### Why LLM-optimized e-commerce websites sell more

Product JSON-LD, llms.txt, and AI crawler access make your store visible in AI product recommendations.

 March 20, 2026 · 8 min read

### Every AI crawler indexing your website in 2026

Complete list: GPTBot, ClaudeBot, PerplexityBot, Google-Extended, CCBot, and more. What each does and how to control access.

 March 20, 2026 · 8 min read

### JSON-LD structured data: the complete guide for web developers

Schema types, JSON-LD vs microdata, common mistakes, and build-time validation.

 March 20, 2026 · 10 min read

### What is GEO? Generative Engine Optimization explained for developers

What is real, what is hype, and what you can do today to make your site citeable by AI.

 March 20, 2026 · 7 min read

### Why llms.txt matters: making your website discoverable by AI

LLMs answer questions by synthesizing web content. llms.txt gives them a structured overview of your site.

 March 20, 2026 · 6 min read
