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
- Lists configured destinations (
ads.destinations.list()whereactive) - If none — prints
No platforms configured. Run: adscapi initand setsexitCode = 1 - Otherwise runs
ads.destinations.verify()on all of them - Prints
health: {n} configured, {m} checked, {f} failingplus one row per result - Configured platforms with no live check available get
[· ] … — configured, no live check available - Any
ERRrow →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
- verify — same live checks, no exit-code gate
- check
- CLI overview — exit codes