Skip to content
adscapi

doctor

Health check across every configured platform. Same live credential checks as verify, plus a summary line and a nonzero exit code when anything fails — built for cron and CI gates.

Usage

shell
adscapi doctor

No flags.

Behavior

  1. Lists configured destinations (ads.destinations.list() where active)
  2. If none — prints No platforms configured. Run: adscapi init and sets exitCode = 1
  3. Otherwise runs ads.destinations.verify() on all of them
  4. Prints health: {n} configured, {m} checked, {f} failing plus one row per result
  5. Configured platforms with no live check available get [· ] … — configured, no live check available
  6. Any ERR row → exitCode = 1

Examples

shell
$ npx adscapi doctor
health: 3 configured, 2 checked, 0 failing
  [OK ] meta — EMQ 8.2
  [OK ] ga4
  [·  ] bing — configured, no live check available
$ echo $?
0
shell
$ npx adscapi doctor
health: 2 configured, 2 checked, 1 failing
  [OK ] meta
  [ERR] tiktok — invalid access token
$ echo $?
1
shell
$ npx adscapi doctor
No platforms configured. Run: adscapi init
$ echo $?
1

CI / cron

shell
# GitHub Actions / any CI
npx adscapi doctor

# cron — alert when exit nonzero
0 * * * * cd /app && . ./.env && npx adscapi doctor || notify-slack "adscapi unhealthy"

Related