Skip to content
Back to search

dispatchseo

Turn your AI agent into your SEO manager - works today with Claude Code, Codex, and Cursor. The open-source alternative to SEObot and Outrank

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026. Its scripts were only partly scanned.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/NeoZi12/dispatchseo with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/NeoZi12/dispatchseo'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/neozi12--dispatchseo/badge.svg)](/listings/neozi12--dispatchseo)

HTML

<a href="/listings/neozi12--dispatchseo"><img src="/api/listings/neozi12--dispatchseo/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 39 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. {
  2. "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
  3. "name": "dispatchseo",
  4. "owner": {
  5. "name": "NeoZi12",
  6. "url": "https://github.com/NeoZi12"
  7. },
  8. "metadata": {
  9. "description": "DispatchSEO - self-hostable AGPL SEO manager backend for coding agents"
  10. },
  11. "plugins": [
  12. {
  13. "name": "dispatchseo",
  14. "source": "./claude-plugin",
  15. "description": "Connect Claude Code to your DispatchSEO project - SEO keyword research, content queue, and SERP rank tracking over MCP",
  16. "version": "1.0.0",
  17. "author": {
  18. "name": "NeoZi12",
  19. "email": "neozi2014@gmail.com",
  20. "url": "https://github.com/NeoZi12"
  21. },
  22. "homepage": "https://dispatchseo.com",
  23. "repository": "https://github.com/NeoZi12/dispatchseo",
  24. "license": "AGPL-3.0",
  25. "keywords": [
  26. "seo",
  27. "search-console",
  28. "keyword-research",
  29. "content-pipeline",
  30. "rank-tracking",
  31. "backlinks",
  32. "self-hosted",
  33. "claude-code"
  34. ],
  35. "category": "productivity",
  36. "tags": ["seo", "content", "search-console", "marketing", "automation"]
  37. }
  38. ]
  39. }
