semrush cli

Troubleshooting

Diagnose browser, daemon, session, and quota errors.

semrush-cli writes diagnostics to standard error. Service, authentication and report failures exit with code 1. Invalid arguments exit with code 2.

Diagnostic commands

Run the built-in diagnostic checks to inspect your environment:

semrush doctor --json
semrush auth status --json
semrush auth status --check --json

Daemon connection errors

If the CLI reports that Galleton is unreachable:

  1. Verify that the daemon is running:
    semrush daemon start
  2. Inspect daemon logs for startup failures:
    cat ~/.local/share/semrush-cli/galleton/daemon.log
  3. Check for port conflicts on 127.0.0.1:8771. If another service occupies that port, stop it or configure SEMRUSH_GALLETON_URL to point to a distinct instance.

Browser launch failures

If Chromium fails to launch during setup or report execution:

  • Re-run browser initialization:
    semrush setup
  • On Linux distributions, install missing system dependencies for headless Chromium:
    npx patchright install-deps chromium
  • To use an existing system-installed Chromium binary instead, set:
    export SEMRUSH_BROWSER_EXECUTABLE=/usr/bin/chromium

Note that headless report queries run in non-graphical environments, but semrush auth login requires a desktop display.

Expired sessions and multilogin redirects

If commands return authentication errors:

  • Refresh your session by signing in again:
    semrush auth login
  • Or reimport an active session from your primary browser:
    semrush auth import --cdp-url http://127.0.0.1:9234
  • If Semrush redirects requests to /multilogin/, open your primary browser, resolve the active session conflict prompt manually, and then run import or login again.

Quota and subscription limits

Read-only requests consume your Semrush account report allowances. If a command returns an access denial:

  • Verify your subscription tier and remaining limits in your Semrush account dashboard.
  • Certain endpoints (such as historical snapshots, mobile databases, or AI metrics) depend on your account plan.
  • The CLI does not retry failed queries automatically to avoid draining allowances.

Complete uninstallation

To remove the CLI and local session data:

semrush auth logout
semrush daemon stop
npm uninstall -g semrush-cli
rm -rf ~/.local/share/semrush-cli

On this page