# Install

> Install starlight-llm-actions and add it to your Starlight site.

`starlight-llm-actions` is a [Starlight plugin](https://starlight.astro.build/reference/plugins/). It works with **Starlight v0.32+** and **Astro v5+**.

## 1. Install the package

* npm

  ```sh
  npm install starlight-llm-actions
  ```

* pnpm

  ```sh
  pnpm add starlight-llm-actions
  ```

* Yarn

  ```sh
  yarn add starlight-llm-actions
  ```

> **Optional dependencies**
>
> The package installs nothing else. One option needs more: setting [`renderMarkdown: 'simple'`](/starlight-llm-actions/guides/markdown-rendering/) to flatten MDX components into plain Markdown pulls in a rendering pipeline you install yourself. Skip it unless you turn that mode on — and if you forget, the build tells you the exact command.

## 2. Add it to your Starlight config

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

**astro.config.mjs**

```js
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](/starlight-llm-actions/actions/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`](/starlight-llm-actions/configuration/providers/#opting-in-to-a-provider).

## 3. Verify the install

Run your dev server and open any docs page:

```sh
npm run dev
```

You should see a button labelled **Copy page** 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](#troubleshooting).

## What gets injected

The plugin does four 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`](/starlight-llm-actions/configuration/reference/#markdownurl)) that serves the page’s body as `text/markdown`. By default it covers Starlight’s `docs` collection; name others in [`collections`](/starlight-llm-actions/configuration/reference/#collections) to publish those too.
3. **Injects `/llms.txt` and the bundle routes**, but only if you opt in with [`llmsTxt`](/starlight-llm-actions/configuration/reference/#llmstxt), which is off by default. With it on you also get `/llms-full.txt` and one `/llms-{subset}.txt` per named subset. See [Site-level indexes](/starlight-llm-actions/guides/llms-txt/).
4. **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

### The dropdown doesn’t appear

* 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](/starlight-llm-actions/guides/per-page-opt-out/).

### “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

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](https://github.com/holdenhewett/starlight-llm-actions/issues). 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

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](/starlight-llm-actions/getting-started/concepts/) — the per-provider strategies, the prompt template, and the auto-injected markdown route.
* [Use cases](/starlight-llm-actions/getting-started/use-cases/) — when to enable each feature and why, with links to a live example for each scenario.
* [Default behavior](/starlight-llm-actions/getting-started/defaults/) — 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](/starlight-llm-actions/configuration/reference/). To hide the dropdown on specific pages, see [Per-page opt-out](/starlight-llm-actions/guides/per-page-opt-out/).