Docs

The AIMentionTracker CLI

How often ChatGPT, Claude, Gemini, Perplexity and Google's AI surfaces name your brand, read from a terminal. No install, no dependencies, JSON the moment you pipe it.

Card required, nothing charged for 7 days

Two commands to first output

shell
npx @aimentiontracker/cli login --key amt_live_...
npx @aimentiontracker/cli visibility --days 30

Mint the key at API keys in the app — Owner and Admin roles only, shown once. Everything after that is reading. Zero runtime dependencies, and the source is MIT: read it on GitHub before you npx it.

The binary is amt, so an install makes the same commands shorter:

shell
npm i -g @aimentiontracker/cli
amt visibility --days 30
$ amt visibility --days 30
Brand: Posteverywhere   Window: 30 days

PER ENGINE (never averaged — they disagree)
  ChatGPT                0.0%  (0 of 14)
  Claude                 0 of 4 (below 5, no % yet)
  Gemini                 0.0%  (0 of 14)
  Perplexity             0.0%  (0 of 14)
  Google AI Overview     0.0%  (0 of 12)
  Google AI Mode         0.0%  (0 of 14)

PER BRAND
  Buffer                 95.8%  (69 of 72)
  Later                  86.1%  (62 of 72)
  Hootsuite              77.8%  (56 of 72)
  Metricool              68.1%  (49 of 72)
  Sprout Social          45.8%  (33 of 72)
  Publer                 33.3%  (24 of 72)
  Ayrshare               0.0%  (0 of 72)
  Posteverywhere (you)   0.0%  (0 of 72)
Real output against our own workspace. 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
amt login --key amt_live_...Stores the key at ~/.aimentiontracker/config.json, mode 0600.
amt logoutRemoves the stored key.
amt whoamiDoes this key work, what plan, what quota, and which reporting thresholds are in force.
amt brandsWhich brands this key can read, and their ids.
amt visibility [--days 7]How often each engine named you, and how your competitors did.
amt answers [--limit 50]The stored answers themselves, with mentions and citations.
amt sources [--days 30]Which domains the engines read before answering.
amt alerts [--limit 50]Findings, newest first.
amt exportEvery answer as JSON, auto-paginated, for a spreadsheet or a pipeline.

Start with amt 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

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

The saved config lives at ~/.aimentiontracker/config.json, mode 0600. Prefer AMT_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

The shape most people end up with.

.github/workflows/visibility.yml
name: AI visibility
on:
  schedule: [{ cron: "0 8 * * 1" }]   # Monday, 08:00 UTC
jobs:
  read:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
        with: { node-version: 20 }
      - run: npx @aimentiontracker/cli whoami
        env: { AMT_API_KEY: ${{ secrets.AMT_API_KEY }} }
      - run: npx @aimentiontracker/cli visibility --days 7 > visibility.json
        env: { AMT_API_KEY: ${{ secrets.AMT_API_KEY }} }
      - uses: actions/upload-artifact@v4
        with: { name: visibility, path: visibility.json }

No --json anywhere: output is JSON whenever stdout is not a terminal, so a redirect or a pipe already gets machine-readable output and a human at a keyboard still gets a table.

Run whoami 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 adds a prompt or triggers a run. Both spend money, and neither 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 AIMentionTracker have a command-line tool?
Yes. @aimentiontracker/cli provides the amt binary. It runs under npx with no install, needs Node 20 or newer, and has zero runtime dependencies — a tool people run with npx is a supply-chain surface, and Node 20 already has everything this needs.
How do I use the AIMentionTracker CLI in CI?
Set AMT_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. Pipe the output straight into a file — JSON is the default whenever stdout is not a terminal, so no flag is needed.
Where does the CLI store my API key?
~/.aimentiontracker/config.json, mode 0600, written by amt login. Use the environment variable instead of that file on any shared or automated machine. amt 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. It sits on a read-only API. Adding a prompt expands a metered bill and triggering a collection run spends vendor credit, so both stay in the app behind a human confirmation rather than behind a flag in a terminal.

7-day trial

The terminal reads what AIMentionTracker collects

Add your brand and the prompts your buyers type. The first answers are readable in full within minutes, from the app or from a shell.

Card required, nothing charged for 7 days.

On every plan

  • Every answer stored in full, with its citations.
  • Every rate shown with the number of checks behind it.
  • Cited-but-not-named reported as its own state.