Skip to content

Install

starlight-llm-actions is a Starlight plugin. It works with Starlight v0.32+ and Astro v5+.

Terminal window
npm install starlight-llm-actions

Drop the plugin into the plugins array of your Starlight integration in astro.config.mjs:

astro.config.mjs
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import starlightLlmActions from 'starlight-llm-actions';
export default defineConfig({
integrations: [
starlight({
title: 'My Docs',
plugins: [starlightLlmActions()],
}),
],
});

That’s it. The dropdown now appears next to the page title on every content page, with these defaults:

  • Copy as Markdown ✅ on
  • View as Markdown ✅ on
  • Download as PDF ❌ off (see Print PDF)
  • Open in… ✅ on, with five providers enabled by default (ChatGPT, Claude, Gemini, GitHub Copilot, Perplexity). Eleven more (Cursor, T3 Chat, DeepSeek, DuckDuckGo, Grok, HuggingChat, Kagi, Mistral, Phind, You.com, Google AI Studio) are off by default; opt in via providers.

Run your dev server and open any docs page:

Terminal window
npm run dev

You should see a button labelled Page actions next to the page heading. Open it and try:

  • Copy as Markdown — copies the page’s .md source to your clipboard.
  • View as Markdown — navigates to the page’s raw markdown URL.
  • Open in ChatGPT — opens ChatGPT with a prefilled prompt.

If the dropdown doesn’t appear, see Troubleshooting.

The plugin does three things behind the scenes:

  1. Overrides PageTitle.astro so the dropdown can render next to your page title without you touching component overrides yourself.
  2. Injects a markdown route at /[slug].md (configurable via markdownUrl) that serves the page’s body as text/markdown.
  3. Bundles provider icons (Simple Icons CC0; a generic chat-bubble glyph for providers without a Simple Icons mark) and the small client-side script that runs the per-provider strategy.
  • Check that starlightLlmActions() is in the plugins array of starlight(), not the top-level integrations array.
  • Make sure no other Starlight plugin overrides PageTitle.astro. The last plugin to override a component wins; load starlightLlmActions() after any plugin that does not care about page-title content.
  • Check the page frontmatter for llmActions: false — that opts the page out. See Per-page opt-out.

”Cannot find module ‘starlight-llm-actions/route’”

Section titled “”Cannot find module ‘starlight-llm-actions/route’””

Your bundler can’t resolve the package’s subpath export. Make sure your package.json has "type": "module" (Astro projects do by default) and that starlight-llm-actions is in dependencies, not devDependencies.

The plugin ships SVGs in its icons/ folder and references them via Astro’s asset pipeline. If you’ve configured an unusually strict vite.assetsInclude filter, ensure .svg is still included.

The rest of Getting started walks the natural flow from “how it works” to “when to change it” to a one-page reference of the defaults:

  • Concepts — the per-provider strategies, the prompt template, and the auto-injected markdown route.
  • Use cases — when to enable each feature and why, with links to a live example for each scenario.
  • Default behavior — a single-table cheat sheet of every default the plugin applies out of the box.

For the full surface area of options, see the Configuration reference. To hide the dropdown on specific pages, see Per-page opt-out.