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
Running
Section titled “Running”No installation is needed:
npx -y llmstxt gen https://example.com/sitemap.xml > llms.txtAlways pass the sitemap address. Without it the utility falls back to a default address that is not yours.
Commands
Section titled “Commands”| 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.txtgen-full exists in the utility itself but is not mentioned in the project description. To see every command: npx -y llmstxt --help.
Options
Section titled “Options”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 |
An example with selection
Section titled “An example with selection”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.txtHere 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.
What comes out
Section titled “What comes out”# 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 codesNotes are taken from page descriptions. When descriptions on the site are empty or identical, so are the notes.
Limits
Section titled “Limits”- 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.
Refreshing on a schedule
Section titled “Refreshing on a schedule”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.txtRun it after the new sitemap has been built.
After generation
Section titled “After generation”- Open the file and read it: are the name and summary there.
- Remove service pages with exclusion patterns.
- Group the links into sections by hand.
- Check the server response and the links.
More: Validating files and markup, best practices, other tools.