Skip to content

Conversation

@dangrondahl
Copy link
Contributor

Summary

Add auto-generated llms.txt support for Kosli documentation following the llms.txt specification. This enables LLMs to better understand and navigate the documentation structure.

Changes

  • Configure Hugo to auto-generate llms.txt in plain text format
  • Create dynamic template that pulls all documentation sections and pages
  • Include frontmatter summaries (200 char limit) for each page
  • List all 92 CLI commands in the Reference section
  • Organize content with main sections and an Optional section for extended context

How it works

The llms.txt file is automatically generated during the Hugo build process:

  • Main sections: Understanding Kosli, Getting Started, Tutorials, Implementation Guide, Administration, Integrations
  • Reference section includes complete CLI command index and API references
  • Optional section provides metadata that can be skipped for shorter context windows
  • Uses frontmatter summary field for page descriptions (falls back to no description if missing)

Files changed

  • docs.kosli.com/config.yaml: Added outputs and outputFormats configuration
  • docs.kosli.com/layouts/index.llms.txt: New Hugo template for generating llms.txt

Testing

Build and verify the output:

make hugo-local
# Check the generated file at docs.kosli.com/public/llms.txt


## Reference
- https://docs.google.com/document/d/171uonXT-eqaqD1iYQaeEPBzQQH8wICC3c1vi-6XcSFM/edit?tab=t.0

Configure Hugo to auto-generate llms.txt file following the llms.txt specification
(https://llmstxt.org). The file provides a structured index of all documentation
sections, including summaries from frontmatter, making it easier for LLMs to
understand the documentation structure and content.

- Add outputFormats configuration in Hugo config for text/plain format
- Create index.llms.txt template with dynamic section generation
- Uses frontmatter summary field for page descriptions
- Includes all 92 CLI commands in Reference section
- Optional section for extended context that can be skipped for shorter windows
@dangrondahl dangrondahl merged commit 69497ff into main Dec 12, 2025
10 checks passed
@dangrondahl dangrondahl deleted the llms-txt-spike branch December 12, 2025 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants