npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2025 – Pkg Stats / Ryan Hefner

vitepress-plugin-llms

v1.9.3

Published

πŸ“œ A VitePress plugin for generating LLM-friendly documentation

Readme

πŸ“œ vitepress-plugin-llms

NPM Downloads NPM Version Tests Status Built with Bun Formatted with Biome sponsor

πŸ› Report bug β€’ Request feature ✨

πŸ“¦ 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

[!NOTE]

For repositories with documentation in other languages: Please do not use this plugin, only English documentation is enough for LLMs.


[!TIP] You can add πŸ“‹ Copy as Markdown and πŸ“₯ Download as Markdown buttons for each page so that visitors can copy the page in Markdown format with just one click!

First, register a global component with buttons in docs/.vitepress/theme/index.ts:

import DefaultTheme from 'vitepress/theme'
import type { Theme } from 'vitepress'
import CopyOrDownloadAsMarkdownButtons from 'vitepress-plugin-llms/vitepress-components/CopyOrDownloadAsMarkdownButtons.vue'

export default {
  extends: DefaultTheme,
  enhanceApp({ app }) {
    app.component('CopyOrDownloadAsMarkdownButtons', CopyOrDownloadAsMarkdownButtons)
  }
} satisfies Theme

And tell VitePress to use an additional Markdown plugin that will insert them:

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

export default defineConfig({
  // ...
  markdown: {
    config(md) {
      md.use(copyOrDownloadAsMarkdownButtons)
    }
  }
})

βœ… Good practices

1. Use description in the pages frontmatter

Typically, the list of pages in llms.txt is generated like this:

- [Tailwind v4](/docs/tailwind-v4.md)

As you can see, it's not very clear what's on this page and what it's for

But you can insert description in frontmatter in the docs/tailwind-v4.md file:

---
description: How to use shadcn-vue with Tailwind v4.
---

...

And the link in the generated llms.txt will display the page description:

- [Tailwind v4](/docs/tailwind-v4.md): How to use shadcn-vue with Tailwind v4.

Plugin Settings

See src/types.d.ts or

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'
        },
        experimental: {
          depth: 2 // Generate llms.txt and llms-full.txt in root and first-level subdirectories
        }
      })
    ]
  }
})

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.
  • experimental: { depth: 2 }: Generates both llms.txt and llms-full.txt files in the root directory and all first-level subdirectories, with each directory containing only files from that specific directory and its subdirectories.

Embedding content specifically for LLMs with <llm-only> tag

You can add a content that will be visible in files for LLMs, but invisible to humans, this can be useful for setting special instructions like "Refer to #basic-queries for demonstrations", "NEVER do ....", "ALWAYS use ... in case of ..." etc.

To do this, you need to wrap content with the <llm-only> tag:

<llm-only>

## Section for LLMs

This content appears only in the generated LLMs files without the `<llm-only>` tag
</llm-only>

Or

Check out the Plugins API Guide for documentation about creating plugins.

<llm-only>Note for LLM...</llm-only>

Excluding content for LLMs with the <llm-exclude> tag

You can add a content that will be visible in files for humans, but invisible to LLMs, opposite of <llm-only>:

<llm-exclude>
## Section for humans

This content will not be in the generated files for LLMs
</llm-exclude>

Or

Check out the Plugins API Guide for documentation about creating plugins.

<llm-exclude>Note only for humans</llm-exclude>

πŸš€ 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 | | -------------------------------------------------------- | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------: | :-------------------------------------------------------------: | | Vite | Stars | llms.txt | llms-full.txt | | Vue.js | Stars | llms.txt | llms-full.txt | | Slidev | Stars | llms.txt | llms-full.txt | | Elysia | Stars | llms.txt | llms-full.txt | | Rolldown | 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 | | tsdown | Stars | llms.txt | llms-full.txt | | GramIO | Stars | llms.txt | 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 β˜•

🀝 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

Sponsors