https://github.com/okineadev/vitepress-plugin-llms
📜 A VitePress plugin for generating LLM-friendly documentation
https://github.com/okineadev/vitepress-plugin-llms
documentation llmstxt vite vite-plugin vitepress
Last synced: 3 months ago
JSON representation
📜 A VitePress plugin for generating LLM-friendly documentation
- Host: GitHub
- URL: https://github.com/okineadev/vitepress-plugin-llms
- Owner: okineadev
- License: mit
- Created: 2025-03-14T08:36:54.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-04-05T15:15:58.000Z (3 months ago)
- Last Synced: 2025-04-05T15:22:02.126Z (3 months ago)
- Topics: documentation, llmstxt, vite, vite-plugin, vitepress
- Language: TypeScript
- Homepage: https://npmjs.com/package/vitepress-plugin-llms
- Size: 6.74 MB
- Stars: 37
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome - okineadev/vitepress-plugin-llms - 📜 A VitePress plugin for generating LLM-friendly documentation (TypeScript)
README
# 📜 vitepress-plugin-llms
[](https://www.npmjs.com/package/vitepress-plugin-llms) [](https://npmjs.com/package/vitepress-plugin-llms) [](https://github.com/okineadev/vitepress-plugin-llms/actions/workflows/ci.yml) [](https://bun.sh) [](https://biomejs.dev/) [](https://github.com/okineadev/vitepress-plugin-llms?sponsor=1)
[🐛 Report bug](https://github.com/okineadev/vitepress-plugin-llms/issues/new?template=bug-report.yml) • [Request feature ✨](https://github.com/okineadev/vitepress-plugin-llms/issues/new?template=feature-request.yml)
## 📦 Installation
```bash
npm install vitepress-plugin-llms --save-dev
```## 🛠️ Usage
Add the Vite plugin to your VitePress configuration (`.vitepress/config.ts`):
```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`](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`:
```plaintext
/*.txt /:splat.md 301
/llms.md /llms.txt 301
/llms.txt /llms.txt 200!
/llms-full.md /llms-full.txt 200!
/llms-full.txt /llms-full.txt 200!
```Syntax documentation:
#### Example Configuration
Here is an example of how to configure the plugin with custom settings:
```ts
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:
```plaintext
📂 .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](https://llmstxt.org/) Standard
This plugin follows the [llmstxt.org](https://llmstxt.org/) standard, which defines the best practices for LLM-friendly documentation.
## ✨ Projects where this plugin is used
- [**Slidev**](https://sli.dev/) - **35.7**k+ ⭐ - [llms.txt](https://sli.dev/llms.txt) | [llms-full.txt](https://sli.dev/llms-full.txt)
- [**Elysia**](https://elysiajs.com/) - **11.9**k+ ⭐ - [llms.txt](https://elysiajs.com/llms.txt) | [llms-full.txt](https://elysiajs.com/llms-full.txt)
- [**shadcn/vue**](https://shadcn-vue.com/) - **6.7**k+ ⭐ - [llms.txt](https://shadcn-vue.com/llms.txt) | [llms-full.txt](https://shadcn-vue.com/llms-full.txt)
- [**Vue Macros**](https://vue-macros.dev/) - **1.8**k+ ⭐ - [llms.txt](https://vue-macros.dev/llms.txt) | [llms-full.txt](https://vue-macros.dev/llms-full.txt)
- [**GramIO**](https://gramio.dev/) - **101**+ ⭐ - [llms.txt](https://gramio.dev/llms.txt) | [llms-full.txt](https://gramio.dev/llms-full.txt)## ❤️ Support
If you like this project, consider supporting it by starring ⭐ it on GitHub, sharing it with your friends, or [buying me a coffee ☕](https://github.com/okineadev/vitepress-plugin-llms?sponsor=1)
## 🤝 Contributing
You can read the instructions for contributing here - [CONTRIBUTING.md](./CONTRIBUTING.md)
## 📜 License
[MIT License](./LICENSE) © 2025-present [Yurii Bogdan](https://github.com/okineadev)
## 👨🏭 Contributors
Thank you to everyone who helped with the project!
