Install
Add the package
Section titled “Add the package”This is a Starlight plugin that requires Astro v7+.
pnpm add @nu-appdev/starlight-agent-docsnpm install @nu-appdev/starlight-agent-docsyarn add @nu-appdev/starlight-agent-docsRegister the plugin
Section titled “Register the plugin”Import the plugin in astro.config.mjs and add it to Starlight’s plugins.
import { defineConfig } from "astro/config";import starlight from "@astrojs/starlight";import starlightAgentDocs from "@nu-appdev/starlight-agent-docs";
export default defineConfig({ site: "https://docs.example.com", integrations: [ starlight({ title: "Example Docs", description: "Documentation for Example.", sidebar: [ { label: "Guides", items: [{ autogenerate: { directory: "guides" } }] }, { label: "Reference", items: [{ autogenerate: { directory: "reference" } }] }, ], plugins: [ starlightAgentDocs({ guidance: "Start with the guides before reading the reference.", }), ], }), ],});Check the output
Section titled “Check the output”Build the site. The plugin adds a .md file for each page and an llms.txt to the output directory.
pnpm buildnpm run buildyarn buildDirectorydist/
- llms.txt
- index.md
Directoryguides/
Directorygetting-started/
- index.html
- index.md
During astro dev, the same URLs are served on the fly, and draft pages are included.