stolt / llms-txt-php-cli
A CLI for writing, reading, and validating llms.txt Markdown files.
Installs: 0
Dependents: 0
Suggesters: 1
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=8.1
- ext-curl: *
- stolt/llms-txt-php: ^2.0
- symfony/console: ^7.3
Requires (Dev)
- dg/bypass-finals: ^1.9
- friendsofphp/php-cs-fixer: ^3.70.1
- peckphp/peck: ^0.1.2
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.4.4
- stolt/lean-package-validator: ^4.4
- zenstruck/console-test: ^1.7
README
This CLI supports you in creating and validating llms.txt Markdown files via the console.
Installation and usage
composer require --dev stolt/llms-txt-php-cli
Available commands
The following list command call shows the currently available commands.
bin/llms-txt-cli list llms-txt-cli 1.0.0 Available commands: check-links Check links of a llms.txt file info Get metadata info of a llms.txt file init Create an initial llms txt.file validate Validate the given llms txt.file
Validating a llms.txt file
bin/llms-txt-cli validate tests/fixtures/uv.llms.md The provided llms.txt file tests/fixtures/uv.llms.md is valid.
or
bin/llms-txt-cli validate https://docs.astral.sh/uv/ The delivered llms.txt file from https://docs.astral.sh/uv/ is valid.
A llms.txt
file is considered valid, when a title, description, details, and at least one section
with at least one link are available.
Getting metadata of a llms.txt file
bin/llms-txt-cli info tests/fixtures/uv.llms.md { "sections": 7, "links": 45, "last_modification": "26.06.2025 06:38:45", "file": { "name": "tests\/fixtures\/uv.llms.md", "path": "\/home\/vagrant\/workspace\/oss\/llms-txt-php-cli\/tests\/fixtures\/uv.llms.md", "size": "4.07K" } }
Initialising a llms.txt file
bin/llms-txt-cli init [<llms-txt-file>] Created llms.txt file llms.txt. cat llms.txt # Init title > Init description Init details ## Init section - [Init URL](http://init.org)
If no llms-txt-file
name is provided, it defaults to llms.txt
.
Checking the links of a llms.txt file
bin/llms-txt-cli check-links tests/fixtures/uv.llms.md All links are reachable.
Running tests
composer test
License
This library is licensed under the MIT license. Please see LICENSE.md for more details.
Changelog
Please see CHANGELOG.md for more details.
Contributing
Please see CONTRIBUTING.md for more details.