pagebridge doctor

Validates your entire PageBridge setup — environment variables, credentials, database connection, schema, Sanity access, and GSC API access. Run this after initial setup or whenever something seems off.

Usage

pagebridge doctor [options]
bash

Options

FlagTypeDescription
--migratebooleanAutomatically run database migrations when missing tables are detected, then re-check
--jsonbooleanOutput structured JSON ({ "results": [...], "summary": {...} }) for CI and scripting

What it checks

  1. Environment file — verifies a .env or .env.local file exists with required variables
  2. Google credentials — validates the service account JSON structure
  3. Database connection — connects to PostgreSQL and checks for required tables
  4. Database schema — verifies all PageBridge tables exist (offers to migrate if --migrate is passed)
  5. Sanity access — tests the project ID, dataset, and token
  6. GSC API access — verifies the service account can reach the Search Console API

Examples

# Run all checks
pagebridge doctor

# Auto-fix missing tables
pagebridge doctor --migrate

# JSON output for CI pipelines
pagebridge doctor --json
bash

See also