Pp semrush

From mvanhorn/printing-press-library · View interactive version

Pp semrush is an AI agent skill from the GitHub repository mvanhorn/printing-press-library. Every Semrush Analytics + Projects feature, plus a local SQLite store and cross-domain joins no other Semrush tool has. Trigger phrases: `show me what changed for <domain> this week`, `find the keyword gap between <my domain> and <competitor>`, `show me new referring domains for <domain>`, `triage m

How to use this skill

Skill file

<!-- GENERATED FILE — DO NOT EDIT.

This file is a verbatim mirror of library/marketing/semrush/SKILL.md,

regenerated post-merge by tools/generate-skills/. Hand-edits here are

silently overwritten on the next regen. Edit the library/ source instead.

See the repository agent guide, section "Generated artifacts: registry.json, cli-skills/". -->

Semrush — Printing Press CLI

Prerequisites: Install the CLI

This skill drives the semrush-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:

  1. Install via the Printing Press installer. It defaults binaries to $HOME/.local/bin on macOS/Linux and %LOCALAPPDATA%\Programs\PrintingPress\bin on Windows:

```bash

npx -y @mvanhorn/printing-press-library install semrush --cli-only

```

  1. Verify: semrush-pp-cli --version
  2. Ensure the reported install directory is on $PATH for the agent/runtime that will invoke this skill.

If the npx install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.6 or newer):

go install github.com/mvanhorn/printing-press-library/library/marketing/semrush/cmd/semrush-pp-cli@latest

If --version reports "command not found" after install, the runtime cannot see the binary directory on $PATH. Do not proceed with skill commands until verification succeeds.

When to Use This CLI

Use this CLI when you need to query Semrush data the same way more than once — weekly drift, keyword gap, backlink gap, Site Audit regression — or when you're orchestrating Semrush through an agent that should not re-spend credits on data already pulled. It's not the right tool for one-off ad-hoc lookups (the official Semrush UI is faster) or for Trends API workflows (out of scope by design).

Unique Capabilities

These capabilities aren't available in any other tool for this API.

Local state that compounds

_When an agent is asked 'what changed for this domain this week', this is the single command that answers it from the local store with no API spend._

```bash

semrush-pp-cli drift apple.com --since 7d --agent

```

_Lets an agent reason about state across multiple weeks of conversations without re-paying for the same data._

```bash

semrush-pp-cli snapshot tag monday && semrush-pp-cli snapshot diff monday today --select phrase,position --agent

```

_Saves an agent from re-pulling and diffing two full backlink reports to answer a recency question._

```bash

semrush-pp-cli backlink new apple.com --since 7d --json

```

_Answers 'what tracked keywords moved this month' in one command — the question Position Tracking emails fail to answer._

```bash

semrush-pp-cli tracking drift 12345 --since 30d --min-delta 3 --agent

```

_Lets an agent tell you exactly what your tech-SEO state regressed on between two crawls._

```bash

semrush-pp-cli audit regression 12345 --agent

```

Cost transparency

_Tells an agent before a request 'this would cost N units' and after a month 'here is where the units went' — neither answerable from the upstream alone._

```bash

semrush-pp-cli budget --since 30d --group-by command --agent

```

Cross-domain joins the API can't do

_Replaces the manual two-CSV VLOOKUP that every SEO consultant does by hand._

```bash

semrush-pp-cli keyword gap myco.com competitor1.com competitor2.com --database us --kd-max 40 --agent

```

_Directly surfaces link-building targets an agent can hand to an outreach workflow._

```bash

semrush-pp-cli backlink gap myco.com competitor.com --min-ascore 70 --agent

```

_Lets an agent answer 'how does this domain perform across our top 5 markets' as one call rather than five._

```bash

semrush-pp-cli domain regions apple.com --databases us,uk,de,fr,it --agent

```

SEO content patterns no competitor exposes

_Turns a Site Audit dump into a prioritized action list an agent can hand to the next step._

```bash

semrush-pp-cli audit triage 12345 --top 20 --agent

```

_Tells a content-strategy agent when an opportunity (e.g. featured snippet slot opening) appeared or closed._

```bash

semrush-pp-cli serp-features 'best running shoes' --since 30d --agent

```

_Surfaces a high-value SEO problem in one command — most consultants charge to find this._

```bash

semrush-pp-cli cannibalization apple.com --database us --agent

```

Command Reference

account — Account utilities (API units balance)

audit — Site Audit: enable, run, list snapshots, drill into issues and pages

backlink — Backlinks: overview, list, referring domains/IPs, anchors, competitors, history

domain — Domain analytics: overview, organic/paid keywords, competitors, pages, ad history

keyword — Keyword research reports (volume, difficulty, related, SERP, ad history)

project — Manage Semrush Projects (containers for Position Tracking, Site Audit, Listings)

subdomain — Subdomain analytics: overview, organic/paid keywords, pages

subfolder — Subfolder analytics: overview, organic/paid keywords, pages

tracking — Position Tracking: create campaign, manage keywords/tags/competitors, organic and paid reports

url — URL-level analytics: overview, organic/paid keywords

Freshness Contract

This printed CLI owns bounded freshness only for registered store-backed read command paths. In --data-source auto mode, those paths check sync_state and may run a bounded refresh before reading local data. --data-source local never refreshes. --data-source live reads the API and does not mutate the local store. Set SEMRUSH_NO_AUTO_REFRESH=1 to skip the freshness hook without changing source selection.

Covered paths:

When JSON output uses the generated provenance envelope, freshness metadata appears at meta.freshness. Treat it as current-cache freshness for the covered command path, not a guarantee of complete historical backfill or API-specific enrichment.

Finding the right command

When you know what you want to do but not which command does it, ask the CLI directly:

semrush-pp-cli which "<capability in your own words>"

which resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code 0 means at least one match; exit code 2 means no confident match — fall back to --help or use a narrower query.

Recipes

Monday baseline + Friday diff

semrush-pp-cli snapshot tag monday-baseline

After syncing your tracked domains and keywords, tag the snapshot. Re-sync on Friday and run snapshot diff monday-baseline today to see the week`s movement.

