The Roborank CLI
Run your SEO findings from the terminal, or let an AI coding agent like Claude Code run them for you. Roborank stays the system of record; this is the front door.
Install and log in
npm install -g roborank
Node 18 or newer. The package has zero dependencies, makes no AI calls of its own, and commands return in under a second.
- Go to Settings → Connect Claude in your dashboard
- Create an access token. It starts with
rbk_and is shown once, so copy it - Then, in your terminal:
roborank login --token rbk_yourtoken
roborank whoami
whoami shows which server you are connected to and the sites your token can reach. The token is stored in ~/.roborank/config.json with owner-only permissions. Agents and CI can skip login and set ROBORANK_TOKEN in the environment instead.
Keep tokens on machines you control
Anyone with the token has its full access to your sites. If one leaks, revoke it from the same Settings page.
Read your findings
roborank sites # all connected sites, sync freshness
roborank overview --site example.com # health snapshot, 28-day trend
roborank quick-wins --site example.com # small fixes that win real clicks
roborank cannibalization --site example.com
roborank decay --site example.com # pages losing traffic they had
roborank links --site example.com # under-linked pages
roborank top-pages --site example.com
roborank competitors --site example.com
Digging into one page
roborank search --site example.com --query "pricing"
roborank page --site example.com --url https://example.com/pricing/
roborank queries --site example.com --page-url https://example.com/pricing/
queries is the honesty check: it shows the actual Google searches a page appears for. Always run it before rewriting a title, because a page that looks like a winner sometimes only ranks for your own brand name.
--site is optional when your account has one site. Output is a readable table at the terminal and JSON when piped or read by an agent; --json forces JSON anywhere.
Rankings and AI visibility
roborank rankings --site example.com # tracked keywords: position, change, best, AI Overview
roborank track "porto travel guide" "porto food" --site example.com --country pt
roborank check-rankings --site example.com # queue fresh checks (--fast for ~20s results)
roborank ai-visibility --site example.com # do ChatGPT, Perplexity, Claude, Gemini cite you
roborank track-prompts "best bakery in porto?" --site example.com
roborank ask-ai --site example.com # asks 8 at a time, run again while "remaining" > 0
roborank page-jobs --site example.com # New Content pages and their drafts
Reading and tracking are free. check-rankings and ask-ai run on your own DataForSEO account, so set DATAFORSEO_LOGIN and DATAFORSEO_PASSWORD in your shell first. They go to Roborank with that one call and are never stored. Rank checks are queued: run roborank rankings again a few minutes later to collect them.
Apply fixes
Write commands need two toggles in the dashboard, per site: Settings → Remote Access, and inside it, allow remote edits. Until both are on, writes are refused with a message that says so.
# Rewrite a title and meta description
roborank set-meta --site example.com --url https://example.com/pricing/ \
--title "New title" --description "New description"
# Surgical find-and-replace in page content (how you add internal links)
roborank patch --site example.com --page-id 986 \
--old "better results than a throwaway mention." \
--new "better results than a throwaway mention. See the <a href="https://example.com/guide/">full guide</a>."
# Record a change you applied outside Roborank
roborank log-change --site example.com --url https://example.com/pricing/ \
--action update_meta --reason "rewrote title for CTR"
Write approval (default on)
A write command queues the change and returns queued: true. Nothing touches your site until you approve it in the dashboard under Pending changes. Check the queue with roborank pending. Approval is dashboard-only by design, so an agent holding your token can never approve its own changes. Prefer direct writes? Untick "Require my approval" when enabling Remote Access.
Every applied change is verified against the live site and recorded in the changelog with before and after values. Read it back anytime with roborank changelog.
Matching tips for patch
Match on text without quotes or apostrophes when you can; WordPress converts straight quotes to curly ones at render time, so quoted phrases often fail to match the stored content. Some posts store bare text and WordPress adds the <p> tags at render, so if a match including </p> fails, retry without it. If a write complains about a missing page id, run Refetch Site in the dashboard first.
Use it from Claude Code
cd your-project
roborank init
init adds a Roborank section to the project's CLAUDE.md, so every Claude session in that folder checks live data instead of stale notes. Also copy skill/SKILL.md from the npm package into ~/.claude/skills/roborank/SKILL.md; it teaches the full workflow: read findings, verify against real queries, write the fix, apply it, log it.
From then on you can ask things like "what should I fix on example.com" in plain English inside Claude Code. Asking the terminal directly does not work; the shell is not an AI.
Static HTML sites
Roborank cannot write to a static site, so write commands return a patch plan instead: exact find-and-replace edits. Your agent applies them to the local files, then calls roborank log-change so the dashboard still records the work.
Power usage
Any flag that is not a CLI flag becomes a tool argument: --min-impressions 50 sends min_impressions: 50. Pass raw JSON with --args-json. Every server-side tool is reachable directly, even ones newer than your installed package:
roborank tools # list everything the server offers
roborank call get_consolidation --site example.com
Exit codes tell an agent what happened: 1 the server refused, 2 usage error, 3 auth problem, 4 network trouble.
What costs money
Nothing in this CLI spends AI tokens. Your AI provider key is only used when the dashboard agent writes or thinks for you; the CLI's write tools take content that is already written and apply it. Keyword lookups (roborank keywords) use your configured keyword data provider's credits and fail cleanly if none is set. On a credit plan, check-rankings and ask-ai spend your Roborank credits and need no login. On your own keys, check-rankings (about half a cent per keyword check) and ask-ai (one to three cents per question per assistant) spend your DataForSEO credits. When Claude Code drives the CLI, the intelligence is billed to your Claude plan, not to Roborank.
Troubleshooting
| Message | Fix |
|---|---|
Remote Access is off for this site | Dashboard → site settings → enable Remote Access and allow remote edits |
Invalid page_id "undefined" | Run Refetch Site in the dashboard so the sync captures WordPress ids |
No replacements matched | Your --old text is not in the stored content; drop quotes and closing tags, or check with roborank page |
syncs from the Roborank dashboard | WordPress sites refresh with the Refetch Site button, not from the CLI |
No keyword data provider configured | Add a provider in Settings, or skip keyword lookups |
401 or exit code 3 | Token revoked or wrong server; roborank login again |
How it works
The CLI speaks the same JSON-RPC protocol as the Roborank MCP server, against the same /mcp endpoint and the same tokens. One auth model, one tool layer: whatever the dashboard chat can do, the CLI can do, and new server-side tools are reachable through roborank call without upgrading the package.