Install
starlight-llm-actions is a Starlight plugin.
It works with Starlight v0.32+ and Astro v5+.
1. Install the package
Section titled “1. Install the package”npm install starlight-llm-actionspnpm add starlight-llm-actionsyarn add starlight-llm-actions2. Add it to your Starlight config
Section titled “2. Add it to your Starlight config”Drop the plugin into the plugins array of your Starlight integration in
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.
3. Verify the install
Section titled “3. Verify the install”Run your dev server and open any docs page:
npm run devYou should see a button labelled Page actions next to the page heading. Open it and try:
- Copy as Markdown — copies the page’s
.mdsource 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.
What gets injected
Section titled “What gets injected”The plugin does three things behind the scenes:
- Overrides
PageTitle.astroso the dropdown can render next to your page title without you touching component overrides yourself. - Injects a markdown route at
/[slug].md(configurable viamarkdownUrl) that serves the page’s body astext/markdown. - 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.
Troubleshooting
Section titled “Troubleshooting”The dropdown doesn’t appear
Section titled “The dropdown doesn’t appear”- Check that
starlightLlmActions()is in thepluginsarray ofstarlight(), not the top-levelintegrationsarray. - Make sure no other Starlight plugin overrides
PageTitle.astro. The last plugin to override a component wins; loadstarlightLlmActions()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.
Provider icons are missing
Section titled “Provider icons are missing”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.
Next steps
Section titled “Next steps”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.