Skip to content
Advance Labs

01Tool

An llms.txt built from your routes, in one command.

It reads your routes, so the file lists what is actually on the site rather than what your README says about the project. Next, Astro, SvelteKit, Nuxt, WordPress and plain HTML. Free, open source, no sign-up.

npm create llms-txt

Answer: to generate an llms.txt file, run npm create llms-txt in your project root. It detects the framework, reads your routes and their titles, and writes the file to wherever your static files are served from. It never overwrites an existing llms.txt, and --dry-run shows the changes before it makes them.

New to this? What an llms.txt is and how to write one explains the format first.

02What happens

It tells you exactly what it changed

$ npm create llms-txt

Astro  4 pages read

  + llms.txt public/llms.txt (starter file, edit before shipping)
  + link rel=llms src/layouts/Layout.astro
  + script tag src/layouts/Layout.astro
  + <human-machine-swapper> src/layouts/Layout.astro
  + :defined guard src/styles/global.css

2 TODOs left in it.

Nothing is guessed. Anything it could not work out is reported rather than invented, and running it twice changes nothing the second time.

03The output

Built from your routes, honest about the gaps

# Harbour Cycles

> A bike shop and repair co-op on the Halifax waterfront.

## About

A bike shop and repair co-op on the Halifax waterfront.

## Pages

- [Harbour Cycles](/)
- [Opening hours](/hours)
- [Join the co-op](/membership)
- [Repairs and servicing](/repairs)

## Key facts

Q: What is Harbour Cycles?
A: A bike shop and repair co-op on the Halifax waterfront.

Q: What can I do on Harbour Cycles?
A: TODO

The Pages section is the part you cannot get from a template: it comes from the site's own routes and their titles. Dynamic routes are left out, because a template is not a page and listing /blog/[slug] helps nobody.

It is a starting point and says so in its own text. The TODOs are where it could not work something out, and the command counts them for you. This file is what a model reads about you, so it is worth ten minutes.

04Options

Options

FlagWhat it does
--dry-runShow every change without writing anything.
--no-pillWrite only the llms.txt. Skip the Human/Machine view.
--dir <path>Run against a project somewhere other than the current directory.

Running in CI or from a coding agent? It is non-interactive when there is no terminal, and its exit codes mean something: 0 written, 1 could not identify the project, 2 written but something needs a human.

05The pill

Optional: let visitors read it too

At the end it offers to add a Human / Machine pill. Machine shows your llms.txt rendered in place, so a visitor can see what the machines see. It is Human/Machine view, about six kilobytes gzipped with no dependencies, and --no-pill skips it entirely.

06FAQ

npm create llms-txt: commonly asked questions

What is an llms.txt file?

A plain-text file at the root of your site, written for language models rather than people. When ChatGPT, Claude or Perplexity answer a question about you, it is the document you would want them to have read. It is a convention rather than a standard, and no engine is obliged to read it.

How do I generate an llms.txt from the command line?

Run npm create llms-txt in your project root. It detects the framework, reads your routes and their titles, and writes an llms.txt into wherever your static files are served from. It never overwrites a file you already have, and --dry-run shows the changes first. If you would rather have a model draft one from your copy, use the prompt and templates instead.

What makes this different from writing one by hand?

It reads your actual routes, so the Pages section lists what is on the site rather than what your README says about the project. Dynamic routes are left out because a template is not a page, and build output is never walked. Everything it could not work out is marked TODO instead of invented.

Which frameworks does it support?

Next.js on both the app and pages routers, Astro, SvelteKit, Nuxt, WordPress themes, and plain HTML. If it cannot identify the project it changes nothing and prints what to do by hand.

Is the generated file finished?

No, and it says so in its own text. It is a starting point with TODOs where it could not work something out, and the command reports how many are left. The file is what a model reads about you, so it is worth ten minutes of editing.

Does it change my site's design?

Only if you let it. It offers to add a Human/Machine pill so visitors can read the file too, and --no-pill skips that entirely. Nothing else about the page is touched.

Is it free?

Yes, Apache-2.0 and open source, with no sign-up. It is published to npm as create-llms-txt by Advance Labs.

07More

Writing it yourself, and what comes after

Driving a coding agent? Hand it /tools/llms-txt/llms.txt instead of this page. Same instructions with the prose taken out.