Skip to content

Install

This is a Starlight plugin that requires Astro v7+.

Terminal window
pnpm add @nu-appdev/starlight-agent-docs

Import the plugin in astro.config.mjs and add it to Starlight’s plugins.

astro.config.mjs
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.",
}),
],
}),
],
});

Build the site. The plugin adds a .md file for each page and an llms.txt to the output directory.

Terminal window
pnpm build
  • Directorydist/
    • 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.