Composable context for LLM-readable websites.
Turn any website into a structured, selectable content map that AI agents can read in 2 requests:
- Read the map — a hierarchical index with token counts and descriptions
- Fetch exactly what's needed — compose a single URL with the sections you want
No more dumping an entire site into one file. No more useless tables of contents. Just the content the AI actually needs.
npx llmsmap-txt generate --url https://yoursite.com --key YOUR_FIRECRAWL_API_KEYThis crawls your site and produces a .llmsmap/ directory:
.llmsmap/
├── llmsmap.txt # The map (hierarchical index)
├── manifest.json # Full metadata for all sections
├── content/ # Pre-rendered markdown per page
│ ├── _root.md
│ ├── docs.md
│ ├── docs/
│ │ ├── getting-started.md
│ │ └── api-reference.md
│ └── ...
└── fetch/ # Deployable endpoint handlers
├── vercel.js
├── worker.js
├── express.js
└── README.md
Request 1 — Read the map:
GET https://yoursite.com/llmsmap.txt
# Your Site
> Description of your site.
> Fetch endpoint: https://yoursite.com/llms/fetch
> Usage: GET https://yoursite.com/llms/fetch?sections=/path1,/path2&format=md
> Total: ~45,000 tokens | 23 pages
---
## /docs/getting-started ~3,000 tokens Updated 2026-01-15
> Quickstart tutorials for integrating the platform.
## /docs/api-reference ~18,000 tokens Updated 2026-02-01
> Complete endpoint documentation with examples.
### /docs/api-reference/auth ~5,000 tokens Updated 2026-01-28
> OAuth2 flows, API keys, and token management.
### /docs/api-reference/payments ~8,000 tokens Updated 2026-02-01
> Creating charges, refunds, and payment intents.Request 2 — Fetch the sections it needs:
GET https://yoursite.com/llms/fetch?sections=/docs/api-reference/auth,/docs/api-reference/payments&format=md
Returns the full markdown content for just those sections.
npm install -g llmsmap-txtOr use directly with npx:
npx llmsmap-txt generate --url https://example.com --key fc-your-keyCrawl a site and produce the .llmsmap/ output.
llmsmap-txt generate --url https://example.com --key YOUR_KEY| Flag | Description | Default |
|---|---|---|
--url <url> |
Site URL to crawl | from config |
--key <key> |
Firecrawl API key | $FIRECRAWL_API_KEY |
--output <dir> |
Output directory | .llmsmap |
--include <patterns...> |
URL patterns to include | all |
--exclude <patterns...> |
URL patterns to exclude | admin, api, login |
--max-pages <n> |
Maximum pages to crawl | 100 |
--config <path> |
Config file path | auto-detected |
Create a config file interactively.
llmsmap-txt init --url https://example.com --key YOUR_KEYStart a local dev server to test the output.
llmsmap-txt serve --port 3456Endpoints:
GET /llmsmap.txt— the indexGET /manifest.json— full metadataGET /llms/fetch?sections=/path1,/path2&format=md— fetch content
Create llmsmap.config.json in your project root:
{
"url": "https://yoursite.com",
"firecrawlApiKey": "fc-your-key",
"outputDir": ".llmsmap",
"exclude": ["/admin/*", "/api/*", "/login*", "/sitemap.xml"],
"maxPages": 100,
"maxDepth": 5,
"siteName": "Your Site",
"siteDescription": "What your site is about"
}Also supports llmsmap.config.js and llmsmap.config.mjs.
Resolution order: CLI flags > environment variables > config file > defaults.
Environment variables:
FIRECRAWL_API_KEY— Firecrawl API keyLLMSMAP_URL— Site URL
GET /llms/fetch?sections=/docs/auth,/docs/payments&format=md&updated_after=2026-01-01
| Param | Type | Description |
|---|---|---|
sections |
comma-separated paths | Sections to fetch (required) |
format |
md | txt | json |
Output format (default: md) |
updated_after |
ISO date | Only return sections updated after this date |
<!-- llmsmap-txt fetch | 2 sections | 13000 tokens -->
--- section: /docs/auth ---
title: Authentication
tokens: 5000
lastUpdated: 2026-01-28
---
[full markdown content]
--- section: /docs/payments ---
title: Payments
tokens: 8000
lastUpdated: 2026-02-01
---
[full markdown content]{
"sections": [
{
"path": "/docs/auth",
"title": "Authentication",
"tokenCount": 5000,
"lastUpdated": "2026-01-28",
"content": "..."
}
],
"totalTokens": 5000
}The generate command produces ready-to-deploy handlers in .llmsmap/fetch/.
- Copy
.llmsmap/topublic/.llmsmap/ - Copy
fetch/vercel.jstoapi/llms/fetch.js - Deploy
- Upload
.llmsmap/contents to KV or R2 - Deploy
fetch/worker.jswith the storage binding
import { llmsmapFetch } from './fetch/express.js'
app.use('/llms/fetch', llmsmapFetch({ baseDir: '.llmsmap' }))No endpoint needed — serve llmsmap.txt and the content/ files statically. The AI can construct direct file URLs from the map.
import { generate, loadConfig, crawlSite, buildTree, countTokens } from 'llmsmap-txt'
// Full pipeline
const config = await loadConfig({ url: 'https://example.com', key: 'fc-...' })
const stats = await generate(config)
// Or use individual modules
import { createHandler } from 'llmsmap-txt/handler'
const handler = createHandler('.llmsmap')
const response = handler({ sections: '/docs,/api', format: 'json' })- Crawl — Firecrawl's crawl API discovers all pages by following links and converts HTML to clean markdown
- Index — URLs are organized into a hierarchical tree with token counts rolled up to parent nodes
- Generate — Produces
llmsmap.txt(the map),manifest.json(metadata), individual content files, and deployable fetch handlers - Serve — The fetch endpoint resolves requested sections to content files and returns composed markdown
- Node.js 18+
- Firecrawl API key (free tier available)
MIT