@caelaralabs/llms-txt
v1.0.0
Published
Draft an llms.txt for any website from its sitemap, then audit the live file and AI crawler access in CI.
Maintainers
Readme
@caelaralabs/llms-txt
Draft an llms.txt for any website from its sitemap, audit the published file and the AI crawler rules in robots.txt, and check it in CI.
npx -y @caelaralabs/llms-txt --url example.comNode 20 or newer. No runtime dependencies.
Where requests go: drafting runs on your machine and only contacts the target site. The audit and --check requests are processed by Caelara Labs edge APIs at *.caelaralabs.com (GET https://seo.caelaralabs.com/v1/llms-txt-auditor and /v1/ai-bot-robots-check), with a free 50-call trial key, CAELARA_API_KEY, or x402 USDC payment headers. There is no anonymous free tier: without a key or a payment the API answers HTTP 402.
Draft
npx -y @caelaralabs/llms-txt --url example.com --out ./public/llms.txt- Reads
robots.txtforSitemap:lines, falling back to/sitemap.xml, then the links on the home page. - Fetches the title and meta description of up to 25 pages, four at a time, with a 15 second timeout each.
- Writes a file in the llms.txt shape: an H1 with the site name, a
>summary, and##sections of- [Title](url): descriptionlinks. Pages are grouped by their first path segment; privacy and terms pages go under## Optional.
Review the draft before you publish it. Titles and descriptions come from your pages, so the result is only as good as your metadata.
If CAELARA_API_KEY (or CAELARA_X402_PAYMENT) is set, the tool then audits the live /llms.txt and reports which AI crawlers your robots.txt blocks. Without credentials it still writes the draft, prints how to get access for the audit, and exits 0.
--json prints a single JSON object with draft, audit (llms_txt, ai_bots), billing and error fields.
Check in CI
npx -y @caelaralabs/llms-txt --url example.com --check--check calls the llms.txt auditor for the domain. If the file at --out (default ./public/llms.txt) exists, it also downloads the live /llms.txt and compares the two, ignoring line endings and trailing whitespace.
| Exit code | Meaning | | --- | --- | | 0 | Live llms.txt found, no format issues, and it matches the local file (when there is one) | | 1 | Missing, has format issues, differs from the local file, or the audit could not run | | 2 | Usage error | | 3 | The API refused the request (HTTP 402 or 429). This is a billing or rate limit problem, not a problem with your file |
GitHub Actions step:
- name: Check llms.txt
run: npx -y @caelaralabs/llms-txt --url example.com --check --out ./public/llms.txt
env:
CAELARA_API_KEY: ${{ secrets.CAELARA_API_KEY }}Run it after the deploy step so it compares against the version you just shipped.
Environment
| Variable | Purpose |
| --- | --- |
| CAELARA_API_KEY | Your Caelara key, sent as X-Caelara-Key. Free 50-call trial key: https://caelaralabs.com/shield/#trial |
| CAELARA_X402_PAYMENT | Optional pre-signed x402 payment, sent as X-PAYMENT. This tool never holds a wallet or signs payments. |
| CAELARA_SEO_API_BASE | Points the API calls at a local mock for testing. Only loopback addresses are accepted. |
Access and pricing
When the API answers 402 or 429, the tool prints the three ways to get access:
- Free trial key: 50 calls from https://caelaralabs.com/shield/#trial, set as
CAELARA_API_KEY. - RapidAPI subscription: https://rapidapi.com/caelara-labs-caelara-labs-default/api/caelara-labs-seo-geo-readiness. RapidAPI calls go through RapidAPI's own hosts, not through this tool.
- x402 per call: USDC on Base, 0.005 USDC per audit call. Pass a pre-signed
X-PAYMENTheader inCAELARA_X402_PAYMENT.
A trial key allows about one call per second; a 429 means wait and retry.
License
MIT, Caelara Labs [email protected]
