# Publish llms.txt and agents.md with Gemini CLI

> Use Gemini CLI with StoreSEO to check, generate and roll back your Shopify llms.txt and agents.md from the terminal, with tool confirmations left switched on.

Publishing llms.txt and agents.md with Gemini CLI means asking Google's terminal agent, connected to StoreSEO, to check what your Shopify store serves to AI crawlers, generate both files and roll llms.txt back to an earlier version.

## How do you set up Gemini CLI for this?

### 1. Add StoreSEO to Gemini CLI

Run this in any terminal. The user scope writes the server to ~/.gemini/settings.json so every project sees it. Without --scope user the command writes to the current project's .gemini/settings.json.

```bash
gemini mcp add --scope user --transport http storeseo https://mcp.storeseo.com/mcp
```

### 2. Sign in to your store

Start gemini. The first time it calls StoreSEO it opens your browser: pick your Shopify store and approve access. If the window does not open, type /mcp auth storeseo inside Gemini CLI. Then gemini mcp list should show storeseo as connected.

```text
/mcp auth storeseo
```

### 3. Or edit settings.json (optional)

Add this to ~/.gemini/settings.json for every project, or to .gemini/settings.json in one project. It is the entry gemini mcp add writes: url plus type set to http. The docs page still shows the older httpUrl key for streamable HTTP.

```json
{
  "mcpServers": {
    "storeseo": {
      "url": "https://mcp.storeseo.com/mcp",
      "type": "http"
    }
  }
}
```

### 4. Or connect with an access token (optional)

On a headless machine the browser sign-in cannot run. Generate a token in StoreSEO under Settings, AI Toolkit and pass it as a header. Keep the token out of version control.

```bash
gemini mcp add --scope user --transport http \
  --header "Authorization: Bearer YOUR_TOKEN" \
  storeseo https://mcp.storeseo.com/mcp
```

Then ask: "Use StoreSEO to check my llms.txt and agents.md. Report the live version and public URLs only."

## How does this work in Gemini CLI?

You run gemini in a terminal after adding the StoreSEO server and signing in through the browser. Ask whether the store's llms.txt and agents.md are live and Gemini CLI calls the StoreSEO tools, which it names with an mcp_ prefix and the server name, so storeseo_get_llms_txt_status appears as mcp_storeseo_storeseo_get_llms_txt_status in the tool list. After storeseo_start it reads both statuses and reports the active version, the public URLs and whether a rebuild is due.

Gemini CLI asks you to confirm tool calls unless a server is trusted, which is useful here. When the agent reaches storeseo_generate_llms_txt you see a confirmation prompt, and the agent should already have told you in the conversation that the run writes a template into your live theme and a copy into Shopify Files. The same applies to storeseo_generate_agents_md, which publishes live and spends AI Content Optimizer credit. After generating, it polls storeseo_get_llms_txt_status through the minute or two the run takes, and you can leave the terminal open.

For rollback, ask for the versions and name the one you want. Gemini CLI calls storeseo_list_llms_txt_versions and then storeseo_activate_llms_txt_version, and for deleting a version or resetting agents.md you get both the agent's question and the CLI's confirmation. If you run the CLI over SSH with no browser, the sign-in cannot complete, so use the access token header from Settings, AI Toolkit. Either way, the status checks are a cheap first command in a fresh session, because they confirm the connection and show the live state in one go before you decide whether to generate anything.

### Example session (illustrative)

**You:** Go back to my previous llms.txt, I think the new one is wrong.
→ `storeseo_start` (read-only)
→ `storeseo_list_llms_txt_versions` (read-only)
**Agent:** Version 8 is active and version 7 is the one before it. Activating version 7 republishes it to your storefront and leaves version 8 stored. Shall I activate version 7?
**You:** Yes, version 7.
→ `storeseo_activate_llms_txt_version` (needs approval)
→ `storeseo_get_llms_txt_status` (read-only)

## 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.

Tools: `storeseo_get_llms_txt_status`, `storeseo_generate_llms_txt`, `storeseo_list_llms_txt_versions`, `storeseo_activate_llms_txt_version`, `storeseo_delete_llms_txt_version`, `storeseo_get_agents_md_status`, `storeseo_generate_agents_md`, `storeseo_reset_agents_md`

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

| Setting or limit | What applies |
|---|---|
| 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 Gemini CLI 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 Gemini CLI:** Do not set --trust or trust: true on the storeseo server for this job. Trust skips every tool confirmation, and then the confirmation StoreSEO asks for in chat is the only check before a live theme write or a reset of agents.md. Google's site also says Gemini CLI was replaced by Antigravity CLI on June 18th, 2026 for unpaid tier and Google One users, so confirm which terminal agent your account can use first.

## What can you ask Gemini CLI to do?

