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 🙏

© 2026 – Pkg Stats / Ryan Hefner

docusaurus-plugin-open-with-llm

v0.1.0

Published

Add an Open with AI menu to Docusaurus docs pages, with Markdown copy and links to ChatGPT and Claude.

Readme

Docusaurus plugin open with LLM

Add an Open with AI menu to every Docusaurus docs page. Readers can copy, view, or download the page as Markdown, or open it as context in ChatGPT or Claude.

The plugin supplies the UI and theme integration. Your site must also publish a Markdown version of each page at <docs-route>/index.md, or at the relative filename you configure with markdownFile.

Install

npm install docusaurus-plugin-open-with-llm

Add the plugin to docusaurus.config.js or docusaurus.config.ts:

export default {
  plugins: ['docusaurus-plugin-open-with-llm'],
}

That's enough to add the menu to docs pages. The default actions are:

  • Copy as Markdown
  • View as Markdown
  • Download as Markdown
  • Open in ChatGPT
  • Open in Claude

Publish Markdown pages

The menu fetches a static Markdown file matching the current docs route. For example:

Docs page:       https://example.com/guides/payments/
Markdown source: https://example.com/guides/payments/index.md

Use a Docusaurus Markdown export plugin or your own build step to create those files. This plugin deliberately doesn't generate Markdown, so it works with whichever exporter already owns that job in your site.

If your exporter uses another filename, set markdownFile:

export default {
  plugins: [
    [
      'docusaurus-plugin-open-with-llm',
      {
        markdownFile: 'page.md',
      },
    ],
  ],
}

Configure the menu

export default {
  plugins: [
    [
      'docusaurus-plugin-open-with-llm',
      {
        buttonLabel: 'Ask an LLM',
        prompt: 'Use {url} as context, then help me understand it.',
        providers: [
          {
            label: 'Open in ChatGPT',
            url: 'https://chatgpt.com/?q={prompt}',
          },
          {
            label: 'Open in Claude',
            url: 'https://claude.ai/new?q={prompt}',
          },
          {
            label: 'Open in Perplexity',
            url: 'https://www.perplexity.ai/search?q={prompt}',
          },
        ],
      },
    ],
  ],
}

| Option | Type | Default | Purpose | | -------------- | ------------------- | ----------------------------------------------------------- | --------------------------------------------------------------- | | enabled | boolean | true | Disable the widget without removing the plugin. | | buttonLabel | string | "Open with AI" | Set the trigger button text. | | markdownFile | string | "index.md" | Set the relative Markdown filename appended to each docs route. | | prompt | string | "Read {url} and answer my questions using it as context." | Set the provider prompt. It must contain {url}. | | providers | ProviderOptions[] | ChatGPT and Claude | Replace the provider links. Each URL must contain {prompt}. |

Setting providers to an empty array leaves only the copy and view actions.

Use the component directly

The plugin automatically wraps DocItem/Layout. If your site already supplies that theme component, the last plugin to register the same theme path wins. Import the widget and place it in your existing wrapper instead:

import OriginalLayout from '@theme-original/DocItem/Layout'
import { OpenWithLlm } from 'docusaurus-plugin-open-with-llm/client'

export default function DocItemLayout(props) {
  return (
    <>
      <OpenWithLlm />
      <OriginalLayout {...props} />
    </>
  )
}

Keep the plugin in plugins when using the component directly. It provides the resolved client configuration.

Development

npm install
npm test
npm run typecheck
npm run lint
npm run build

Run the example Docusaurus site with:

npm run example:start

For a dependency-free visual preview of the widget, run npm run preview:start and open http://127.0.0.1:4173.

License

MIT