llms.txt
Auto-generated documentation endpoint for AI assistants.
Overview
llms.txt is an auto-generated documentation endpoint that provides structured content for AI assistants. The index routes are /llms.txt (docs index), /llms.txt/docs, /llms.txt/blog, and /llms-full.txt. Per-page markdown is served through the .md and .txt aliases under /docs/* and /blog/*.
How It Works
The endpoint automatically scans documentation and published blog content, generating markdown files that include:
- Complete documentation pages
- Published blog articles
- Structured navigation
- Cross-references between pages
Access Points for AI Assistants
- llms.txt - Index for complete documentation for ZeroStarter
- llms.txt/blog - Index for latest articles and updates about ZeroStarter
- llms-full.txt - Complete documentation in one page for AI assistants
- Per-page
.mdand.txtaliases for individual docs and blog pages, e.g./docs/manage/llms-txt.mdor/blog/<slug>.txt
Only the per-page .md/.txt aliases under /docs/* and /blog/* are rewritten (see rewrites in web/next/next.config.ts). The top-level /docs.md, /docs.txt, /blog.md, and /blog.txt forms are not routes and return 404; use /llms.txt/docs and /llms.txt/blog for the index views.
Implementation
Two route handlers back these endpoints, and both are force-static with revalidate = 60:
web/next/src/app/(llms.txt)/llms.txt/[[...slug]]/route.tsserves/llms.txtand the/llms.txt/docsand/llms.txt/blogindex views, plus every per-page alias rewritten from/docs/*and/blog/*. It usesdocsSourceandblogSourcefrom Fumadocs, sorts docs bymeta.jsonorder, and lists only published blog posts viagetPublishedBlogPosts(). Console docs are deliberately excluded (privacy boundary).web/next/src/app/(llms.txt)/llms-full.txt/route.tsserves/llms-full.txt: every docs and blog page concatenated into one file, prefixed withsite.llmsFullPreamblefrompackages/config/src/site.ts.
Page bodies come from getLLMText in web/next/src/lib/llms.ts, which:
- Calls
page.data.getText("processed")and falls back togetText("raw")if the processed output is unavailable. The processed output exists because each collection inweb/next/source.config.tssetsincludeProcessedMarkdown: true(see the Documentation page for more on this flag). - Runs
decodeHTMLfrom theentitiespackage to undo Fumadocs' HTML-escaping (e.g.*back to*), so the LLM text is clean. - Prefixes each page with a
# [title](url)heading linking back to the live page.
The per-page docs handler also appends a footer pointing back to /llms.txt so an assistant can find the rest of the navigation.