Détail du package

vitepress-plugin-llms

okineadev3.1kMIT1.1.1

📜 A VitePress plugin for generating LLM-friendly documentation

vitepress, plugin, vite-plugin, vitepress-plugin

readme

📦 Installation

npm install vitepress-plugin-llms --save-dev

🛠️ Usage

Add the Vite plugin to your VitePress configuration (.vitepress/config.ts):

import { defineConfig } from 'vitepress'
import llmstxt from 'vitepress-plugin-llms'

export default defineConfig({
  vite: {
    plugins: [llmstxt()]
  }
})

Now, thanks to this plugin, the LLM version of the website documentation is automatically generated

Plugin Settings

See src/types.d.ts

Redirects (optional, but recommended ✅)

It is recommended to configure redirects so that AI can use addresses with both .md and .txt extensions

Netlify

public/_redirects:

/llms-full.md    /llms-full.txt 200!
/llms-full.txt   /llms-full.txt 200!

Syntax documentation: https://docs.netlify.com/routing/redirects

Example Configuration

Here is an example of how to configure the plugin with custom settings:

import { defineConfig } from 'vitepress'
import llmstxt from 'vitepress-plugin-llms'

export default defineConfig({
  vite: {
    plugins: [
      llmstxt({
        generateLLMsFullTxt: false,
        ignoreFiles: ['sponsors/*'],
        customLLMsTxtTemplate: `# {title}\n\n{foo}`,
        title: 'Awesome tool',
        customTemplateVariables: {
          foo: 'bar'
        }
      })
    ]
  }
})

This configuration does the following:

  • generateLLMsFullTxt: false: Disables the generation of the llms-full.txt file.
  • ignoreFiles: ['sponsors/*']: Ignores all files in the sponsors directory.
  • customLLMsTxtTemplate: Uses a custom template for the llms.txt file.
  • title: Sets a custom header in llms.txt, for your custom variables use customTemplateVariables.
  • customTemplateVariables: Sets custom variables for the template, replaces {foo} with bar.

🚀 Why vitepress-plugin-llms?

LLMs (Large Language Models) are great at processing text, but traditional documentation formats can be too heavy and cluttered. vitepress-plugin-llms generates raw Markdown documentation that LLMs can efficiently process

The file structure in .vitepress/dist folder will be as follows:

📂 .vitepress/dist
├── ...
├── llms-full.txt            // A file where all the website documentation is compiled into one file
├── llms.txt                 // The main file for LLMs with all links to all sections of the documentation for LLMs
├── markdown-examples.html   // A human-friendly version of `markdown-examples` section in HTML format
└── markdown-examples.md     // A LLM-friendly version of `markdown-examples` section in Markdown format

✅ Key Features

  • ⚡️ Easy integration with VitePress
  • ✅ Zero config required, everything works out of the box
  • ⚙️ Customizable
  • 🤖 An LLM-friendly version is generated for each page
  • 📝 Generates llms.txt with section links
  • 📖 Generates llms-full.txt with all content in one file

📖 llmstxt.org Standard

This plugin follows the llmstxt.org standard, which defines the best practices for LLM-friendly documentation.

✨ Projects where this plugin is used

Project Stars llms.txt llms-full.txt
Slidev Stars llms.txt llms-full.txt
Elysia Stars llms.txt llms-full.txt
shadcn/vue Stars llms.txt llms-full.txt
Fantastic-admin Stars llms.txt llms-full.txt
Vue Macros Stars llms.txt llms-full.txt
oRPC Stars llms.txt llms-full.txt
GramIO Stars llms.txt llms-full.txt

GitAds Sponsored

Sponsored by GitAds

❤️ Support

If you like this project, consider supporting it by starring ⭐ it on GitHub, sharing it with your friends, or buying me a coffee ☕

🤝 Contributing

You can read the instructions for contributing here - CONTRIBUTING.md

📜 License

MIT License © 2025-present Yurii Bogdan

👨‍🏭 Contributors

Thank you to everyone who helped with the project!

Contributors

changelog

Changelog

v1.1.1

compare changes

🩹 Fixes

