# llmstxt CLI: llms.txt and llms-full.txt from a sitemap

> 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

Page: https://llms-full-txt.ru/en/tools/llmstxt-cli/
Site index: https://llms-full-txt.ru/en/llms.txt

[`llmstxt`](https://github.com/dotenvx/llmstxt) reads `sitemap.xml`, visits every page and assembles a list of links with titles and descriptions. The result is printed to the console and redirected into a file.

The utility suits a site that has a sitemap and no ready-made extension.

It does not run page scripts and does not decide what matters on the site. Selection stays with the owner.

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

## Running

No installation is needed:

```bash
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.

## 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 |

```bash
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`.

## 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

```bash
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.

## What comes out

```markdown
# 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.

## 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

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

```bash
npx -y llmstxt gen https://example.com/sitemap.xml -ep "**/cart**" > public/llms.txt
```

Run it after the new sitemap has been built.

## After generation

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](https://llms-full-txt.ru/en/guides/validation/), [best practices](https://llms-full-txt.ru/en/guides/best-practices/), [other tools](https://llms-full-txt.ru/en/tools/generators/).
