Skip to content

Docs

AI visibility CLI: rankhound for your terminal

How often ChatGPT, Claude, Gemini, Perplexity and Google's AI surfaces name your brand, read from a terminal. It reads the AI visibility tracking included on every plan; the week's SEO work, articles and rankings are in the REST API and the MCP server. It is not on npm yet, so this page shows what it prints and what to use until it ships.

Start 7-day free trialAPI reference

Card required, nothing charged for 7 days

Until the CLI is on npm

Not installable yet. @rankhound/cli is written and tested but is not published on npm, so there is no install command to give you. The hosted MCP server needs no install and works now, and the REST API takes any HTTP client.

The same read works today against the REST API. Mint the key at API keys in the app, Owner and Admin roles only, shown once. Everything after that is reading.

shell
curl -s https://app.rankhound.ai/api/v1/visibility?days=30 \
  -H "Authorization: Bearer rh_live_YOUR_KEY"

When it ships, the binary is rankhound, and this is what it prints for the same question:

$ rankhound visibility --days 7
Brand: Contoso   Window: 7 days

PER ENGINE (never averaged — they disagree)
  ChatGPT                61.9%  (13 of 21)
  Claude                 3 of 4 (below 5, no % yet)
  Gemini                 47.6%  (10 of 21)
  Perplexity             71.4%  (15 of 21)
  Google AI Overview     29.4%  (5 of 17)
  Google AI Mode         42.9%  (9 of 21)

PER BRAND
  Fabrikam               70.5%  (74 of 105)
  Contoso (you)          52.4%  (55 of 105)
  Northwind              45.7%  (48 of 105)
  Tailspin               37.1%  (39 of 105)
  Litware                21.0%  (22 of 105)
  Proseware              8.6%  (9 of 105)
Example output, for an example brand (Contoso), in the CLI's exact format. Claude prints a fraction rather than a percentage because four answers is below the sample floor: the CLI will not quote a rate it cannot support.

Every command in the AI visibility CLI

Nine of them. Seven read, two manage the key.

CommandWhat it answers
rankhound login --key rh_live_...Stores the key at ~/.rankhound/config.json, mode 0600.
rankhound logoutRemoves the stored key.
rankhound whoamiDoes this key work, what plan, what quota, and which reporting thresholds are in force.
rankhound brandsWhich brands this key can read, and their ids.
rankhound visibility [--days 7]How often each engine named you, and how your competitors did.
rankhound answers [--limit 50]The stored answers themselves, with mentions and citations.
rankhound sources [--days 30]Which domains the engines read before answering.
rankhound alerts [--limit 50]Findings, newest first.
rankhound exportEvery answer as JSON, auto-paginated, for a spreadsheet or a pipeline.

Start with rankhound whoami. It proves the key works, names the plan, shows what is left of your quota, and prints the reporting thresholds currently in force — which is what you want before you read a number off anything else.

Flags

--brand <id>
Required when the organisation has more than one brand. Ignored by a pinned key.
--json
Force JSON. Already the default when stdout is not a terminal, so a pipe needs no flag.

When your organisation has more than one brand, --brand is required rather than defaulted. That is the same refusal the API makes, for the same reason: a silent default files one client's numbers under another's.

Environment variables

RANKHOUND_API_KEY
Takes precedence over the saved config, always. This is the one to use in CI.
RANKHOUND_BRAND
Default brand id, so --brand can be left off.
RANKHOUND_BASE_URL
Override the API base. For our own testing more than yours.

The saved config lives at ~/.rankhound/config.json, mode 0600. Prefer RANKHOUND_API_KEY anywhere the machine is shared or automated: it wins over the file unconditionally, so a CI job never depends on a login having happened on that runner.

In a scheduled job

Until the CLI is on npm, the same weekly job with curl.

.github/workflows/rankhound.yml
name: RankHound weekly read
on:
  schedule: [{ cron: "0 8 * * 1" }]   # Monday, 08:00 UTC
jobs:
  read:
    runs-on: ubuntu-latest
    env: { RANKHOUND_API_KEY: ${{ secrets.RANKHOUND_API_KEY }} }
    steps:
      - run: curl -fsS https://app.rankhound.ai/api/v1/me -H "Authorization: Bearer $RANKHOUND_API_KEY"
      - run: curl -fsS https://app.rankhound.ai/api/v1/keywords -H "Authorization: Bearer $RANKHOUND_API_KEY" > keywords.json
      - run: curl -fsS "https://app.rankhound.ai/api/v1/visibility?days=7" -H "Authorization: Bearer $RANKHOUND_API_KEY" > visibility.json
      - uses: actions/upload-artifact@v4
        with: { name: rankhound, path: "*.json" }

The API always answers JSON, so the files are machine-readable as they land. -f makes curl fail the step on an error status rather than save the error envelope as if it were data.

Call /me first in CI as well. A job that fails on a revoked key in its first step is far easier to read than one that fails three steps later while parsing an error envelope it expected to be data.

What the CLI will not do

  • No --summary. There is no single visibility score and adding a flag that invents one would make the tool argue with its own documentation.
  • No writes. No flag approves or publishes an article, adds a prompt or triggers a run. Each one either puts words on your site or spends money, and none should happen because a script had an argument wrong.
  • No runtime dependencies. A tool people run with npx is a supply-chain surface. Node 20 has HTTP, JSON and argument parsing; that is the whole requirement.
  • No percentage below the sample floor. It prints the fraction instead, because quoting a percentage off four answers is false precision.

The rules the CLI follows

Three rules the CLI will not break for you

These are not style preferences. Breaking them produces a confidently wrong report in your customer's name.

  1. 1

    A null rate means "not enough answers yet". It is NOT zero.

    Rates come back as {present, responses, rate, min_sample}. When rate is null, the sample is below the floor. Say “3 of 4 answers, too few to quote a percentage”. Never render it as 0%, and never let it into an average. Reporting “0% visibility” for a brand that was named in 3 of 4 answers is the single most damaging thing you can do with this data.

  2. 2

    Never average the engines.

    There is no single visibility score and you must not compute one. ChatGPT, Perplexity and Google AI Overviews are different surfaces that disagree, so a mean describes nothing real. Report per engine. If the user insists on one number, give them the pooled counts (present and responses summed) and say plainly what you did.

  3. 3

    An empty alerts list does NOT mean nothing changed.

    A finding is raised only when both comparison windows carry enough answers AND the move is larger than its own margin of error. On a small plan that excludes most real movement. Say “no change large enough to distinguish from noise at this sample size”. GET /me shows the thresholds in force.

The long version is on how to read our numbers. If you are wiring this into an AI assistant rather than a shell, the MCP server carries the same rules in its tool payloads.

Questions about the CLI

Answered from the implementation.

Does RankHound have a command-line tool?
Not one you can install yet. @rankhound/cli, which provides the rankhound binary, is written and tested but is not published on npm. Until it is, the hosted MCP server and the REST API read everything it would, and curl does the same job in a terminal or in CI.
How do I use the RankHound CLI in CI?
Once it is on npm, set RANKHOUND_API_KEY in the job's secrets. It takes precedence over any saved config, always, so a CI runner never depends on a login step having happened. Until then, the scheduled job on this page does the same reads with curl against the REST API.
Where does the CLI store my API key?
~/.rankhound/config.json, mode 0600, written by rankhound login. Use the environment variable instead of that file on any shared or automated machine. rankhound logout removes it.
Is there a flag to get one overall visibility score?
No, and there will not be. Engines disagree, so a mean describes no real surface. There is no --summary flag on purpose. If you want a pooled figure, sum present and responses yourself and say that is what you did.
Why does the CLI print a fraction instead of a percentage sometimes?
Because the sample is below the floor. Printing "3 of 4 answers" is the honest rendering; printing "75%" off four answers is false precision, and printing "0%" when the rate is null is a reported collapse that did not happen.
Can the CLI change anything in my account?
No. The CLI only reads. Approving or publishing an article, adding a prompt and triggering a collection run all stay in the app behind a human confirmation rather than behind a flag in a terminal.

7-day trial

The terminal reads what RankHound collects

RankHound is SEO automation software that finds the searches your site can win and writes for them. Until the CLI is on npm, everything it would print is readable in the app, from any MCP client, or with curl.

Card required, nothing charged for 7 days.

On every plan

  • Keyword research and competitor analysis, every week.
  • Articles written against the pages that rank, waiting for your approval.
  • Google rankings checked weekly, beside your Search Console data.
  • Publishing to WordPress or any site by webhook, once you approve.
  • AI visibility tracking across six AI assistants.