feat: Automate llms.txt Generation via GitHub Action #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces an automated process using GitHub Actions to generate and maintain
llms.txt
andllms-full.txt
based on the SDK's Markdown documentation.This follows prior discussion on email regarding this feature. Evaluating the suggestion to utilize the existing Speakeasy generation process revealed that implementing it directly could introduce unnecessary complexity and maintenance overhead compared to a dedicated solution.
Description
This PR introduces an automated process for generating and updating
llms.txt
andllms-full.txt
files based on the project's documentation. This ensures these files remain accurate and up-to-date with minimal manual intervention, improving the project's discoverability and usability for AI agents and language models.Changes Introduced
Python Generation Script (.github/scripts/generate_llms_files.py):
pyproject.toml
.docs/sdks
) for Markdown (.md
) files.llms.txt
:## Sdks Files
) based on the source directory..md
files.llms-full.txt
.--base-url
or relative links otherwise.llms-full.txt
:llms.txt
..md
file under a## Content: <filepath>
heading.GitHub Actions Workflow (.github/workflows/generate-llms-txt.yml):
docs/sdks/**
,pyproject.toml
, the script, or the workflow itself. Also supports manual triggers (workflow_dispatch
).toml
dependency.github.ref
to includerefs/heads/...
).docs/sdks
) and the constructed base URL.stefanzweifel/git-auto-commit-action
to automatically commit changes only tollms.txt
andllms-full.txt
directly to the branch, using thegithub-actions[bot]
user.Benefits
llms.txt
files when documentation changes.llms.txt
specification and correct link/heading formatting.How to Verify
docs/sdks/
on the main branch should trigger the action and result in an automatic commit updatingllms.txt
andllms-full.txt
if necessary.branch name
to.github/workflows/generate-llms-txt.yml
file underon -> push -> paths
.Happy to make any necessary changes based on feedback!