koh / sylius-llms-txt
Serves /llms.txt and /llms-full.txt for Sylius, generated from the channel catalogue and content.
Package info
github.com/ohartwig/sylius-llms-txt
Type:sylius-bundle
pkg:composer/koh/sylius-llms-txt
Requires
- php: ^8.5.11
- ext-mbstring: *
- koh/sylius-agent-contracts: ^1.3.1
- psr/cache: ^3.0.0
- sylius/sylius: ^2.2.9 || ^2.3.0
- symfony/config: ^7.4 || ^8.0
- symfony/console: ^7.4 || ^8.0
- symfony/dependency-injection: ^7.4 || ^8.0
- symfony/filesystem: ^7.4 || ^8.0
- symfony/http-foundation: ^7.4 || ^8.0
- symfony/http-kernel: ^7.4 || ^8.0
- symfony/routing: ^7.4 || ^8.0
Requires (Dev)
- koh/dev-sylius: ^1.0
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: ^2.3.1
- phpunit/phpunit: ^11.5.57
- symfony/cache: ^7.4.20
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- v1.1.40
- v1.1.39
- v1.1.38
- v1.1.37
- v1.1.36
- v1.1.35
- v1.1.34
- v1.1.33
- v1.1.32
- v1.1.31
- v1.1.30
- v1.1.29
- v1.1.28
- v1.1.27
- v1.1.26
- v1.1.25
- v1.1.24
- v1.1.23
- v1.1.22
- v1.1.21
- v1.1.20
- v1.1.19
- v1.1.18
- v1.1.17
- v1.1.16
- v1.1.15
- v1.1.14
- v1.1.13
- v1.1.12
- v1.1.11
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- dev-main / 1.0.x-dev
- v1.0.0
This package is auto-updated.
Last update: 2026-10-14 02:50:26 UTC
README
koh/sylius-llms-txt
Serves /llms.txt and /llms-full.txt per llmstxt.org,
generated from the channel's own catalogue and content.
Install
composer require koh/sylius-llms-txt
// config/bundles.php Koh\SyliusLlmsTxt\KohSyliusLlmsTxtBundle::class => ['all' => true],
# config/routes/koh_agent.yaml koh_llms_txt: resource: '@KohSyliusLlmsTxtBundle/config/routes.php'
Configure
# config/packages/koh_llms_txt.yaml koh_llms_txt: summary: 'Cigars, pipe tobacco and accessories, shipped from Germany.' ttl: 3600 taxons: enabled: true title: 'Categories' max_depth: 2 limit: 200 full: max_products: 200 max_bytes: 1048576
A map, not a catalogue
llms.txt lists the shape of the shop — categories, content sections, the
machine-readable endpoints — and stops. A shop with ten thousand products that
lists them all produces a document nobody can use and every crawler truncates.
Products are reachable through the sitemap and the taxon pages listed here.
llms-full.txt is the expanded form: the same document plus product detail,
bounded by both a product count and a byte budget. It stops between
entries and says it stopped — a truncated product reads as a complete one with
missing facts.
Generating
bin/console koh:agent:llms:dump # every enabled channel bin/console koh:agent:llms:dump -c WEB_DE bin/console koh:agent:llms:dump --print # to stdout, stores nothing
/llms.txt is generated on demand behind a cache, so it works without the
command. /llms-full.txt is only ever served from the store: it walks the
catalogue, which is not work to do inside a request an agent controls. Until the
command has run, /llms-full.txt serves the short document rather than 404 —
the link in llms.txt should not dangle.
Run it from cron or a post-deploy hook.
Adding your own sections
Implement LlmsTxtSectionProviderInterface from koh/sylius-agent-contracts.
Container-wide autoconfiguration picks it up, so a service in your own App\
namespace needs no wiring:
final class ArticleSectionProvider implements LlmsTxtSectionProviderInterface { public function getLlmsTxtSection(AgentContext $context): ?LlmsTxtSection { $links = []; foreach ($this->articles->findPublished($context->channel, 100) as $article) { $links[] = new LlmsTxtLink($article->getTitle(), $context->url('/magazin/'.$article->getSlug())); } return [] === $links ? null : new LlmsTxtSection('Magazine', $links, priority: 80); } }
Higher priority sorts earlier. Return null to contribute nothing for a channel.
Caching
Every key goes through AgentContext::cacheKey(), so it carries the channel and
locale. Skipping that is the classic multi-channel bug: one channel warms the
cache and every other channel is served its document — under the wrong hostname,
with the wrong URLs.
Decommission
Remove the composer require, the bundle entry, the route import and
config/packages/koh_llms_txt.yaml, then drop the cron entry. Cached documents
expire on their own; cache:pool:clear cache.app removes them at once.
Security
Report vulnerabilities privately — see SECURITY.md. Advisories are published as CSAF 2.0 at https://ole-hartwig.eu/.well-known/csaf/.
Licence
MIT — see LICENSE.