- Use StoreSEO to check my llms.txt and agents.md. Report the live version and public URLs only.
- Generate a new llms.txt. Tell me it writes to the live theme, wait for my yes, then poll the status until it is done.
- List my llms.txt versions and reset nothing. I only want to see which one is active.
- Is my llms.txt up to date, and which version is live right now?
- Generate a new llms.txt that includes products and collections but not blog posts. Warn me before it goes live.
- Show me my llms.txt versions and switch back to the one from last week.
- Does my store serve a custom agents.md or Shopify's default?
- Write an agents.md for my store and publish it. Tell me what it costs first.
- Reset agents.md to Shopify's default.

## Frequently asked questions

### Will Gemini CLI ask before it generates llms.txt?

Yes, if you have not trusted the server. Gemini CLI asks you to confirm tool calls by default, and StoreSEO tells the agent to say that generation writes to your live theme and wait for your yes. Trust mode removes the CLI prompt, so leave it off.

### How does Gemini CLI sign in to StoreSEO on a remote machine?

The browser OAuth sign-in needs a browser on the same machine and does not work headless. On a server or over SSH, create a personal access token in Settings, AI Toolkit and send it as an Authorization Bearer header in the server entry.

### 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.

## llms.txt and agents.md with other agents

- [Publish llms.txt and agents.md with Claude](https://storeseo.com/agent/claude/llms-txt-agents-md)
- [Publish llms.txt and agents.md with ChatGPT](https://storeseo.com/agent/chatgpt/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Claude Code](https://storeseo.com/agent/claude-code/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Claude Cowork](https://storeseo.com/agent/claude-cowork/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Cursor](https://storeseo.com/agent/cursor/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Codex](https://storeseo.com/agent/codex/llms-txt-agents-md)
- [Publish llms.txt and agents.md with GitHub Copilot](https://storeseo.com/agent/github-copilot/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Windsurf](https://storeseo.com/agent/windsurf/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Grok](https://storeseo.com/agent/grok/llms-txt-agents-md)
- [Publish llms.txt and agents.md with ChatGPT dots](https://storeseo.com/agent/chatgpt-dots/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Grok Bot](https://storeseo.com/agent/grok-bot/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Muse](https://storeseo.com/agent/muse/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Manus](https://storeseo.com/agent/manus/llms-txt-agents-md)
- [Publish llms.txt and agents.md with OpenClaw](https://storeseo.com/agent/openclaw/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Hermes Agent](https://storeseo.com/agent/hermes-agent/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Paperclip](https://storeseo.com/agent/paperclip/llms-txt-agents-md)
- [Publish llms.txt and agents.md with NanoClaw](https://storeseo.com/agent/nanoclaw/llms-txt-agents-md)
- [Publish llms.txt and agents.md with OpenCode](https://storeseo.com/agent/opencode/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Zed](https://storeseo.com/agent/zed/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Kiro](https://storeseo.com/agent/kiro/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Antigravity](https://storeseo.com/agent/antigravity/llms-txt-agents-md)
- [Publish llms.txt and agents.md with Kimi Code](https://storeseo.com/agent/kimi/llms-txt-agents-md)

## More Gemini CLI guides

- [Gemini CLI and StoreSEO overview](https://storeseo.com/agent/gemini-cli)
- [Audit your store's SEO with Gemini CLI](https://storeseo.com/agent/gemini-cli/seo-audit)
- [Optimize meta tags and content with Gemini CLI](https://storeseo.com/agent/gemini-cli/optimize-meta)
- [Optimize images and alt text with Gemini CLI](https://storeseo.com/agent/gemini-cli/image-seo)
- [Get products ready for AI search with Gemini CLI](https://storeseo.com/agent/gemini-cli/ai-search-readiness)
- [Set up structured data with Gemini CLI](https://storeseo.com/agent/gemini-cli/structured-data)
- [Manage sitemaps and indexing with Gemini CLI](https://storeseo.com/agent/gemini-cli/sitemaps)
- [Track keyword rankings with Gemini CLI](https://storeseo.com/agent/gemini-cli/keyword-tracking)
- [Read Search Console and Analytics with Gemini CLI](https://storeseo.com/agent/gemini-cli/google-reports)
- [Write SEO blog post drafts with Gemini CLI](https://storeseo.com/agent/gemini-cli/blog-posts)

## Related documentation

- [How to generate llms.txt with StoreSEO](https://storeseo.com/docs/how-to-generate-llms-txt-with-storeseo)
- [Optimize your agentic discovery score](https://storeseo.com/docs/how-to-optimize-agentic-discovery-score-storeseo)
- [Set up your store for AI brand visibility](https://storeseo.com/docs/set-up-your-store-for-ai-brand-visibility)

---

Canonical: https://storeseo.com/agent/gemini-cli/llms-txt-agents-md
Last updated: October 2026.

Approval: Reads run straight away; StoreSEO tells the agent to preview and wait for your yes before it writes, spends credit or publishes, and your client's tool-approval setting is the hard stop.

Every agent guide: https://storeseo.com/agent · Connect the MCP server: https://storeseo.com/docs/connect-storeseo-mcp-to-your-ai-assistant · Pricing: https://storeseo.com/pricing · Install StoreSEO: https://apps.shopify.com/storeseo
