Publish llms.txt and agents.md with Kimi Code
Publishing llms.txt and agents.md from Kimi Code means asking Moonshot AI's terminal agent to check what your store serves now, generate the discovery files with StoreSEO after you agree they go live, and manage versions if one needs rolling back.
Last updated: October 2026
Set up Kimi Code for StoreSEO
Skip this if Kimi Code is already connected. The full guide, with the alternatives, is on the Kimi Code page.
- 1
Add StoreSEO to Kimi Code
Create or edit ~/.kimi-code/mcp.json so every project on your machine can use StoreSEO. For one repository only, use .kimi-code/mcp.json inside it. You can also run /mcp-config in Kimi Code and have it add the server for you.
json config{ "mcpServers": { "storeseo": { "url": "https://mcp.storeseo.com/mcp" } } } - 2
Sign in to your store
Start a new Kimi Code session (a server added mid-session registers in the next one), run this command, then follow the browser window: pick your Shopify store and approve access.
new message to Kimi Code/mcp-config login storeseo
Step-by-step guide in the docs: How to connect StoreSEO MCP to Kimi Code
How does this work in Kimi Code?
You begin with a question rather than a command: is my llms.txt current, and does my store serve an agents.md. Kimi Code calls storeseo_get_llms_txt_status and storeseo_get_agents_md_status, both reads, and reports the public URLs, the active version and whether your settings changed since the last generation. That gives you a picture of the live state before anyone writes to the theme.
Generation is where the warnings matter. storeseo_generate_llms_txt writes templates/llms.txt.liquid into your live theme and uploads a copy to Shopify Files, with no separate publish step, and it takes a minute or two. storeseo_generate_agents_md spends AI credit, needs at least one published product and publishes live straight away. Kimi Code should say both things before it calls either tool, and you reply in the prompt. After the call it polls storeseo_get_llms_txt_status until generation is no longer ongoing, so you see a finished result rather than a queued one.
A terminal agent adds one useful check: because llms.txt lands in the live theme, a local copy of the theme in your repository will not contain that template until you pull it. Ask Kimi Code to remind you before you push an older theme over it. Version tools cover the rest, and they matter because only the latest ten versions are retained. storeseo_list_llms_txt_versions shows the retained versions, and activating an earlier one is a single call if the newest generation reads badly. Deleting a version cannot be undone, and deleting the active one promotes the next newest, so the agent should say which version will go live before it deletes anything.
-
You: Is my llms.txt up to date? If not, regenerate it.
- storeseo_start read-only
- storeseo_get_llms_txt_status read-only
-
Kimi Code: Your settings changed after the last generation, so a rebuild is due. Generating writes templates/llms.txt.liquid into your live theme and uploads a copy to Shopify Files, and takes a minute or two. Should I run it now?
-
You: Yes, run it.
- storeseo_generate_llms_txt needs approval
- storeseo_get_llms_txt_status read-only
-
Kimi Code: Illustrative result: generation has finished and the new version is active at your public llms.txt address.
What to ask Kimi Code
Tap a prompt to copy it, then paste it into Kimi Code.
What StoreSEO does: llms.txt and agents.md
llms.txt is a curated map of your store for AI crawlers, and agents.md tells AI shopping agents who you are and how to buy. StoreSEO generates both from your store data and publishes them to your live theme; the agent checks status, generates, switches llms.txt versions and resets agents.md to Shopify's default.
Requires: agents.md generation spends AI Content Optimizer credit and needs at least one published product.
- 1
Check what is live
The agent reads the llms.txt status (settings, latest version, whether a rebuild is due, public URL) and the agents.md status (custom file or Shopify's default, public URL).
- 2
Warn before publishing
Generating llms.txt writes a template to your live theme and uploads a copy to Shopify Files in the same run, with no separate publish step. Generating agents.md publishes it live at once and spends credit. The agent says so and waits for your yes.
- 3
Generate and wait
llms.txt generation takes a minute or two; the agent polls the status until it finishes. agents.md returns the published text and its URL straight away.
- 4
Manage versions
StoreSEO keeps the latest ten llms.txt versions. The live file serves the active version, which is not always the newest, and any version can be made active again.
- 5
Roll back
Deleting a version is permanent. Resetting agents.md drops the custom file so Shopify's default serves again, and there is no history to restore it from.
llms.txt and agents.md reference
| llms.txt | Generated from your products, collections, pages and posts; served at your store's /llms.txt |
|---|---|
| Where it is written | A template in the live theme plus a copy in Shopify Files, in the same run |
| Schedule | llms.txt can regenerate on a saved schedule; settings passed with a run are saved for scheduled runs |
| Versions kept | The latest ten; the live file serves the active one |
| Generation time | About one to two minutes for llms.txt |
| agents.md | AI-written from your brand profile, top products, collections and contact details; served at /agents.md |
| agents.md publish | Live immediately; replaces Shopify's native default |
| agents.md reset | Shopify's default serves again within seconds; the custom text is gone for good |
Rules Kimi Code follows
- The agent tells you that llms.txt generation writes to your live theme before it starts.
- agents.md generation publishes live and spends credit, so the agent says both and waits for your yes.
- Deleting an llms.txt version and resetting agents.md cannot be undone; the agent confirms each one.
- Deleting the active llms.txt version promotes the next newest automatically, so the agent says which version will go live.
In Kimi Code
Generation and deletion tools here publish to a live theme or erase versions, so they should not share a permission rule with the status reads. In Kimi Code you can allow the two status tools permanently in config.toml and leave storeseo_generate_llms_txt, storeseo_generate_agents_md, storeseo_delete_llms_txt_version and storeseo_reset_agents_md on ask. A session granted Approve for this session on a generate tool will also run a second generation without a panel.
What runs without asking. Reads such as SEO scores, store listings, settings and Google reports run straight away. Generating a preview spends AI credit but writes nothing, and StoreSEO tells the agent to say what a generation will cost before it runs one. Applying content, optimizing images, changing settings, publishing llms.txt or agents.md, writing a product description and deleting anything wait for your yes in the conversation. That yes is an instruction the agent follows, not a lock on the server, so your client's own tool-approval setting is the hard stop.
Questions
Does generating llms.txt from Kimi Code change my live theme?
Yes. The generation run writes templates/llms.txt.liquid into the live theme and uploads a copy to Shopify Files. StoreSEO tells the agent to warn you before it starts, and Kimi Code's own approval setting is the hard stop.
How do I undo agents.md from Kimi Code?
Ask it to reset agents.md. That removes the custom file so Shopify's native default serves again, but the custom content is discarded with no history, so the agent should confirm first. llms.txt has retained versions you can activate instead.
What is the difference between llms.txt and agents.md?
llms.txt is a curated map of your store for AI crawlers and answer engines, served at /llms.txt. agents.md is the file AI shopping agents read to understand your brand and how to shop with you, served at /agents.md. StoreSEO can generate both.
Does generating llms.txt change my theme?
Yes. The same run writes an llms.txt template into your live theme and uploads a copy to Shopify Files. There is no separate publish step, which is why the agent should warn you before it starts.
Can I go back to an older llms.txt?
Yes. StoreSEO keeps the latest ten versions, and any of them can be made the active one, which republishes it to your storefront. Deleting a version is permanent.
Can I undo a generated agents.md?
You can reset it, which makes Shopify's native default serve again within seconds. The custom text is discarded with no history, so keep a copy if you might want it back.
Keep going
llms.txt and agents.md with other agents
More Kimi Code guides