A docs pipeline. Write MDX once. Get a website for humans, an llms.txt for HTTP agents, an AGENTS.md-fronted bundle for offline coding agents, and a static search index — all from a single source.
flowchart LR
src["docs/*.mdx"]
site_run["leadtype generate"]
bundle_run["leadtype generate --bundle"]
site_out["public/<br/>llms.txt · llms-full.txt<br/>docs/*.md · search-index.json"]
bundle_out["packages/<name>/<br/>AGENTS.md · docs/*.md"]
humans["humans (browser)"]
http_agents["HTTP agents<br/>(/llms.txt or<br/>Accept: text/markdown)"]
search["search UI · AI answers"]
offline_agents["coding agents<br/>(Claude Code, Codex, Cursor,<br/>Copilot…) read<br/>node_modules/<pkg>/AGENTS.md"]
src --> site_run
src --> bundle_run
site_run --> site_out
bundle_run --> bundle_out
site_out --> humans
site_out --> http_agents
site_out --> search
bundle_out --> offline_agents
leadtype is not a docs website framework. Bring your own UI — Next.js, TanStack Start, Astro, anything — and let leadtype handle conversion, validation, search, and the agent-facing outputs that website frameworks don't ship.
- Build a docs site — wire leadtype into your build to convert MDX, index search, and serve markdown to agents.
- Bundle docs into your package — ship
AGENTS.mdplus topic markdown inside the npm tarball so consumers can point agents at version-matched docs innode_modules/<your-package>/.
pnpm add leadtypeFor a hosted docs site:
npx leadtype generate --src . --out public --base-url https://leadtype.devFor an npm-bundled doc set:
npx leadtype generate --bundle --src . --out packages/my-packageThe first produces public/llms.txt, public/llms-full.txt, public/docs/search-index.json, and public/docs/*.md. The second produces packages/my-package/AGENTS.md and packages/my-package/docs/*.md with relative links that still work after npm install.
Full docs at leadtype.dev:
- Quickstart
- How it works
- Build a docs site
- Bundle docs into your package
- Add search
- Frontmatter
- CLI reference
- Methodology — how leadtype differs from Fumadocs, Starlight, and Mintlify
packages/leadtype/— the npm package (CLI + library entry points).apps/example/— production docs site and reference template, on TanStack Start.docs/— the source MDX rendered by both this site and the package's bundled docs.
bun install
bun run dev # build the package, run the pipeline, start the example appPipeline checks:
bun run --filter example pipeline:build
bun run --filter example pipeline:test
bun run --filter example test:e2eMIT.