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.txtandllms-full.txtbased 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.txtandllms-full.txtfiles 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..mdfiles.llms-full.txt.--base-urlor relative links otherwise.llms-full.txt:llms.txt..mdfile 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).tomldependency.github.refto includerefs/heads/...).docs/sdks) and the constructed base URL.stefanzweifel/git-auto-commit-actionto automatically commit changes only tollms.txtandllms-full.txtdirectly to the branch, using thegithub-actions[bot]user.Benefits
llms.txtfiles when documentation changes.llms.txtspecification 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.txtandllms-full.txtif necessary.branch nameto.github/workflows/generate-llms-txt.ymlfile underon -> push -> paths.Happy to make any necessary changes based on feedback!