README.md · README · 282 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <p align="center">
  2. <a href="https://dispatchseo.com">
  3. <img src="src/app/icon.png" width="116" alt="DispatchSEO logo">
  4. </a>
  5. </p>
  6. <h1 align="center">DispatchSEO</h1>
  7. <p align="center">
  8. <a href="LICENSE"><img alt="License: AGPL-3.0" src="https://img.shields.io/badge/license-AGPL--3.0-7C5CFC?labelColor=1F2328&style=flat-square"></a>
  9. <a href="docs/AGENTS.md"><img alt="Built for Claude Code, Codex, and Cursor" src="https://img.shields.io/badge/built%20for-Claude%20Code%20%2B%20Codex%20%2B%20Cursor-D97757?labelColor=1F2328&style=flat-square"></a>
  10. <a href="https://dispatchseo.com/docs#choose-your-install"><img alt="Self-host in one command" src="https://img.shields.io/badge/self--host-one%20command-2496ED?logo=docker&logoColor=white&labelColor=1F2328&style=flat-square"></a>
  11. <a href="https://dispatchseo.com/discord"><img alt="Join the Discord" src="https://img.shields.io/badge/Discord-join%20the%20server-5865F2?logo=discord&logoColor=white&labelColor=1F2328&style=flat-square"></a>
  12. </p>
  13. <div align="center">
  14. <strong>
  15. <h2>Free SEO automation: researched articles, published to your site on autopilot</h2><br />
  16. <a href="https://dispatchseo.com">DispatchSEO</a>: an open-source alternative to SEObot, Outrank and RightBlogger.<br /><br />
  17. </strong>
  18. DispatchSEO researches keywords with real search demand, writes fact-checked articles and publishes them for you,<br />as pull requests to your GitHub repo, then shows the Google visitors they bring.<br />
  19. It works with any website that lives in a GitHub repo, including <a href="https://dispatchseo.com/lovable">sites built with Lovable</a>.<br />
  20. Two articles per month are free on <a href="https://dispatchseo.com">dispatchseo.com</a>, no card. Paid plans publish 5, 15 or 30 articles per month on up to 5 websites.<br /><br />
  21. Self-hosting it instead? The whole thing runs in your own accounts, driven by <b>Claude Code</b>, <b>Codex</b>, or <b>Cursor</b> over MCP, including the unattended overnight builder.
  22. </div>
  23. <div align="center">
  24. <br />
  25. <img alt="Claude Code" src="docs/brand/icons/claude.svg" width="32">
  26. &nbsp;
  27. <img alt="Codex" src="docs/brand/icons/openai.svg" width="32">
  28. &nbsp;
  29. <img alt="Cursor" src="docs/brand/icons/cursor.svg" width="32">
  30. &nbsp;
  31. <img alt="MCP" src="docs/brand/icons/mcp.svg" width="32">
  32. &nbsp;
  33. <img alt="GitHub" src="docs/brand/icons/github.svg" width="32">
  34. &nbsp;
  35. <img alt="Google Search Console" src="docs/brand/icons/search-console.svg" width="32">
  36. &nbsp;
  37. <img alt="Google" src="docs/brand/icons/google.svg" width="32">
  38. &nbsp;
  39. <img alt="Docker" src="docs/brand/icons/docker.svg" width="32">
  40. </div>
  41. <p align="center">
  42. <br />
  43. <a href="https://dispatchseo.com/docs#choose-your-install"><img src="docs/buttons/install.svg" alt="Install now" height="46"></a>
  44. &nbsp;
  45. <a href="https://dispatchseo.com/docs"><img src="docs/buttons/docs.svg" alt="Read the docs" height="46"></a>
  46. </p>
  47. <p align="center">
  48. <a href="https://dispatchseo.com">Website</a>
  49. &nbsp;&middot;&nbsp;
  50. <a href="https://dispatchseo.com/discord">Discord</a>
  51. &nbsp;&middot;&nbsp;
  52. <a href="https://github.com/NeoZi12/dispatchseo/discussions">Discussions</a>
  53. &nbsp;&middot;&nbsp;
  54. <a href="https://dispatchseo.com">Hosted version</a>
  55. </p>
  56. <p align="center"><i>Self-hosted has zero feature limitations. Everything the paid<br />cloud does, this repo does today, in your own accounts, at $0.</i></p>
  57. <br />
  58. ## ⚡ How it works
  59. 1. **Your AI researches.** The Claude app at claude.ai, or a coding agent
  60. (Claude Code, Codex, Cursor), connects to DispatchSEO over MCP,
  61. reads the served playbook, and mines keywords from your Search Console
  62. data, Google Autocomplete, and what it already knows about your product.
  63. Ideas land in a queue with the reasoning attached.
  64. 2. **You approve, or don't.** Each idea is a card on the dashboard: the
  65. keyword, why it's winnable, the angle. Approve, reject, or reorder.
  66. Prefer full autopilot? Flip on auto mode and skip the queue entirely.
  67. 3. **The pipeline builds.** Every morning a scheduled job picks the oldest
  68. approved idea and builds it into a real pull request against your site's
  69. repo: a guide or a small free tool, checked against the live SERP and run
  70. through a sameness reviewer so page twelve doesn't read like page three.
  71. 4. **It tracks what happened.** Daily rank checks, hourly Search Console
  72. snapshots, index verification, and a journey view that tells you which
  73. SEO stage you're actually in. When a scheduled job breaks, you get a red
  74. banner and an email instead of silence.
  75. The backend is deliberately boring: state, scheduling, and an approval gate.
  76. The thinking happens in your agent, where your product knowledge already
  77. lives.
  78. <table>
  79. <tr>
  80. <td colspan="2"><img src="docs/screenshots/home.png" alt="The dashboard Home: the agent's daily briefing in plain language, the journey stage, publishing pace, and live Search Console stats for a connected site"></td>
  81. </tr>
  82. <tr>
  83. <td><img src="docs/screenshots/queue.png" alt="The queue: keyword ideas with volume and difficulty, each waiting for approval or set to auto"></td>
  84. <td><img src="docs/screenshots/guide-pr.png" alt="A pull request the pipeline built: target keyword, SERP gate verdict, archetype, and information-gain asset, all named in the description"></td>
  85. </tr>
  86. <tr>
  87. <td><img src="docs/screenshots/search-traffic.png" alt="Search traffic: clicks and impressions from Google Search Console, snapshotted hourly"></td>
  88. <td><img src="docs/screenshots/rankings.png" alt="Keyword rankings: daily position checks with 30-day trend sparklines"></td>
  89. </tr>
  90. </table>
  91. ## 🤖 Which coding agent
  92. DispatchSEO talks to your agent over MCP, so "which agent" is a real question
  93. with a real answer — including the parts that aren't finished yet.
  94. | Agent | Connect + every tool | Unattended overnight builder |
  95. |---|---|---|
  96. | **Claude Code** | ✅ | ✅ |
  97. | **Codex** | ✅ | ✅ |
  98. | **Cursor** | ✅ one-paste connect, all 61 tools | ✅ via its API key (any plan mints one) |
  99. | Gemini CLI · Copilot · any MCP client | ✅ | ❌ |
  100. Connecting is one paste and gets you the whole tool set: research, the queue,
  101. approvals, backlinks, reports, and building a guide when you ask for one. The
  102. overnight builder is the separate thing — scheduled jobs that run an agent with
  103. nobody watching — and all three do that. Every workflow carries every agent
  104. and asks the dashboard which to run, so switching agent takes effect on the
  105. next scheduled run with no repo change.
  106. The honest difference is who pays: Claude Code runs on a subscription you
  107. already have, Cursor runs on your Cursor plan's API key, and Codex is
  108. metered by OpenAI per run.
  109. You can also skip coding agents entirely. Add DispatchSEO to the ordinary
  110. Claude app at claude.ai as a custom connector and your Claude does the research
  111. and the writing on the subscription you already have, then hands the article
  112. back for the backend to check, finish and publish. It won't build interactive
  113. tools or run the overnight builder, and claude.ai has to be able to reach your
  114. install, so that path wants a public URL rather than a laptop. ChatGPT can't
  115. connect yet.
  116. [docs/AGENTS.md](docs/AGENTS.md) has the details, the support tiers, and how to
  117. add an agent.
  118. ## ✅ What you need before you start
  119. - **Somewhere to publish.** Either WordPress you host yourself, connected once
  120. from Settings with an application password and posted to directly, or your
  121. site's source in a GitHub repo, where content arrives as pull requests. Wix,
  122. Squarespace, Shopify, Webflow and Ghost have neither door and won't work.
  123. - **An AI to drive it.** Your AI is the engine, and it can be the ordinary
  124. Claude app at claude.ai or a coding agent. Claude Code runs on the Claude
  125. subscription you already pay for; Codex and Cursor do everything Claude Code
  126. does here, including the overnight builder. Codex is metered by OpenAI per
  127. run, and Cursor builds draw on your Cursor plan's included usage. See the table above.
  128. - **A machine with Docker** (~1 GB RAM). A laptop works for a test drive, but
  129. a machine that stays on is much better for daily use - a $5 VPS, a Raspberry
  130. Pi, a desktop that never sleeps. Schedules only run while the machine is awake.
  131. - **Google Search Console access** to your site.
  132. That's the whole list. No API keys to buy, and no account on our side.
  133. ## 📖 Documentation
  134. Everything is at **[dispatchseo.com/docs](https://dispatchseo.com/docs)** - every
  135. page, every setting, every tool.
  136. | | |
  137. | --- | --- |
  138. | **New here** | [What DispatchSEO is](https://dispatchseo.com/docs/introduction) · [How it works](https://dispatchseo.com/docs/how-it-works) · [Cloud or self-hosted](https://dispatchseo.com/docs/choosing-how-to-run-it) |
  139. | **Install** | [Quickstart](https://dispatchseo.com/docs#choose-your-install) - your own computer, a VPS, or from source |
  140. | **Set up** | [Install Claude Code](https://dispatchseo.com/docs/install-claude-code) · [Install Codex](https://dispatchseo.com/docs/install-codex) · [Install Cursor](https://dispatchseo.com/docs/install-cursor) · [The setup wizard](https://dispatchseo.com/docs/setup-wizard) · [Search Console](https://dispatchseo.com/docs/search-console) · [Keyword data](https://dispatchseo.com/docs/keyword-data) · [Publishing](https://dispatchseo.com/docs/publishing) · [Connect your site](https://dispatchseo.com/docs/connect-your-site) |
  141. | **Use it** | [Day to day](https://dispatchseo.com/docs/day-to-day) · [The dashboard](https://dispatchseo.com/docs/dashboard) · [Automations](https://dispatchseo.com/docs/automations) · [Agent commands](https://dispatchseo.com/docs/agent-commands) |
  142. | **Reference** | [Concepts](https://dispatchseo.com/docs/concepts) · [MCP tools](https://dispatchseo.com/docs/mcp-tools) · [Environment variables](https://dispatchseo.com/docs/environment-variables) · [Schedules](https://dispatchseo.com/docs/schedules) · [Architecture](https://dispatchseo.com/docs/architecture) |
  143. | **Help** | [Troubleshooting](https://dispatchseo.com/docs/troubleshooting) · [Common questions](https://dispatchseo.com/docs/faq) · [Security](https://dispatchseo.com/docs/security) · [Upgrading](https://dispatchseo.com/docs/upgrading) |
  144. **Pointing an agent at this?** Add `.md` to any docs URL for clean markdown, or
  145. fetch the entire documentation set in one request:
  146. **[llms-full.txt](https://dispatchseo.com/llms-full.txt)**. There's an index at
  147. [llms.txt](https://dispatchseo.com/llms.txt) and a [SKILL.md](SKILL.md) that
  148. walks an agent through connecting a site.
  149. **Stuck during setup?** The
  150. [troubleshooting page](https://dispatchseo.com/docs/troubleshooting) covers the
  151. errors people actually hit. If yours isn't there, ask in the
  152. [Discord](https://dispatchseo.com/discord) or in
  153. [Discussions](https://github.com/NeoZi12/dispatchseo/discussions) - questions get
  154. answered and usually turn into a docs fix.
  155. ## 🗓️ Using it day to day
  156. Once the wizard is done, the loop is small on purpose:
  157. | When | You do | It does |
  158. | --- | --- | --- |
  159. | Once a week, 5 minutes | Open the dashboard, work through the queue - approve, reject, reorder | Refills the queue with researched ideas and the reasoning behind each one |
  160. | Every morning | Nothing | Builds the oldest approved idea into a pull request on your repo |
  161. | When a PR lands | Review and merge (or let auto-merge do it) | Logs the page, requests indexing, starts tracking its keyword |
  162. | Whenever you want | Ask your agent: *"research keywords for me"*, *"what should I write next?"*, *"how are we ranking?"* | Answers from live data over MCP - same state the dashboard shows |
  163. The dashboard's Home page always names the next action, so you don't have to work
  164. out what to do when you open it.
  165. ## 🧰 What's in the box
  166. - **MCP server** with [the full tool set](https://dispatchseo.com/docs/mcp-tools): the
  167. queue, keywords, rankings, pages, GSC stats, backlink prospects, trend
  168. topics, site profile. Anything the dashboard can do, your agent can do over
  169. MCP; parity between the two is a hard rule in this codebase.
  170. - **Trend radar**: scan for rising topics in your niche, expand a topic into
  171. concrete guide angles, and queue the good ones.
  172. - **Guide and tool builders**: guides publish at most one per day, flat and
  173. permanent (so a queue of thirty approved ideas doesn't become thirty posts
  174. in a week); free-tool ideas build on approval.
  175. - **Backlink playbook**: a prospect list prefilled with your product's copy,
  176. tracked per submission.
  177. - **Multi-site**: one deployment manages any number of sites. Each project
  178. gets its own MCP token, its own data, its own settings.
  179. - **A password-gated dashboard** for the one human in the loop.
  180. ## 💵 What it costs to run
  181. Nothing, unless you want paid data. The tiers stack:
  182. | Tier | Price | What you get |
  183. | --- | --- | --- |
  184. | Search Console only | **$0** | Rankings from GSC, keyword ideas from Autocomplete plus your own impression data |
  185. | + SerpApi free key | **$0** | Live SERP checks, real positions weekly (250 free searches/month) |
  186. | + DataForSEO | pay per call | Search volume, keyword difficulty, domain rating |
  187. Free mode finds keywords you can win. Paid mode also knows which ones are
  188. worth winning.
  189. ## ☁️ Cloud version
  190. There's a hosted version for people who'd rather not run a machine: we host it,
  191. bundle the SERP + volume data into one bill, and replace the Google
  192. service-account ritual with one click. It's at
  193. [dispatchseo.com](https://dispatchseo.com). Self-hosting stays feature-complete
  194. either way - the cloud sells convenience, not capability.
  195. ## 🧑‍💻 Developing from source
  196. ```bash
  197. git clone https://github.com/NeoZi12/dispatchseo
  198. cd dispatchseo
  199. pnpm install
  200. cp .env.local.example .env.local
  201. pnpm dev
  202. ```
  203. This is the contributor path, not the way to self-host - that's the one-command
  204. Docker install behind the button at the top. Fill in `.env.local` (Supabase +
  205. the three secrets) before starting, then open the dashboard on
  206. **localhost:3000**.
  207. `pnpm build` is the typecheck - run it before opening a PR. There is no
  208. separate lint or test setup.
  209. ## 🏗️ Architecture, briefly
  210. Next.js App Router, Postgres for state (a bundled container when self-hosted,
  211. Supabase in the cloud version), `mcp-handler` for the MCP server at `/api/mcp`.
  212. Schedules and builds run in-stack (cron + builder containers) or on GitHub
  213. Actions. One deployment is multi-tenant: the MCP bearer token selects the
  214. project, crons loop over all projects, the dashboard switches with a cookie.
  215. [Architecture](https://dispatchseo.com/docs/architecture) covers this properly.
  216. [CLAUDE.md](CLAUDE.md) has the full conventions; it's written for agents, which
  217. turns out to make it decent documentation for people.
  218. ## 🤝 Contributing
  219. Issues before PRs, and you must understand every line you submit, including the
  220. AI-assisted ones. Details in [CONTRIBUTING.md](CONTRIBUTING.md). Questions go to
  221. [Discussions](https://github.com/NeoZi12/dispatchseo/discussions) or the
  222. [Discord](https://dispatchseo.com/discord); vulnerabilities go through
  223. [private reporting](SECURITY.md).
  224. ## 📄 License
  225. [AGPL-3.0](LICENSE). Use it, self-host it, fork it. If you run a modified
  226. version as a service, share the source. That's the whole deal.
  227. ---
  228. <p align="center">
  229. <sub>Built by <a href="https://github.com/NeoZi12">NeoZi12</a> · If DispatchSEO is useful to you, a ⭐ helps other people find it.</sub>
  230. </p>
docker/cron/entrypoint.sh · Bundled script · 12 lines · 1 finding marked
  1. #!/bin/sh
  2. # Snapshot the env vars the cron jobs need (crond runs jobs with a stripped
  3. # environment), then run BusyBox crond in the foreground so container logs
  4. # show every hit.
  5. {
  6. echo "CRON_SECRET='${CRON_SECRET}'"
  7. echo "APP_INTERNAL_URL='${APP_INTERNAL_URL:-http://app:3000}'"
  8. } > /etc/cron-env
    • Note: Quoted as data in code: Sets up something that runs again on its own (cron, launchd, systemd, startup entry or shell profile) and fetches from the network
    • Line 8 on GitHub
  9. chmod 600 /etc/cron-env
  10. echo "[cron] schedule loaded:"
  11. cat /etc/crontabs/root
  12. exec crond -f -l 8 -L /dev/stdout
public/install.sh · Bundled script · 58 lines · 1 finding marked
  1. #!/bin/sh
  2. # DispatchSEO one-line installer:
  3. #
  4. # curl -fsSL https://dispatchseo.com/install.sh | sh
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 4 on GitHub
  5. #
  6. # What it does, in order - each step skips itself if already done:
  7. # 1. Installs Docker if missing (Linux only, via get.docker.com; on Mac
  8. # and Windows it points you at Docker Desktop instead).
  9. # 2. Fetches the repo into ./dispatchseo (git clone, or a tarball when
  10. # git isn't installed), or updates an existing clone.
  11. # 3. Runs start.sh, which handles everything else and prints your
  12. # dashboard URL.
  13. #
  14. # Safe to re-run any time; re-running is also the upgrade command.
  15. set -e
  16. REPO="https://github.com/NeoZi12/dispatchseo"
  17. if ! command -v docker >/dev/null 2>&1; then
  18. case "$(uname -s)" in
  19. Linux)
  20. echo "Docker isn't installed - installing it with Docker's official script..."
  21. curl -fsSL https://get.docker.com | sh
  22. ;;
  23. *)
  24. echo "Docker isn't installed. Install Docker Desktop first:"
  25. echo " https://docs.docker.com/get-docker/"
  26. echo "then run this command again."
  27. exit 1
  28. ;;
  29. esac
  30. fi
  31. if [ -d dispatchseo/.git ]; then
  32. echo "Existing install found in ./dispatchseo - updating it."
  33. # Never let a failed update stop the stack from BOOTING. Under `set -e` a
  34. # pull that isn't fast-forwardable (a fork with local commits, a hand-edited
  35. # file, a diverged clone) aborted this script before `sh start.sh` below, so
  36. # the documented upgrade one-liner left the user's stack down with nothing but
  37. # a raw git error. start.sh tolerates exactly this for the same reason;
  38. # GIT_TERMINAL_PROMPT=0 stops a credential prompt hanging an unattended run.
  39. GIT_TERMINAL_PROMPT=0 git -C dispatchseo pull --ff-only ||
  40. echo " Couldn't fast-forward (local changes?) - booting the version that's here."
  41. elif [ -d dispatchseo ]; then
  42. echo "./dispatchseo exists (tarball install) - refreshing the snapshot."
  43. curl -fsSL "$REPO/archive/refs/heads/main.tar.gz" | tar xz
  44. cp -R dispatchseo-main/. dispatchseo/
  45. rm -rf dispatchseo-main
  46. elif command -v git >/dev/null 2>&1; then
  47. git clone "$REPO"
  48. else
  49. echo "git isn't installed - downloading a snapshot instead."
  50. curl -fsSL "$REPO/archive/refs/heads/main.tar.gz" | tar xz
  51. mv dispatchseo-main dispatchseo
  52. fi
  53. cd dispatchseo
  54. sh start.sh
public/setup.sh · Bundled script · 479 lines · 2 findings marked
  1. #!/bin/bash
  2. # DispatchSEO one-command setup.
  3. # Run from INSIDE your website's repo, with the line your dashboard gives you:
  4. # curl -fsSL https://dispatchseo.com/setup.sh | bash -s -- <project-key> <slug> [backend-url] [bundled] [agent]
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 4 on GitHub
  5. #
  6. # What it does, in order: checks your folder + tools, connects your coding
  7. # agent in this folder to your DispatchSEO project, saves the GitHub Actions
  8. # secrets (each value VERIFIED before it is stored), enables PR permissions,
  9. # then hands off to that agent.
  10. #
  11. # Every value is verified before it is saved - this script prefers stopping
  12. # loudly over storing something broken. Reads answers from /dev/tty so it
  13. # works when piped from curl.
  14. #
  15. # AGENT (5th argument, default claude) picks which coding agent gets connected
  16. # and which builder credential is collected. It defaults so that every command
  17. # handed out before this argument existed keeps doing exactly what it did.
  18. # Both agents get the same pipeline: the workflow files carry both and resolve
  19. # which to run from the dashboard at run time.
  20. set -o pipefail
  21. TOKEN="${1:-}"
  22. SLUG="${2:-project}"
  23. BASE="${3:-https://dispatchseo.com}"
  24. BUNDLED="${4:-0}"
  25. AGENT="${5:-claude}"
  26. case "$AGENT" in
  27. claude) AGENT_CLI="claude"; AGENT_NAME="Claude Code" ;;
  28. codex) AGENT_CLI="codex"; AGENT_NAME="Codex" ;;
  29. cursor) AGENT_CLI="cursor-agent"; AGENT_NAME="Cursor" ;;
  30. *) printf '\n!! Unknown agent "%s". Supported: claude, codex, cursor.\n\n' "$AGENT"; exit 1 ;;
  31. esac
  32. say() { printf '%s\n' "$*"; }
  33. hr() { say "-----------------------------------------------"; }
  34. die() { printf '\n!! %s\n\n' "$*"; exit 1; }
  35. ask() { REPLY=""; read -r REPLY < /dev/tty; }
  36. say ""
  37. say "==============================================="
  38. say " DispatchSEO setup - about 3 minutes"
  39. say "==============================================="
  40. say ""
  41. [ -n "$TOKEN" ] || die "No project key given. Copy the FULL command from your DispatchSEO dashboard - it includes your key."
  42. # ---- 1. Right folder? ------------------------------------------------------
  43. git rev-parse --is-inside-work-tree >/dev/null 2>&1 || \
  44. die "This folder is not a git repository. Open a terminal INSIDE your website's repo (the one DispatchSEO publishes to) and run the command again."
  45. ORIGIN_URL=$(git remote get-url origin 2>/dev/null) || \
  46. die "This repo has no 'origin' remote. cd into your website's GitHub repo and run the command again."
  47. REPO=$(printf '%s' "$ORIGIN_URL" | sed -E 's#^(git@github\.com:|https://github\.com/)##; s#\.git$##')
  48. say "Step 1 of 5 - checking this folder."
  49. say " Detected repo: $REPO"
  50. say " Is that your WEBSITE's repo - the one your site deploys from? [y/n]"
  51. ask
  52. [ "$REPLY" = "y" ] || [ "$REPLY" = "Y" ] || \
  53. die "No problem - cd into the right folder and run the same command again."
  54. # ---- 2. Tools --------------------------------------------------------------
  55. say ""
  56. say "Step 2 of 5 - checking your tools."
  57. if ! command -v "$AGENT_CLI" >/dev/null 2>&1; then
  58. case "$AGENT" in
  59. claude) die "Claude Code isn't installed. Install it first (https://claude.com/claude-code), then rerun." ;;
  60. codex) die "Codex isn't installed. Install it first (npm i -g @openai/codex, or see https://developers.openai.com/codex/cli), then rerun." ;;
  61. cursor) die "Cursor's CLI isn't installed. Install it first (curl https://cursor.com/install -fsS | bash), make sure ~/.local/bin is on your PATH, then rerun." ;;
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 70 on GitHub
  62. esac
  63. fi
  64. command -v gh >/dev/null 2>&1 || \
  65. die "The GitHub CLI (gh) isn't installed. Install it (macOS: brew install gh), run 'gh auth login', then rerun."
  66. gh auth status >/dev/null 2>&1 || \
  67. die "The GitHub CLI isn't logged in. Run 'gh auth login', then rerun."
  68. say " All tools present."
  69. # ---- 3. Connect the agent to your project ----------------------------------
  70. say ""
  71. # "in this folder" is Claude's line and stays exactly as it was - it is true
  72. # because of --scope local. Codex must NOT claim it: its config is global, and
  73. # the per-project server name is what keeps two sites apart.
  74. # Cursor joins Claude on the "in this folder" line: its config is
  75. # .cursor/mcp.json, read relative to the directory the agent runs in, so it is
  76. # genuinely folder-scoped. Only Codex has to omit the claim.
  77. if [ "$AGENT" = "codex" ]; then
  78. say "Step 3 of 5 - connecting $AGENT_NAME to your project."
  79. else
  80. say "Step 3 of 5 - connecting $AGENT_NAME in this folder to your project."
  81. fi
  82. code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 30 -X POST "$BASE/api/mcp" \
  83. -H "Authorization: Bearer $TOKEN" \
  84. -H "Content-Type: application/json" \
  85. -H "Accept: application/json, text/event-stream" \
  86. -d '{"jsonrpc":"2.0","id":0,"method":"tools/list"}')
  87. [ "$code" = "200" ] || \
  88. die "Your project key was rejected (HTTP $code). Keys change when a project is recreated - copy the CURRENT command from the dashboard and run it instead."
  89. NAME="dispatchseo-$SLUG"
  90. if [ "$AGENT" = "claude" ]; then
  91. # --scope local pins this connection to THIS folder. Without it a connection
  92. # can end up at user scope and leak into every project the owner opens
  93. # Claude Code in - an owner with several projects connected would then have
  94. # all of them active at once in an unrelated repo, and the install
  95. # workflow's repo-remote check would keep failing against the wrong
  96. # project's token. Scope local on both remove and add so a stray user-scope
  97. # entry from an older run gets found and cleaned up too.
  98. claude mcp remove --scope local "$NAME" >/dev/null 2>&1
  99. claude mcp remove --scope user "$NAME" >/dev/null 2>&1
  100. # Name immediately after `add`: the CLI's parser is order-fragile
  101. # (anthropics/claude-code#2341 - options before the name can throw
  102. # "missing required argument 'name'").
  103. claude mcp add "$NAME" "$BASE/api/mcp" --transport http --scope local \
  104. --header "Authorization: Bearer $TOKEN" >/dev/null 2>&1 || \
  105. die "Could not add the connection to Claude Code (claude mcp add failed)."
  106. elif [ "$AGENT" = "codex" ]; then
  107. # Codex has no scope flag at all - `codex mcp add` always writes the config
  108. # Codex calls global. The per-project server NAME is what keeps two projects
  109. # from shadowing each other, and every prompt we hand the agent names its
  110. # server literally. No remove step: unlike Claude's, this add overwrites an
  111. # existing entry of the same name instead of erroring.
  112. #
  113. # The key rides in the URL rather than in --bearer-token-env-var, which takes
  114. # the NAME of an environment variable - that variable would then have to
  115. # exist in every shell the owner ever launches Codex from, and a missing one
  116. # fails at tool-call time with nothing pointing at the cause.
  117. codex mcp add "$NAME" --url "$BASE/api/mcp?key=$TOKEN" >/dev/null 2>&1 || \
  118. die "Could not add the connection to Codex (codex mcp add failed). Check 'codex --version' - the mcp subcommand needs a recent build."
  119. elif [ "$AGENT" = "cursor" ]; then
  120. # Cursor has NO `mcp add` command - its whole mcp surface is
  121. # login/list/list-tools/enable/disable, so connecting means writing the
  122. # config file. Merged rather than overwritten: .cursor/mcp.json is the
  123. # owner's file and may already hold other servers.
  124. mkdir -p .cursor
  125. command -v node >/dev/null 2>&1 || \
  126. die "node isn't installed, and Cursor's connection is a JSON file this script edits with it. Install Node (https://nodejs.org), then rerun."
  127. CURSOR_NAME="$NAME" CURSOR_URL="$BASE/api/mcp" CURSOR_TOKEN="$TOKEN" node -e '
  128. const fs=require("fs"),f=".cursor/mcp.json";
  129. const c=fs.existsSync(f)?JSON.parse(fs.readFileSync(f,"utf8")):{};
  130. c.mcpServers=c.mcpServers||{};
  131. c.mcpServers[process.env.CURSOR_NAME]={url:process.env.CURSOR_URL,headers:{Authorization:"Bearer "+process.env.CURSOR_TOKEN}};
  132. fs.writeFileSync(f,JSON.stringify(c,null,2)+"\n");
  133. ' >/dev/null 2>&1 || \
  134. die "Could not write .cursor/mcp.json - check the folder is writable and any existing .cursor/mcp.json is valid JSON."
  135. # Approval is part of connecting, not an afterthought: an unapproved server
  136. # is not merely unreachable, it is ABSENT - Cursor starts with zero tools and
  137. # says "not loaded (needs approval)".
  138. cursor-agent mcp enable "$NAME" >/dev/null 2>&1 || \
  139. die "Wrote the connection but could not approve it (cursor-agent mcp enable failed). Run 'cursor-agent mcp enable $NAME' in this folder and rerun."
  140. fi
  141. say " Connected (key verified against the server)."
  142. [ "$AGENT" = "codex" ] && \
  143. say " Tired of approving every call? $BASE/docs/install-codex shows the one config line that stops the prompts for this server."
  144. # Let the agent actually use gh. Claude Code gates terminal commands, and gh
  145. # is not allowed by default - so the install agent's FIRST step (gh auth
  146. # status, the same check this script passed at step 2) gets blocked. That
  147. # block cannot be lifted from the chat: telling the agent "you have my
  148. # permission" never reaches the gate, and the agent correctly refuses to
  149. # grant itself the rule by editing this file. Left to the owner it is a
  150. # dead stop on step one, right after paying. So write it here, where we
  151. # already know they want DispatchSEO driving gh in this repo.
  152. #
  153. # Additive on purpose: an existing settings.local.json belongs to the owner,
  154. # so we merge into it and never clobber it. Without a JSON tool we print the
  155. # line instead of risking their file.
  156. #
  157. # Claude only. Codex has no permissions file to pre-write: it asks for approval
  158. # at the moment it wants to run something and the owner answers, so there is no
  159. # dead stop to prevent - and writing an allowlist for an agent that does not
  160. # read one would be a comforting no-op.
  161. SETTINGS=".claude/settings.local.json"
  162. GH_RULE='Bash(gh *)'
  163. # Only Claude Code has a pre-grantable allowlist file. Codex and Cursor both
  164. # ask at the moment they want to run something, and the owner answers.
  165. [ "$AGENT" = "claude" ] && mkdir -p .claude 2>/dev/null
  166. if [ "$AGENT" != "claude" ]; then
  167. say " $AGENT_NAME asks before it runs a command - approve the gh ones when it does."
  168. elif [ ! -f "$SETTINGS" ]; then
  169. ( printf '%s\n' '{' ' "permissions": {' ' "allow": ["Bash(gh *)"]' ' }' '}' > "$SETTINGS" ) 2>/dev/null \
  170. && say " Allowed Claude Code to run gh in this folder ($SETTINGS)." \
  171. || say " ! Could not write $SETTINGS - if the agent stalls on a gh command, add \"$GH_RULE\" to its permissions.allow."
  172. elif grep -Fq "$GH_RULE" "$SETTINGS" 2>/dev/null; then
  173. say " Claude Code may already run gh here - left $SETTINGS alone."
  174. elif command -v python3 >/dev/null 2>&1; then
  175. python3 - "$SETTINGS" "$GH_RULE" <<'PY' 2>/dev/null && say " Allowed Claude Code to run gh in this folder (added to your $SETTINGS)." \
  176. || say " ! Could not update $SETTINGS - add \"$GH_RULE\" to permissions.allow yourself if the agent stalls on a gh command."
  177. import json, sys
  178. path, rule = sys.argv[1], sys.argv[2]
  179. with open(path) as f:
  180. data = json.load(f)
  181. if not isinstance(data, dict):
  182. raise SystemExit(1)
  183. perms = data.setdefault("permissions", {})
  184. allow = perms.setdefault("allow", [])
  185. if not isinstance(allow, list):
  186. raise SystemExit(1)
  187. if rule not in allow:
  188. allow.append(rule)
  189. with open(path, "w") as f:
  190. json.dump(data, f, indent=2)
  191. f.write("\n")
  192. PY
  193. else
  194. say " ! $SETTINGS exists and python3 isn't available to merge into it."
  195. say " Add \"$GH_RULE\" to its permissions.allow, or the agent will stall on its first gh command."
  196. fi
  197. # ---- 4. GitHub secrets - every value verified before it is stored ----------
  198. say ""
  199. say "Step 4 of 5 - the GitHub secrets your automations run on."
  200. printf '%s' "$TOKEN" | gh secret set SEO_MCP_API_KEY --repo "$REPO" || \
  201. die "Could not save a secret to $REPO - does your GitHub login have admin access to it?"
  202. say " Project key saved."
  203. # The builder credential, per agent. Every one is VERIFIED against the real
  204. # provider before it is stored - the rule everywhere in this script - because
  205. # a saved-but-broken credential reads as "automatic builds are set up" and only
  206. # announces itself as a failed run at 05:13 the next morning.
  207. if [ "$AGENT" = "cursor" ]; then
  208. say ""
  209. if gh secret list --repo "$REPO" 2>/dev/null | grep -q "^CURSOR_API_KEY"; then
  210. say " A Cursor API key is already saved for this repo."
  211. say " Keep it? [y = keep / n = replace with a different one]"
  212. ask
  213. else
  214. REPLY="n"
  215. fi
  216. if [ "$REPLY" != "y" ] && [ "$REPLY" != "Y" ]; then
  217. say ""
  218. say " The overnight builds run on a server with no browser, so the login"
  219. say " you just used doesn't reach them - they need a Cursor API key."
  220. say " Any plan can mint one, and nothing is billed by DispatchSEO."
  221. say ""
  222. say " Create one at cursor.com/dashboard/api (open that URL directly -"
  223. say " the page is often missing from the dashboard's own menu), paste it"
  224. say " here and press Enter. It won't be shown:"
  225. while true; do
  226. read -r -s CKEY < /dev/tty
  227. say ""
  228. CKEY=$(printf '%s' "$CKEY" | tr -d '[:space:]')
  229. case "$CKEY" in
  230. "")
  231. say " Nothing pasted. Paste the key, or press Ctrl-C to stop and set it later:" ; continue ;;
  232. sk-ant-*)
  233. say " That's a Claude token, not a Cursor key. Paste the Cursor one:" ; continue ;;
  234. sk-*)
  235. say " That's an OpenAI key, not a Cursor key. Paste the Cursor one:" ; continue ;;
  236. esac
  237. if [ "${#CKEY}" -lt 20 ]; then
  238. say " That looks too short to be a whole key. Copy all of it and paste again:" ; continue
  239. fi
  240. # VERIFIED, not just shape-checked. Two measured details make this
  241. # trustworthy where the obvious version would not be:
  242. # - `cursor-agent models` EXITS 0 even when the key is invalid, so the
  243. # text is what gets checked, never $?.
  244. # - a key set here beats any interactive login already on this machine
  245. # (the CLI says so: "The API key was loaded from the CURSOR_API_KEY
  246. # environment variable"), so this cannot pass on the owner's own
  247. # session the way an unguarded Claude token check can.
  248. say " Checking the key with Cursor..."
  249. OUT=$(CURSOR_API_KEY="$CKEY" cursor-agent models 2>&1)
  250. case "$OUT" in
  251. *"Available models"*) break ;;
  252. *"API key is invalid"*|*"Authentication required"*|*Unauthorized*)
  253. say " Cursor rejected that key. Create a fresh one at"
  254. say " cursor.com/dashboard/api and paste it again:" ; continue ;;
  255. *)
  256. say " Couldn't check the key - Cursor answered with something"
  257. say " unexpected. Paste it again, or Ctrl-C and set it later:" ; continue ;;
  258. esac
  259. done
  260. printf '%s' "$CKEY" | gh secret set CURSOR_API_KEY --repo "$REPO" >/dev/null 2>&1 || \
  261. die "Could not save CURSOR_API_KEY to $REPO - does your GitHub login have admin access to it?"
  262. say " Cursor key verified and saved."
  263. fi
  264. elif [ "$AGENT" = "codex" ]; then
  265. say ""
  266. if gh secret list --repo "$REPO" 2>/dev/null | grep -q "^OPENAI_API_KEY"; then
  267. say " An OpenAI key is already saved for this repo."
  268. say " Keep it? [y = keep / n = replace with a different one]"
  269. ask
  270. else
  271. REPLY="n"
  272. fi
  273. if [ "$REPLY" != "y" ] && [ "$REPLY" != "Y" ]; then
  274. say ""
  275. say " Your builders run on your own OpenAI API key - OpenAI bills you"
  276. say " per run, and nothing is billed by DispatchSEO."
  277. say ""
  278. say " Create a key at https://platform.openai.com/api-keys (it must be on"
  279. say " an account with credit on it), paste it here and press Enter."
  280. say " It won't be shown:"
  281. while true; do
  282. read -r -s OKEY < /dev/tty
  283. say ""
  284. OKEY=$(printf '%s' "$OKEY" | tr -d '[:space:]')
  285. case "$OKEY" in
  286. sk-*)
  287. [ "${#OKEY}" -gt 20 ] && break
  288. say " That looks too short - paste the WHOLE key and press Enter." ;;
  289. "") say " Nothing pasted. Copy the key and press Enter." ;;
  290. *) say " An OpenAI key starts with sk-. Copy just the key and press Enter." ;;
  291. esac
  292. done
  293. say " Verifying the key against OpenAI..."
  294. # A real inference call, not a models list: an unfunded account happily
  295. # lists models it cannot call, so anything cheaper than this would pass a
  296. # key that then fails on the first real build.
  297. ocode=$(curl -s --max-time 30 -o /tmp/dispatchseo-openai.json -w "%{http_code}" \
  298. https://api.openai.com/v1/responses \
  299. -H "Authorization: Bearer $OKEY" -H "Content-Type: application/json" \
  300. -d '{"model":"gpt-5-mini","input":"ok","max_output_tokens":16}')
  301. oerr=$(grep -o '"code": *"[^"]*"' /tmp/dispatchseo-openai.json 2>/dev/null | head -1 | sed 's/.*"\([^"]*\)"$/\1/')
  302. rm -f /tmp/dispatchseo-openai.json
  303. case "$ocode" in
  304. 2*) printf '%s' "$OKEY" | gh secret set OPENAI_API_KEY --repo "$REPO"
  305. say " OpenAI key verified and saved." ;;
  306. 401|403) die "OpenAI rejected that key. Copy it again from platform.openai.com/api-keys - a key is only shown once, so a half-copied one is the usual cause." ;;
  307. 429) die "That key is real but the account can't run anything right now (OpenAI said: ${oerr:-quota exceeded}). Add credit at platform.openai.com/settings/organization/billing, then run this script again." ;;
  308. *) die "Couldn't reach OpenAI to verify the key (HTTP $ocode). Check your connection and run this script again." ;;
  309. esac
  310. fi
  311. else
  312. # Claude Code token - minted fresh, verified with NO login fallback (a fake
  313. # HOME), because a keychain login otherwise masks a bad token.
  314. CLIP="pbpaste"
  315. if ! command -v pbpaste >/dev/null 2>&1; then
  316. CLIP="xclip -o -selection clipboard"
  317. command -v xclip >/dev/null 2>&1 || \
  318. die "No clipboard tool found. Install xclip (e.g. sudo apt install xclip), then run this script again."
  319. fi
  320. if gh secret list --repo "$REPO" 2>/dev/null | grep -q "^CLAUDE_CODE_OAUTH_TOKEN"; then
  321. say ""
  322. say " A Claude Code token is already saved for this repo."
  323. say " Keep it? [y = keep / n = replace with a fresh one]"
  324. ask
  325. else
  326. REPLY="n"
  327. fi
  328. if [ "$REPLY" != "y" ] && [ "$REPLY" != "Y" ]; then
  329. say ""
  330. say " Creating your Claude Code token (the builders run on YOUR Claude"
  331. say " subscription - nothing is billed by DispatchSEO)."
  332. say " Press Enter; a browser opens - click Approve with your normal"
  333. say " Claude account."
  334. ask
  335. claude setup-token < /dev/tty
  336. say ""
  337. hr
  338. say " See the long token above (starts with sk-ant-oat)? Select it and"
  339. say " copy it (Cmd+C - two lines is fine), then press Enter here."
  340. while true; do
  341. ask
  342. CTOKEN=$($CLIP 2>/dev/null | tr -d '[:space:]')
  343. case "$CTOKEN" in
  344. sk-ant-oat*)
  345. if [ "${#CTOKEN}" -gt 60 ]; then break; fi
  346. say " That looks too short - copy the WHOLE token, then press Enter." ;;
  347. *)
  348. say " Your clipboard holds something else. Copy JUST the token, then press Enter." ;;
  349. esac
  350. done
  351. say " Verifying the token for real (no login fallback)..."
  352. mkdir -p /tmp/claude-fakehome
  353. if HOME=/tmp/claude-fakehome CLAUDE_CODE_OAUTH_TOKEN="$CTOKEN" claude -p "reply with just: ok" </dev/null >/dev/null 2>&1; then
  354. printf '%s' "$CTOKEN" | gh secret set CLAUDE_CODE_OAUTH_TOKEN --repo "$REPO"
  355. say " Claude token verified and saved."
  356. else
  357. die "The token doesn't work - usually the browser approved the WRONG account. Log into your subscription account on claude.ai and run this script again."
  358. fi
  359. fi
  360. fi # end of the per-agent builder-credential branch
  361. # DataForSEO - only if this project uses its own account. Cloud projects on
  362. # the bundled plan skip this entirely: the platform bills a DataForSEO
  363. # account server-side, so there is nothing to collect here (the owner can
  364. # still connect their own later, from Settings, for unmetered usage).
  365. if [ "$BUNDLED" = "1" ]; then
  366. say ""
  367. say " DataForSEO is included with your plan - nothing to set up here."
  368. else
  369. say ""
  370. say " Does this project use DataForSEO for keyword data? [y/n]"
  371. say " (If you picked the free mode in onboarding, answer n.)"
  372. ask
  373. if [ "$REPLY" = "y" ] || [ "$REPLY" = "Y" ]; then
  374. say ""
  375. say " Your DataForSEO LOGIN is your account email. Type it and press Enter:"
  376. read -r DFS_LOGIN < /dev/tty
  377. say ""
  378. say " Your DataForSEO PASSWORD is the API password from"
  379. say " app.dataforseo.com/api-access - NOT your dashboard login password."
  380. say " Paste it and press Enter (it won't be shown):"
  381. read -r -s DFS_PASS < /dev/tty
  382. say ""
  383. say " Verifying against DataForSEO..."
  384. dfs=$(curl -s --max-time 30 -u "$DFS_LOGIN:$DFS_PASS" https://api.dataforseo.com/v3/appendix/user_data | grep -o '"status_code":20000' | head -1)
  385. if [ -n "$dfs" ]; then
  386. printf '%s' "$DFS_LOGIN" | gh secret set DATAFORSEO_LOGIN --repo "$REPO"
  387. printf '%s' "$DFS_PASS" | gh secret set DATAFORSEO_PASSWORD --repo "$REPO"
  388. say " DataForSEO verified and saved."
  389. else
  390. die "DataForSEO rejected those credentials. Double-check: LOGIN = account email, PASSWORD = the API password from app.dataforseo.com/api-access. Then rerun this script."
  391. fi
  392. else
  393. say " Skipping DataForSEO - the workflows handle its absence cleanly."
  394. fi
  395. fi
  396. # Allow Actions to open PRs (the builders publish via PRs). The 2026-07-20
  397. # dogfood repo skipped setup.sh, missed this toggle, and its builder wrote a
  398. # whole guide it then couldn't open a PR for - hence the canary below, which
  399. # PROVES the toggle works instead of trusting this call succeeded.
  400. if gh api -X PUT "repos/$REPO/actions/permissions/workflow" \
  401. -f default_workflow_permissions=write \
  402. -F can_approve_pull_request_reviews=true >/dev/null 2>&1; then
  403. say " GitHub Actions allowed to open pull requests."
  404. else
  405. say " ! Couldn't change Actions permissions automatically. In the repo's"
  406. say " Settings > Actions > General, enable 'Allow GitHub Actions to"
  407. say " create and approve pull requests'."
  408. fi
  409. # Prove the PR machinery end-to-end with a throwaway canary PR (opened from
  410. # inside a workflow, closed by the same run, never merged). Fresh installs
  411. # don't have the workflows yet - the agent's install playbook runs the canary
  412. # after its pipeline PR merges; this path covers re-runs and updates.
  413. if gh workflow run seo-canary.yml --repo "$REPO" >/dev/null 2>&1; then
  414. say " Proving workflows can open PRs (canary run, ~30s)..."
  415. verdict=""
  416. i=0
  417. while [ $i -lt 24 ]; do
  418. sleep 5; i=$((i+1))
  419. verdict=$(gh run list --repo "$REPO" --workflow seo-canary.yml --limit 1 \
  420. --json status,conclusion --jq '.[0] | select(.status=="completed") | .conclusion' 2>/dev/null)
  421. [ -n "$verdict" ] && break
  422. done
  423. case "$verdict" in
  424. success) say " Canary passed - workflows can build and publish PRs on $REPO." ;;
  425. "") say " ! Canary still running - check its result: gh run list --workflow seo-canary.yml" ;;
  426. *) say " ! CANARY FAILED ($verdict) - workflows cannot open PRs yet. Enable"
  427. say " 'Allow GitHub Actions to create and approve pull requests' in"
  428. say " Settings > Actions > General, then: gh workflow run seo-canary.yml" ;;
  429. esac
  430. else
  431. say " (Canary workflow not in this repo yet - your agent runs it after the"
  432. say " pipeline install PR merges.)"
  433. fi
  434. # ---- 5. Hand off to the agent ----------------------------------------------
  435. # $NAME, not "seo-manager": the prompt must name the server exactly as it
  436. # was just registered - agents take the name literally and refuse on a
  437. # name they cannot find.
  438. #
  439. # Both agents install the same pipeline. The workflow files it writes carry
  440. # BOTH agents and resolve which one to run at run time from the dashboard, so
  441. # there is no per-agent install and no decision for the installer to get wrong.
  442. say ""
  443. say "Step 5 of 5 - your agent installs the pipeline (a few minutes; it"
  444. say "opens a pull request and may ask you questions along the way)."
  445. PROMPT="Call the $NAME MCP tool get_instructions with workflow install and follow it exactly."
  446. say ""
  447. say "Launch $AGENT_NAME now to finish? [y/n]"
  448. ask
  449. if [ "$REPLY" = "y" ] || [ "$REPLY" = "Y" ]; then
  450. exec "$AGENT_CLI" "$PROMPT" < /dev/tty
  451. else
  452. say ""
  453. say "==============================================="
  454. say " Setup saved. Whenever you're ready, open $AGENT_NAME in this"
  455. say " folder and paste:"
  456. say ""
  457. say " $PROMPT"
  458. say "==============================================="
  459. fi

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.