Echo/Docs

CLI command

seo gate

The SEO gate of a landing deploy: a preview compared with production, refusing a promotion that would remove, block or noindex a page production lists.

Invocation#

Shell
echo-cli seo gate --production <https origin> --preview <https origin> --crawler <user-agent token>

Inputs and output#

Writes production, preview, crawler, checked (how many pages production's sitemaps list) and findings: each page the preview would lose to search, with path, removed (the preview's sitemaps no longer list the path), blocked_by (the preview's robots.txt rule disallowing it for the crawler), status or error (the preview's answer at the same path when it is not 2xx, or what stopped reading it) and noindex (the preview tells the crawler not to index a page production indexes, through an X-Robots-Tag header or a meta tag named robots or named for the crawler). It exits 1 when findings is not empty and 0 otherwise. To gate a landing deploy, run it in the landing's pipeline after the preview is deployed and before it is promoted, with the preview's address, and stop the pipeline on a non-zero exit; the same check is GET /api/seo/gate with ECHO_INTERNAL_BEARER.

State effect#

The command calls Echo Web's authenticated /api/seo/gate with ECHO_INTERNAL_BEARER at ECHO_WEB_BASE_URL; the SEO deploy gate section of the GEO screen and of Echo Desktop's GEO screen call the same operation, and echo-mcp runs it as echo_seo_gate. Both sites' robots.txt and sitemaps are read as seo deploy-check reads them, and every page is fetched from both now. It stores nothing.

Refusals#

  • A wrong invocation is refused before anything is sent: "seo gate does not take <flag>; it takes --production, --preview, --crawler", "<flag> needs a value" and "seo gate needs <flag>" for each of the three.
  • Echo Web answers a bad request with "crawler is required: the user-agent token whose robots rules decide, such as Googlebot", "preview is required: the https origin of the deployment to promote; got <value>" or "origin is required: the https origin of the site to check, such as https://example.com; got <value>" for production; not found with "<origin>/robots.txt declares no sitemap and none was named; name one with sitemap=<https url>" for either site. The command prints Echo Web's sentence and exits 1.