Skip to content
Select theme

llmstxt CLI

llmstxt - a Node.js command-line utility that builds llms.txt and llms-full.txt from sitemap.xml - commands, options, what comes out and what the utility cannot do

Author
dotenvx
Package
llmstxt in the npm registry
Version
0.9.0, March 2026
License
BSD-3-Clause
Checked
October 3, 2026

No installation is needed:

Окно терминала
npx -y llmstxt gen https://example.com/sitemap.xml > llms.txt

Always pass the sitemap address. Without it the utility falls back to a default address that is not yours.

Command What it does
gen builds llms.txt: a list of links with notes
gen-full builds llms-full.txt: the full text of every page as Markdown
Окно терминала
npx -y llmstxt gen-full https://example.com/sitemap.xml > llms-full.txt

gen-full exists in the utility itself but is not mentioned in the project description. To see every command: npx -y llmstxt --help.

The options are the same for both commands.

Option Short What it does
--exclude-path -ep exclude addresses by pattern
--include-path -ip keep only addresses matching a pattern
--replace-title -rt fix titles with a substitution rule
--title -t set the site name
--description -d set the site summary
--concurrency -c number of simultaneous requests, 5 by default
Окно терминала
npx -y llmstxt gen https://example.com/sitemap.xml \
-ep "**/blog/**" \
-ep "**/privacy**" \
-ep "**/cart**" \
-rt 's/ \| My Site//' \
-t 'My Site' \
-d 'Documentation of a delivery service' \
> llms.txt

Here the blog, the policy and the cart are removed from the file, the site-name tail is cut from titles, and the name and summary are set by hand.

# My Site
> Documentation of a delivery service
- [Quick start](https://example.com/docs/start/): the first request and the first order
- [API reference](https://example.com/docs/api/): methods, parameters, error codes

Notes are taken from page descriptions. When descriptions on the site are empty or identical, so are the notes.

  • A sitemap is required. The utility has no other input.
  • Scripts are not run. Pages are fetched with a plain HTTP request. Content that appears only in a browser is invisible to the utility.
  • No sections. The output is one list. Grouping by meaning is done by hand.
  • No selection. Everything not excluded by patterns goes into the file.
  • Links point to HTML. The utility does not create Markdown versions.

It is convenient to run the utility during the site build: the file is then refreshed together with the site.

Окно терминала
npx -y llmstxt gen https://example.com/sitemap.xml -ep "**/cart**" > public/llms.txt

Run it after the new sitemap has been built.

  1. Open the file and read it: are the name and summary there.
  2. Remove service pages with exclusion patterns.
  3. Group the links into sections by hand.
  4. Check the server response and the links.

More: Validating files and markup, best practices, other tools.