Semrush cli setup
Skill osodevops/intelligence-layer-skills/skills/semrush-cli-setup
Agent Skills for Semrush CLI SEO, paid search, backlinks, traffic, local SEO, and batch workflows
npx -y skills add osodevops/intelligence-layer-skills --skill semrush-cli-setupAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Install, configure, validate, and troubleshoot the semrush CLI. Use when the user needs Semrush API auth, SEMRUSH_API_KEY or SEMRUSH_OAUTH_TOKEN setup, output/cache/rate-limit configuration, shell completions, API balance checks, structured error handling, or a prerequisite check before running other Semrush CLI skills.
SKILL.md
4.0 KB, as published. Nobody here has run it
Semrush CLI Setup
Prepare the semrush CLI for agent-safe Semrush API work. Use this skill before domain, keyword, backlink, paid search, local SEO, traffic, or batch workflows when install state, credentials, output format, or API units are uncertain.
Baseline Checks
Run non-destructive checks first:
command -v semrush
semrush --version
semrush account auth status --output json --quiet
semrush account balance --output json --quiet
semrush cache stats --output json --quiet
If semrush is missing, install the semrush binary from the package source approved for the current project, then verify it is on PATH:
semrush --version
Use Rust 1.80+ when installing from source.
Authentication
Prefer environment variables for agent sessions:
export SEMRUSH_API_KEY="<set-locally>"
export SEMRUSH_OAUTH_TOKEN="<set-locally>"
Use SEMRUSH_API_KEY for v3 analytics endpoints: domain, keyword, backlink, trends, overview, account balance, and batch recipes. Use SEMRUSH_OAUTH_TOKEN for v4 endpoints: project and local SEO.
Use this precedence model when debugging auth:
--api-keyflagSEMRUSH_API_KEYenvironment variable~/.config/semrush/config.toml
Config file shape:
[auth]
api_key = "<set-locally>"
[defaults]
database = "us"
output = "json"
cache_ttl = 3600
[rate_limit]
requests_per_second = 10
[cache]
enabled = true
Agent Defaults
For machine parsing, force JSON and suppress non-data noise:
semrush domain overview example.com --database us --output json --quiet
Use --dry-run before broad, expensive, or unfamiliar calls:
semrush domain organic example.com --limit 1000 --dry-run --output json --quiet
Use cache intentionally:
semrush cache stats --output json --quiet
semrush domain overview example.com --cache-ttl 86400 --output json --quiet
semrush domain overview example.com --no-cache --output json --quiet
semrush cache clear
Global Options
Recognize and apply these options across workflows:
| Option | Use |
|---|---|
--database us | Regional database such as us, uk, de, or mobile-us. |
--limit 100 | Cap result count before parsing or exporting. |
--offset 0 | Page through large result sets. |
--output json | Machine-readable output for analysis. |
--output csv | Spreadsheet export. |
--output jsonl | Streaming-friendly export for large lists. |
--quiet | Suppress non-data messages. |
--verbose | Debug unexpected behavior. |
--dry-run | Estimate API unit cost without calling the API. |
Error Handling
Treat CLI exit codes as actionable signals:
| Exit | Meaning | Next action |
|---|---|---|
| 0 | Success | Parse stdout. |
| 1 | Auth error | Check API key, OAuth token, config precedence, and plan access. |
| 2 | Rate limit | Retry later or reduce batch size. |
| 3 | Input error | Fix command, required args, region, filters, or limits. |
| 4 | API/network error | Retry with --verbose; check Semrush status and network. |
When a command fails, do not infer metrics. Report the failing command, stderr summary, exit code, and the smallest next diagnostic command.
Related Skills
- Use
semrush-keyword-researchfor keyword expansion, difficulty, questions, and SERP ranking domains. - Use
semrush-competitor-researchfor organic domain and content gap work. - Use
semrush-backlink-auditfor off-page and authority analysis. - Use
semrush-paid-search-intelligencefor paid keyword, ad copy, and PLA research. - Use
semrush-traffic-trendsfor traffic source, geo, page, and trend analysis. - Use
semrush-local-seofor local listings and map-rank workflows. - Use
semrush-batch-workflowsfor reusable multi-step recipes.