How to add llms.txt to your website, by hand or with vagejs

An llms.txt file is a short Markdown guide to your website, written for AI tools. It sits at /llms.txt, says what the site is in a sentence, and lists the pages worth reading with a one-line note on each. This guide shows you how to write one by hand for any website, how to add plain Markdown copies of your pages, and how vagejs builds and checks both for you.

On this page
  1. What goes in an llms.txt file?
  2. Step 1: Write the file by hand
  3. Step 2: Add Markdown copies of your pages (optional)
  4. Step 3: Check it
  5. The vagejs way: generated on every build
  6. Quick reference

If you're still deciding whether you need one at all, start with the honest version: llms.txt is a proposal, not a search-engine standard. It costs little to publish and some AI tools read it, but it won't move your Google rankings. Our SEO and AI search docs cover where it fits next to robots.txt and the sitemap.

What goes in an llms.txt file?

The format was proposed by Jeremy Howard in September 2024, and the specification lives at llmstxt.org. It's deliberately small. In order, the file has:

  1. An H1 with the name of the site or project. This is the only part the proposal requires.
  2. A blockquote with a short summary: what the site is, in a sentence or two.
  3. Optional paragraphs or lists with anything else a reader should know first. These can be any Markdown except headings.
  4. Sections that start with an H2, each holding a list of links. Every item is a Markdown link, optionally followed by a colon and a note.

One section name has a special meaning. A section called Optional holds links a tool can skip when it needs to keep its reading short, so put your less important pages there.

The file goes at the root of your site, https://example.com/llms.txt. The proposal also allows one in a subfolder, such as /docs/llms.txt, covering just the pages under it.

Step 1: Write the file by hand

Here's a complete llms.txt for a small bakery website. Copy the shape and swap in your own pages:

Markdown
# Rosemary Bakery

> A family bakery in Pune selling sourdough, cakes to order and weekend pastries. Open Tuesday to Sunday, 7am to 7pm.

Cake orders need two days' notice. We don't deliver; collection is from the shop.

## Main pages

- [Menu](https://rosemarybakery.example/menu/): breads, cakes and pastries with prices
- [Order a cake](https://rosemarybakery.example/cakes/): sizes, flavours and how to order
- [Visit us](https://rosemarybakery.example/visit/): address, opening hours and parking

## Optional

- [Our story](https://rosemarybakery.example/about/): how the bakery started
- [Blog](https://rosemarybakery.example/blog/): recipes and news

A few things make the difference between a useful file and a long one:

  • Write the summary for someone who has never heard of you. "A family bakery in Pune" tells a tool more than a slogan does.
  • List the pages that answer real questions. Prices, opening hours, what you offer and how to buy. Skip tag pages, login pages and thank-you pages.
  • Make every note specific. "Address, opening hours and parking" beats "Learn more about us".
  • Use full addresses, starting with https://, so the links work wherever the file is read.

Save it as llms.txt in the folder your host publishes as the site root. On most static hosts that's the same folder as your index.html or your favicon.ico.

Step 2: Add Markdown copies of your pages (optional)

The proposal suggests a second step: offer a clean Markdown version of each important page at the same address with .md added. For a page at /menu/, that's /menu.md, and for the home page it's /index.md. A tool can then read your text without the menus, scripts and styling around it, and your llms.txt can link to those copies instead of the HTML pages.

By hand, this means saving a Markdown version of each page next to the HTML and keeping it in step every time the page changes. That's where a hand-made setup usually falls behind: the copy says one price, the page says another.

Step 3: Check it

Whichever way you made it, check three things after you publish:

  1. Open https://yoursite.com/llms.txt in a browser. You should see plain text starting with # Your site name, not your 404 page.
  2. Click a few of the links. Every one should open a real page, not a redirect or an error.
  3. Read it as a stranger would. If the summary and notes don't tell a newcomer what you do and where to find it, rewrite them.

Then put a reminder in your diary. A file you wrote once drifts as pages are added, renamed and removed.

The vagejs way: generated on every build

vagejs writes llms.txt for you, from the pages that exist when you build. It's on by default, and it only needs a site title in vage.config.ts:

TypeScript
import { defineConfig } from "vagejs";

export default defineConfig({
  site: "https://rosemarybakery.example",
  title: "Rosemary Bakery",
  description: "A family bakery in Pune selling sourdough, cakes to order and weekend pastries.",
});

Run npm run build and dist/llms.txt appears. The H1 is your site title, the summary is your site description, and a Pages section lists every page that's meant to be found, using each page's own title and its description from frontmatter as the note. Pages marked noindex, drafts and pages that point their canonical URL somewhere else are left out, the same rules the sitemap follows. Add a page and it's listed on the next build; delete one and it's gone. There's no second list to keep in step.

That's also why page descriptions matter twice in vagejs: the same sentence becomes the summary Google shows and the note in llms.txt.

The full version: llms-full.txt

Sometimes it's easier to hand a tool the whole site as one file. The llms.txt proposal doesn't define such a file, but some sites publish one as llms-full.txt next to their llms.txt, and vagejs can write it:

TypeScript
seo: {
  llmsTxt: { full: true },
},

llms-full.txt holds the full text of every listed page, one after another, each starting with its address. For a small site it's a handy single read; for a large one it can get big, so turn it on when you know a tool wants it.

Markdown copies, built and linked for you

Step 2 above is one setting in vagejs:

TypeScript
seo: {
  markdownCopies: true,
},

Every listed page then gets a Markdown copy at the same address with .md on the end, and each HTML page points to its copy with a <link rel="alternate" type="text/markdown"> tag. llms.txt switches its links to the copies, so a tool that starts at your llms.txt reads clean text all the way through.

The copies are made from the page as it's published, from what's inside its <main> element. That means content your layout builds, like a list of questions on an FAQ page, is included, and the copy can't disagree with the page. Parts that repeat on every page, such as share links or a "start here" box, can be left out by adding data-vage-copy="skip" to them in your layout. On Cloudflare hosting, each copy also tells search engines that the HTML page is the original, so the two don't compete in results.

Checking it, automatically

npm run check runs before you publish and catches broken internal links, and since llms.txt is built from the same pages, it lists only pages that exist. After you publish, npx vage verify compares the live site with your files, including llms.txt, llms-full.txt and the Markdown copies, and reports anything that changed on the server but not in your project.

Quick reference

Task By hand With vagejs
Create llms.txt Write it, upload it to the site root On by default; needs title
Keep the page list current Edit the file on every change Rebuilt from your pages on every build
Page notes Write each one Each page's description
Full-text version Assemble it yourself llmsTxt: { full: true }
Markdown copies Save and update a .md per page markdownCopies: true
Check it Open it and click the links npm run check before, npx vage verify after

If you're setting up a new site, npm create vagejs@latest my-site gives you all of this from the first build. The SEO and AI search docs have every option, and the agents guides show how to have your AI coding assistant set it up for you.

Start with one command.
You'll have a site running in a minute.

npm create vagejs@latest my-site

Read the docsUse it with your AI assistant