| name | llms-txt-init |
| description | Guide the user to generate an initial llms.txt for a repository using llms-txt-php-cli, choosing sensible defaults and verifying output. |
Goal
Help the user create an initial llms.txt file in their repository using llms-txt-php-cli, then sanity-check that it’s usable.
What you should ask first (if missing)
- Repository root path (or confirm we are in repo root).
- Whether they want to include private/internal docs (default: no).
- Whether they want to include links to READMEs / docs folders (default: yes).
Steps
- Ensure the command is available:
- Prefer running the project-local binary:
php bin/llms-txt-cli ... (or ./bin/llms-txt-cli ... on Unix).
- Run init:
php bin/llms-txt-cli init
- Verify that
llms.txt was created/updated.
- Immediately run validation:
php bin/llms-txt-cli validate
- If validation fails, explain the error and propose the smallest fix.
Output expectations
- A
llms.txt file exists at repo root (unless the user chose another path).
validate succeeds.
Common pitfalls
- Running from the wrong working directory (repo root matters).
- Line endings differences on Windows: keep the file UTF-8, LF preferred if your repo enforces it.
Example
User: “Create an llms.txt for my project.”
Assistant:
- “From the repository root, run
php bin/llms-txt-cli init, then php bin/llms-txt-cli validate and paste any errors.”