llms.txt in documentation generators
How to enable llms.txt in Starlight, VitePress, Docusaurus, MkDocs and Nuxt - a working setup for each, which files the plugin creates and what to check after the build
What each plugin creates
Section titled “What each plugin creates”| Generator | Package | llms.txt | llms-full.txt | Markdown versions of pages |
|---|---|---|---|---|
| Starlight | starlight-llms-txt | yes | yes, plus llms-small.txt | not stated |
| VitePress | vitepress-plugin-llms | yes | yes | yes |
| Docusaurus | docusaurus-plugin-llms | yes | yes | by option |
| Docusaurus | @signalwire/docusaurus-plugin-llms-txt | yes | by option | yes |
| MkDocs | mkdocs-llmstxt | yes | by option | for listed files |
| Nuxt | nuxt-llms | yes | by option | no |
pnpm add starlight-llms-txtimport starlight from '@astrojs/starlight'import { defineConfig } from 'astro/config'import starlightLlmsTxt from 'starlight-llms-txt'
export default defineConfig({ site: 'https://example.com/', integrations: [ starlight({ title: 'My Docs', plugins: [starlightLlmsTxt()], }), ],})The site field is required: without it the plugin cannot build absolute addresses. The output is three files: llms.txt, llms-full.txt and a shortened llms-small.txt.
npm install vitepress-plugin-llms --save-devimport { defineConfig } from 'vitepress'import llmstxt from 'vitepress-plugin-llms'
export default defineConfig({ vite: { plugins: [llmstxt()], },})The plugin creates llms.txt, llms-full.txt and a Markdown version of every page.
The plugin’s author advises using it for English documentation only. For a multilingual site, take that limit into account in advance.
There are two live plugins. The first is simpler to set up:
npm install docusaurus-plugin-llms --save-devmodule.exports = { plugins: ['docusaurus-plugin-llms'],}The second can do more and creates Markdown versions of pages:
npm install @signalwire/docusaurus-plugin-llms-txtmodule.exports = { plugins: [ [ '@signalwire/docusaurus-plugin-llms-txt', { outputDir: 'llms-txt', includePatterns: ['**/*.html'], excludePatterns: ['**/404.html'], }, ], ],}The similarly named unscoped package docusaurus-plugin-llms-txt has not been updated since December 2024. It is not worth taking.
pip install mkdocs-llmstxtsite_name: My projectsite_description: Description of my project.site_url: https://example.com/
plugins: - llmstxt: markdown_description: Long description of my project. full_output: llms-full.txt sections: Documentation: - index.md: Where to start - api.md: API referenceThe site_url field is required. Sections and files are listed by hand: this is the only plugin of the five that forces a selection. The full_output line enables llms-full.txt.
The author has declared the project to be in maintenance mode.
npm i nuxt-llmsexport default defineNuxtConfig({ modules: ['nuxt-llms'], llms: { domain: 'https://example.com', title: 'My Site', description: 'What the site is and who it is for.', full: { title: 'Full documentation', description: 'The whole documentation text in one file.', }, },})Only the domain field is required. The full block enables llms-full.txt.
Platforms with nothing to set up
Section titled “Platforms with nothing to set up”| Platform | What is created automatically |
|---|---|
| Mintlify | llms.txt and llms-full.txt at the project root; a very long index is split into parts |
| GitBook | llms.txt, llms-full.txt and a Markdown version of any page at the address ending in .md |
This explains why so many documentation sites have the files although their owners configured nothing.
Discovery relations
Section titled “Discovery relations”Plugins create the files, but not all of them add the relations from the second edition of the proposal to pages. Check whether the page code has these lines:
<link rel="alternate" type="text/markdown" href="/docs/page.md"><link rel="describedby" href="/llms.txt">If not, add them through the page head template. More: Discovery of the file and Markdown versions.
After the build
Section titled “After the build”llms.txtappeared in the build folder and answers200on the site.- It has the site name and summary.
- Link addresses are absolute and on the right domain.
- Drafts and hidden pages did not get into the file.
- The size of
llms-full.txtis reasonable. - Markdown versions of pages open, if the plugin creates them.
Commands for checking: Validating files and markup.
What to read next
Section titled “What to read next”- Generators and tools - extensions for content management systems and utilities
- Markdown versions of pages - why they exist and how to serve them
- What is llms-full.txt - when the full file is needed
- llms.txt and MCP - how the file relates to the protocol