zudo-doc
GitHub repository

Type to search...

to open search from anywhere

llms.txt

Created Mar 14, 2026Updated Oct 11, 2026Takeshi Takatsudo

Auto-generate llms.txt and llms-full.txt files for AI-consumable documentation

zudo-doc can automatically generate llms.txt and llms-full.txt files, making your documentation easily consumable by AI tools and large language models.

Tip

The llms.txt standard is an emerging convention that helps AI tools discover and read your documentation. Many AI-powered tools already look for these files.

How It Works

When enabled, zudo-doc generates two files at build time:

  • /llms.txt — An index listing all documentation pages with their titles, descriptions, and URLs

  • /llms-full.txt — The full content of all documentation pages combined into a single file

These files provide a machine-friendly view of your documentation that AI tools can consume without parsing HTML.

Enabling llms.txt

The create-zudo-doc initializer enables this feature by default. When configuring zudoDoc() directly, the package default is false. To explicitly control it, set llmsTxt in zfb.config.ts:

zfb.config.ts
export default defineConfig(
  zudoDoc({
    // ...
    llmsTxt: true, // initializer default; package default is false
  }),
);

To disable it:

llmsTxt: false,

Generated Output

llms.txt (Index)

The index file lists each documentation page with its title, description, and URL:

# My Documentation

> Site description from settings

## Docs

- [Introduction](/docs/getting-started/introduction): Learn what the project is and how it works.
- [Configuration](/docs/guides/configuration): Global settings and configuration reference.

llms-full.txt (Full Content)

The full content file includes the complete text of every documentation page, separated by headings:

# My Documentation

> Site description from settings

## Introduction

Welcome to the project...

## Configuration

The project is configured through...

Page Exclusion

Pages with any of the following frontmatter fields are automatically excluded from both generated files:

  • draft: true — Draft pages excluded from build

  • unlisted: true — Built but hidden pages

  • search_exclude: true — Pages excluded from search

---
title: Internal Notes
search_exclude: true
---

Multi-Locale Support

When locales are configured, zudo-doc generates separate llms.txt files for each locale:

  • English (default): /llms.txt and /llms-full.txt

  • Japanese: /ja/llms.txt and /ja/llms-full.txt

Each locale's files contain only the pages from that locale's content directory. URLs in each file use the appropriate locale prefix.

HTML Discovery

When llmsTxt is enabled, zudo-doc adds <link> tags to the <head> of every page, helping AI tools discover the files even when the site is deployed at a subpath:

<link rel="alternate" type="text/plain" href="/my-docs/llms.txt" title="llms.txt" />
<link rel="alternate" type="text/plain" href="/my-docs/llms-full.txt" title="llms-full.txt" />

This supplements the standard path-based discovery (/llms.txt at the domain root) which may not work when your site uses a base path like /my-docs/.

When agentExport: true is enabled, the slim llms.txt index links each documentation page to its clean, complete /agent/v1/pages/<page-key>.md alternative. With export disabled, its existing page links stay unchanged. The full-content file keeps canonical human-page source URLs. When mcp: true is also enabled, the index advertises the separate <base>/mcp endpoint. The generated Markdown and MCP endpoint are described in Agent-readable export and MCP server.

Agents do not necessarily read llms.txt just because you supply a homepage URL. For browser-only use, explicitly give the client the llms.txt URL or a generated Markdown page URL. llmsTxt is on by default in the initializer; the package-level setting defaults to false when you configure zudoDoc yourself.

Dev Mode

The generated files are available during development via zfb's devMiddleware. When running pnpm dev, requests to /llms.txt and /llms-full.txt are handled dynamically — no build step needed.

Tip

No need to build before testing. The llms.txt files work immediately with pnpm dev, just like search.

Production Build

During pnpm build, the files are written to the dist/ directory as static text files alongside the rest of your site.

Revision History

Takeshi TakatsudoCreated: 2026-03-15T02:55:16+09:00Updated: 2026-10-11T06:24:17Z

AI Assistant

Ask a question about the documentation.

Preview theme

Loading theme previews…