📜 vitepress-plugin-llms
📦 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 thellms-full.txt
file.ignoreFiles: ['sponsors/*']
: Ignores all files in thesponsors
directory.customLLMsTxtTemplate
: Uses a custom template for thellms.txt
file.title
: Sets a custom header inllms.txt
, for your custom variables usecustomTemplateVariables
.customTemplateVariables
: Sets custom variables for the template, replaces{foo}
withbar
.
🚀 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 | llms.txt | llms-full.txt | |
Elysia | llms.txt | llms-full.txt | |
shadcn/vue | llms.txt | llms-full.txt | |
Fantastic-admin | llms.txt | llms-full.txt | |
Vue Macros | llms.txt | llms-full.txt | |
oRPC | llms.txt | llms-full.txt | |
GramIO | llms.txt | llms-full.txt |
GitAds Sponsored
❤️ 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!