How to Keep llms.txt Up to Date

To keep llms.txt up to date, let something rewrite it whenever your docs change: your docs platform, a plugin that runs with each build, or a scheduled job. A file written or downloaded once goes stale because nothing rewrites it. For the scheduled job, this page has a GitHub Actions workflow you can copy. It calls the free llms-txt.io API once a week and commits the new file only when its list of pages has changed.
Checked against each vendor's own pages and GitHub's documentation on 3 December 2026.
If a Docs Platform Hosts Your Docs
Mintlify, GitBook, Fern and ReadMe each generate llms.txt for the sites they host and update it themselves. ReadMe says it "updates it whenever your docs change, so there's nothing to maintain". Mintlify's guide to generating the file lists its version as "Generated from your docs on every deploy".
If the file is stale on ReadMe or Mintlify, look for a custom llms.txt. On both, a custom file takes the place of the generated one. ReadMe's page says: "When using a custom file, your llms.txt will no longer be updated automatically as you make content changes." It says you can turn the custom file off to get the automatic updates back. Mintlify's documentation says "Adding a custom file overrides the automatically generated file of the same name", and "If you delete a custom file, Mintlify restores the automatically generated file."
If Your Site Has a Build Step
A plugin can write the file during the build, so each deploy ships a new one. On VitePress, vitepress-plugin-llms generates it "at build time". On Sphinx, sphinx-llms-txt generates it "during your normal Sphinx build". For Docusaurus, Does Docusaurus Generate llms.txt? compares three community plugins, and Best llms.txt Generators, Tested lists plugins for other frameworks and for WordPress.
Use a plugin if your framework has one. The file then changes in the same deploy as the docs, while a weekly job can leave it up to a week behind.
Keep llms.txt Up to Date With GitHub Actions
The workflow below is for a site with no platform feature and no plugin, or for a file you made once with a generator. Every Monday it asks the llms-txt.io API's generate endpoint for a new llms.txt, compares it with the file in your repository, and commits the new one if the list of links is different. The API is free: an account gets 25 generations a month, and a weekly job uses four or five.
- Create a free llms-txt.io account and make a key under Account → API keys. The key is shown once, so copy it then.
- In your repository on GitHub, open Settings, then Secrets and variables, then Actions. Add the key as a repository secret named
LLMSTXT_KEY. - Save the file below as
.github/workflows/update-llms-txt.yml, setSITE_URLto your live site andLLMS_PATHto where llms.txt sits in the repository, and commit it to your default branch. - On the Actions tab, select Update llms.txt and click Run workflow to run it once by hand.
name: Update llms.txt
on:
schedule:
- cron: "23 4 * * 1"
workflow_dispatch:
permissions:
contents: write
env:
SITE_URL: https://docs.example.com
LLMS_PATH: public/llms.txt
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build a new llms.txt
shell: bash
env:
LLMSTXT_KEY: ${{ secrets.LLMSTXT_KEY }}
run: |
curl -sS --fail-with-body https://llms-txt.io/api/v1/generate \
-X POST \
-H "x-api-key: $LLMSTXT_KEY" \
-H "content-type: application/json" \
-d "{ \"url\": \"$SITE_URL\", \"fileType\": \"llms\", \"regenerate\": true }" \
-o "$RUNNER_TEMP/response.json" \
|| { cat "$RUNNER_TEMP/response.json"; exit 1; }
jq -ej '.llmsTxt' "$RUNNER_TEMP/response.json" > "$RUNNER_TEMP/llms.txt"
- name: Replace the file only if its links changed
id: compare
shell: bash
run: |
links() { grep -oE '\]\([^)]+\)' "$1" | sort -u || true; }
new="$RUNNER_TEMP/llms.txt"
new_count=$(links "$new" | wc -l)
if [ "$new_count" -eq 0 ]; then
echo "The new file has no links. Keeping the current file."
exit 1
fi
if [ -f "$LLMS_PATH" ]; then
old_count=$(links "$LLMS_PATH" | wc -l)
if [ "$((new_count * 2))" -lt "$old_count" ]; then
echo "The new file has $new_count links and the current one has $old_count. Keeping the current file."
exit 1
fi
if [ "$(links "$LLMS_PATH")" = "$(links "$new")" ]; then
echo "Same links as before. Nothing to update."
echo "changed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
fi
mkdir -p "$(dirname "$LLMS_PATH")"
cp "$new" "$LLMS_PATH"
echo "changed=true" >> "$GITHUB_OUTPUT"
- name: Check the new file
if: steps.compare.outputs.changed == 'true'
uses: llms-txt-io/llms-txt-validator@v1
with:
path: ${{ env.LLMS_PATH }}
- name: Commit the new file
if: steps.compare.outputs.changed == 'true'
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add "$LLMS_PATH"
git commit -m "Update llms.txt"
git push
What the Job Does to Your File
Expect the first run to replace your file. The API reads your live site and writes the file from what it finds, so anything you wrote by hand won't be in it. Read that first commit before you rely on the job. A link you add or remove by hand is undone by the next run, and other hand edits last until the list of links next changes.
The new file lists at most 50 pages. On a docs site with hundreds of pages that makes it a partial index, so use a build plugin there if your framework has one.
Later runs commit only when the list of links is different. The API writes a new summary and new descriptions on each call, so the job compares links and ignores wording.
The job stops before it commits if the new file has no links, or fewer than half the links of the current one. That can happen when the API can't read your sitemap. It also happens on a first run if your current file has more than twice as many links as the API finds, and always if it has more than 100, because the new file stops at 50. To take the smaller file anyway, delete the current one from the repository and run the job again. The job also stops if the new file fails a structure check by the open-source llms-txt.io validator Action. Either way, the file in your repository stays as it was.
Make Sure the Commit Reaches Your Site
GitHub doesn't start other workflows for a commit that a workflow pushes with its own token, and its documentation says such a commit doesn't trigger a GitHub Pages build either.
If a workflow deploys your site on push, or GitHub Pages builds it from a branch, the new llms.txt waits in the repository until your next deploy. To send it out at once from a deploy workflow, add workflow_dispatch to that workflow's triggers, add actions: write under permissions: in this one, and end the job with a step that starts the deploy:
- name: Start the deploy
if: steps.compare.outputs.changed == 'true'
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: gh workflow run deploy.yml
Replace deploy.yml with the file name of your deploy workflow. The same documentation says workflow_dispatch events "always create workflow runs". If a service outside GitHub builds your site from the repository, check after the first run that the commit started a build.
If the File Stops Updating
In a public repository, GitHub disables scheduled workflows "when no repository activity has occurred in 60 days". If you add a page and the file hasn't picked it up a week later, open the Actions tab and see whether the workflow has been disabled or its last run failed. A run fails when the month's 25 generations are used up, and the count resets at the start of each month (UTC).
Check the Live File
After the first deploy, enter your site's address in the free llms-txt.io validator. It fetches your published file and samples its links for dead ones.
Frequently Asked Questions
Why does my llms.txt keep going stale? Because nothing rewrites it. A file you wrote by hand or downloaded once doesn't change when the site does. On ReadMe and Mintlify, a custom llms.txt also takes the place of the one the platform would update for you.
How often should llms.txt be updated? Whenever pages are added, removed or moved. A build plugin does that on every build. Mintlify, GitBook, Fern and ReadMe say they update the file for you. The scheduled job on this page runs once a week, so the file can be up to a week behind.
Can GitHub Actions update llms.txt automatically? Yes. A scheduled workflow can call an API that builds the file, then commit the result. GitHub's documentation says that in a public repository, scheduled workflows are disabled after 60 days with no repository activity.
Does the llms-txt.io API also update llms-full.txt? No. The API makes llms.txt and no other file. For llms-full.txt, use the llms-txt.io web generator, which puts up to 20 pages in it.