💅 Refactors

  • Import Plugin from vite instead of vitepress (#22)
  • Make it more async (9524c64)

📖 Documentation

  • Use badges to display the GitHub star count (#20)
  • Add oRPC to the list of projects that use this plugin (#21)
  • Add gitads (5f79f81)
  • Fix netlify redirects (cee0ac5)

🏡 Chore

  • Use Prettier for markdown formatting (2006cd5)
  • Migrate to faster bunup (943e1c3)
  • Migrate from Renovate to Dependabot (0e7c9c5)
  • Remove Renovate configuration (013763f)

❤️ Contributors

v1.1.0

compare changes

🚀 Enhancements

  • ✨ clean Markdown with remark by default (5a844f0)

🩹 Fixes

  • Do not add .md extension to each link in llms.txt if generateLLMFriendlyDocsForEachPage option is disabled (577cae6)

🏡 Chore

  • Update TSDoc in generateTOCLink function (343ba46)

❤️ Contributors

v1.0.5

compare changes

🩹 Fixes

  • Move @actions/github-script from optionalDependencies to devDependencies (540768b)

❤️ Contributors

v1.0.4

compare changes

🔥 Performance

  • ⚡speed up file processing with asynchronous processing (20b7298)

🩹 Fixes

  • Do not output files to /guide/index.md, instead output to /guide.md (40c7e7a)

🏡 Chore

  • Add additional keywords to package.json (6c98059)

🤖 CI

  • Create codeql.yml (9357ddb)
  • Fix pr-title.yml and pr-closed.yml triggers (46617e6)

❤️ Contributors

v1.0.3

compare changes

🩹 Fixes

💅 Refactors

  • 📰 improve logging and display approximate token size and size of llms.txt and llms-full.txt files (5e639b5)

🤖 CI

  • Omit optional bun dependencies in tests.yml (686293e)

❤️ Contributors

v1.0.2

compare changes

🩹 Fixes

  • Correctly match sidebar paths and file paths (551610c)
  • Fix check-previous-workflow step in release.yml (1d39493)

❤️ Contributors

v1.0.1

compare changes

🩹 Fixes

  • ci: Fix check-previous-workflow step in release.yml (546aee1)
  • Trim title description in links (16ead9a)

❤️ Contributors

v1.0.0

compare changes

🚀 Enhancements

  • Add option generateLLMFriendlyDocsForEachPage which determines whether to generate LLM-friendly version of documentation for each page (f63d926)
  • Add sidebar option for manual sidebar setting (308bb78)

🔥 Performance

  • ci: Speed up bun package loading speed in tests.yml (62281fe)

🩹 Fixes

  • ci: Fix the path of the script that needs to be loaded in release.yml (0c56c94)
  • Fix title parsing (06a8c2d)
  • ci: Add --ignore-scripts flag for bun install (b120281)
  • Process sidebar according to its original structure (e59d6f5)

💅 Refactors

  • tests: Refactor tests by the DRY principle (e401465)
  • ci: Refactor actions a bit (58dbb41)

🏡 Chore

🤖 CI

  • Add network tweaks for Windows to tests.yml (f2a0dab)
  • More network tweaks for Windows tests (e23e2f7)
  • Skip CI if commit message have [skip-ci] tag (e774e79)

❤️ Contributors

v0.0.22

compare changes

🩹 Fixes

  • ci: Rewrite the script for checking the tests of the current commit that runs release.yml in JS (fb67209)
  • Fix a bug where all child links in the root section were duplicated (17e73ba)
  • Fix a bug where even if you specify a file description in frontmatter, the link in llms.txt still doesn't have a description (2732122)

💅 Refactors

  • ♻️ refactor project structure (f486dac)
  • Insert llms.txt default description in {details} instead of {description} (0352080)

📖 Documentation

🏡 Chore

  • Add .editorconfig (b2886c8)
  • Update MIME type for documentation for LLMs in dev server and add encoding (1bb23bb)

❤️ Contributors

v0.0.21

compare changes

🩹 Fixes

  • Fix bug when vitepress sidebar is an object and section headers in llms.txt are not generated (98bd967)

💅 Refactors

  • ci: Move the script for checking tests in release.yml to a separate file (d534260)

🤖 CI

  • Configure release.yml authentication to allow pushing to the main branch (247fac2)

❤️ Contributors

v0.0.20

compare changes

🚀 Enhancements

  • Simplify the plugin configuration experience (6d9cec3)
  • Add domain option to attach domain to links in llms.txt, llms-full.txt and context links (b05688c)
  • Automatically generate sections according to VitePress sidebar configuration (ff351e5)

🩹 Fixes

  • 🚑 fix missing TOC issue (38736b6)

📖 Documentation

  • Add instructions for configuring Netlify redirects (3765f6f)
  • Add websites that use this plugin to the README (#11)

🏡 Chore

  • Update package description (3518894)
  • Add a note that domain cannot end with / (bee2a73)

🤖 CI

  • Run pkg.pr.new only from this repository (255b024)
  • ♻️ do not run tests in release.yml if they have already been passed in the current commit (1e984b8)
  • Do not trigger pr-title and pr-closed if the author is renovate[bot] (9dc1f29)

❤️ Contributors

v0.0.16

compare changes

🩹 Fixes

  • Fix parsing of titles for TOC in llms.txt (df3b580)
  • Fix templateVariable regexp (00e2ea5)

❤️ Contributors

v0.0.15

compare changes

🚀 Enhancements

  • Add support for link details in llms.txt (2524b6b)

🏡 Chore

❤️ Contributors

v0.0.14

compare changes

🩹 Fixes

  • Fix reading user config (7223cb3)
  • Temporarily remove html stripping (ce8c1c1)

❤️ Contributors

v0.0.13

compare changes

🚀 Enhancements

  • Trim HTML by default for cleaner documentation (bdfff78)

📖 Documentation

  • Add a links for reporting a bug or requesting a feature (6b5a289)

❤️ Contributors

v0.0.12

compare changes

🏡 Chore

❤️ Contributors

v0.0.11

compare changes

🚀 Enhancements

  • Improve extracting headers from files (3facf27)
  • Add support for optional details section and improve variable replacement functionality in the template (b6b8888)

📖 Documentation

  • Add "Contributors" sections in the readme (aa93bb4)
  • Improve readme (0546c31)
  • Fix file tree syntax highlighting (f24a427)

❤️ Contributors

v0.0.10

compare changes

🩹 Fixes

  • Fix error with incorrect reading of frontmatter if index.md is not included in ignoreFiles (7ce7194)

❤️ Contributors

v0.0.9

compare changes

🚀 Enhancements

  • Add new customTemplateVariables option (bd9476b)

🔥 Performance

  • ci: ⚡ try to speed up Windows tests by downgrading runner version to windows-2019 (d0054ab)
  • ci: ⚡ try to speed up Windows tests (again) (2a0f1bd)
  • ci: ⚡ try to speed up Windows tests (94b2b5d)

🩹 Fixes

  • ci: Fix tests.yml (621afde)
  • ci: Fix WINDOWS_USERPROFILE env variable in tests.yml (812be07)
  • ci: Fix tests.yml (e7e1e91)

💅 Refactors

📖 Documentation

  • Fix badge links 🙈 (982b1b6)
  • Add contributing guidelines (7517047)
  • Fix heading in CONTRIBUTING.md (5717e5a)
  • Add a light version of the banner (69589c1)
  • Add example configuration in the readme (2c09116)

🏡 Chore

  • 🗑️ remove unused folders (72e76a6)
  • 🍱 rename assets/banner.png to assets/hero.png (65e06a9)
  • assets: Fix assets/hero-light.png background color (ebef9dc)
  • Use > before description in llms.txt (ef1335f)

🤖 CI

  • 🛡️ improve workflows security (2b92609)
  • 🍎 setup macos tests (c1adebb)
  • Enhance concurrency for auto-cancellation of outdated tests (1438361)
  • Make shorter pkg.pr.new package link (f6001d4)

❤️ Contributors

v0.0.8

compare changes

🩹 Fixes

📖 Documentation

🏡 Chore

  • 💡 improve TSDoc comments (a8b719d)

🤖 CI

  • Replace bun-version-file with bun-version (e614a52)

❤️ Contributors

v0.0.7

compare changes

🩹 Fixes

  • 🚑 fix ignoreFiles (143ac77)
  • 🚑 fix issue with missing title and description when index.md file is excluded (cac5690)

🤖 CI

  • ♻️ optimize workflows (1b069e4)

❤️ Contributors

v0.0.6

compare changes

🩹 Fixes

❤️ Contributors

v0.0.5

compare changes

🚀 Enhancements

  • Add customLLMsTxtTemplate option (65fb933)

📖 Documentation

  • Remove the note that the project is not recommended for use in production because almost all of the plugin's functionality is ready (b366442)

🎨 Styles

  • Minor formatting improvements (5c1f7d3)

❤️ Contributors

v0.0.4

compare changes

🚀 Enhancements

  • Add frontmatter to generated data files for better navigation (180b252)

🩹 Fixes

  • docs: Load banner from GitHub instead of file (132387c)

❤️ Contributors

v0.0.3

compare changes

🚀 Enhancements

  • ci: 🪟 add windows tests (d1e946d)

🩹 Fixes

  • 🛂 use minimatch for ignoring files (a381566)
  • ci: Fix windows tests (17efe5e)
  • Fix TOC link generation to ensure consistent path across OS (#7)
  • ci: Run pkg-pr-new only after all tests (f365ac9)

📖 Documentation

  • 🍱 add banner in the readme (5d4f33b)
  • Use banner with rounded corners (4a7d796)

🏡 Chore

🤖 CI

  • ✅ add reusable tests.yml workflow (8f8a150)

❤️ Contributors

v0.0.2

compare changes

🩹 Fixes

❤️ Contributors

v0.0.1

🚀 Enhancements

  • ⚙️ add ignoreFiles option (#6)

🩹 Fixes

  • Use resolved path when collecting content for llms-full.txt (#3)
  • ci: Run pr title checker workflow only if pr title changed (386e08b)
  • Move .bun-version file to root folder (b66fabf)
  • 🚑 add package main entrypoint in package.json (5ddfbd6)
  • 🐛 fix the issue with folder structure not being saved (b2144cc)
  • 🚑 fix TOC generation (f71808b)

💅 Refactors

  • ♻️ refactor code, fix type errors and improve types (e7002ae)
  • ci: ♻️ rename test.yml to ci.yml (ca1e85c)

📖 Documentation

🏡 Chore

  • Add plugin description in package.json (17a649a)
  • Rename biome.json to biome.jsonc (55c133b)
  • Create bunfig.toml with reccomended settings for Bun (f967959)
  • 🏷️ improve types (b24eda5)

✅ Tests

🤖 CI

  • Add emojis in step names (0920ab6)
  • 🔄️ setup continuous releases with pkg.pr.new (409a809)
  • Fix continuous releases (44cab9e)
  • ♻️ rename ci.yml to test.yml and remove build and publish steps (21aecb0)

❤️ Contributors