---
title: "Ghost: scripts/generate-llms.ts"
description: "Example from scripts/generate-llms.ts: a utility script that generates a family of llms-*.txt context files from MDX documentation pages."
---

# scripts/generate-llms.ts

<Note>
**Ghost doc.** Real utility script at `scripts/generate-llms.ts`.

This is an internal script used to maintain the docs, not a smithers-orchestrator workflow example.
</Note>

## Source

The script is self-contained (~300 lines). It defines its own frontmatter parser, hardcoded manifest arrays, and a `renderPage` helper. No external helper module is imported.

See [`scripts/generate-llms.ts`](https://github.com/smithersai/smithers/blob/main/scripts/generate-llms.ts) for the full source.

## Running

```bash
bun scripts/generate-llms.ts
```

## Key Details

- Follows the `llms.txt` convention: produces a family of text files for AI model context.
- Writes the current `llms-*.txt` bundle set plus version-pinned `llms-v<version>.txt` and `llms-full-v<version>.txt` artifacts for exact-release lookups.
- Pages are listed in hardcoded manifest arrays inside the script; edit the manifests to change what each fragment contains.
- Strips YAML frontmatter; converts MDX bodies to Markdown. Each section is emitted as `## title` + optional blockquote description + raw MDX body, separated by `---`.
