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 Copy page 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 four 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. By default it covers Starlight’sdocscollection; name others incollectionsto publish those too. - Injects
/llms.txtand the bundle routes, but only if you opt in withllmsTxt, which is off by default. With it on you also get/llms-full.txtand one/llms-{subset}.txtper named subset. See Site-level indexes. - Bundles provider icons (Simple Icons CC0 and Lobe Icons MIT; a generic chat-bubble glyph for the few providers neither set carries a mark for) 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”T3 Chat and You.com intentionally show a generic chat-bubble glyph — no icon
set carries an official mark for them. Point providers.<id>.icon at your own
asset to replace it.
If a provider you did not override renders a blank space where its icon should
be, that is a bug in the plugin rather than a configuration problem; please
open an issue.
If you set a custom icon, it must be a filename the plugin bundles, an
absolute URL, or a root-relative path such as /icons/foo.svg. Any other
string resolves to nothing and renders an empty slot.
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.