Find keyword opportunities your competitor ranks for

semrush-pp-cli keyword gap myco.com competitor.com --database us --kd-max 40 --json --select phrase,nq,kd

Set-difference query in one shot — narrowed to keywords with realistic difficulty that the competitor ranks for but you don't.

Build a link-prospect list from a competitor

semrush-pp-cli backlink gap myco.com competitor.com --min-ascore 70 --json --select domain,domain_ascore,backlinks_num

Authority-70+ referring domains linking to the competitor but not to you, ready to pipe into an outreach workflow.

Triage the latest Site Audit

semrush-pp-cli audit triage 12345 --top 20 --agent

Once a Site Audit snapshot exists, get the 20 highest-impact pages weighted by errors x3 + warnings x1 + notices x0.1.

Where did this month's credits go

semrush-pp-cli budget --since 30d --group-by command --agent

Local credit_log rolled up by command; surfaces the top spenders so you can throttle or cache them.

Auth Setup

Set SEMRUSH_API_KEY from your Subscription Info → API Units page. The CLI uses the same v3 query-param auth as the official docs and the free balance endpoint as its doctor check, so you never spend credits to verify the key works.

Run semrush-pp-cli doctor to verify setup.

Agent Mode

Add --agent to any command. Expands to: --json --compact --no-input --no-color --yes.

```bash

semrush-pp-cli backlink list mock-value --type example-value --agent --select id,name,status

```

Response envelope

Commands that read from the local store or the API wrap output in a provenance envelope:

{
  "meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
  "results": <data>
}

Parse .results for data and .meta.source to know whether it's live or local. A human-readable N results (live) summary is printed to stderr only when stdout is a terminal AND no machine-format flag (--json, --csv, --compact, --quiet, --plain, --select) is set — piped/agent consumers and explicit-format runs get pure JSON on stdout.

Agent Feedback

When you (or the agent) notice something off about this CLI, record it:

semrush-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
semrush-pp-cli feedback --stdin < notes.txt
semrush-pp-cli feedback list --json --limit 10

Entries are stored locally at ~/.local/share/semrush-pp-cli/feedback.jsonl. They are never POSTed unless SEMRUSH_FEEDBACK_ENDPOINT is set AND either --send is passed or SEMRUSH_FEEDBACK_AUTO_SEND=true. Default behavior is local-only.

Write what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.

Output Delivery

Every command accepts --deliver <sink>. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:

| Sink | Effect |

|------|--------|

| stdout | Default; write to stdout only |

| file:<path> | Atomically write output to <path> (tmp + rename) |

| webhook:<url> | POST the output body to the URL (application/json or application/x-ndjson when --compact) |

Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.

Named Profiles

A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.

semrush-pp-cli profile save briefing --json
semrush-pp-cli --profile briefing backlink list mock-value --type example-value
semrush-pp-cli profile list --json
semrush-pp-cli profile show briefing
semrush-pp-cli profile delete briefing --yes

Explicit flags always win over profile values; profile values win over defaults. agent-context lists all available profiles under available_profiles so introspecting agents discover them at runtime.

Exit Codes

| Code | Meaning |

|------|---------|

| 0 | Success |

| 2 | Usage error (wrong arguments) |

| 3 | Resource not found |

| 4 | Authentication required |

| 5 | API error (upstream issue) |

| 7 | Rate limited (wait and retry) |

| 10 | Config error |

Argument Parsing

Parse $ARGUMENTS:

  1. Empty, help, or --help → show semrush-pp-cli --help output
  2. Starts with install → ends with mcp → MCP installation; otherwise → see Prerequisites above
  3. Anything else → Direct Use (execute as CLI command with --agent)

MCP Server Installation

  1. Install the MCP server:

```bash

go install github.com/mvanhorn/printing-press-library/library/marketing/semrush/cmd/semrush-pp-mcp@latest

```

  1. Register with Claude Code:

```bash

claude mcp add semrush-pp-mcp -- semrush-pp-mcp

```

  1. Verify: claude mcp list

Direct Use

  1. Check if installed: which semrush-pp-cli

If not found, offer to install (see Prerequisites at the top of this skill).

  1. Match the user query to the best command from the Unique Capabilities and Command Reference above.
  2. Execute with the --agent flag:

```bash

semrush-pp-cli <command> [subcommand] [args] --agent

```

  1. If ambiguous, drill into subcommand help: semrush-pp-cli <command> --help.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.