Skip to Content
CommandsDoctordoctor

doctor

Read-only diagnostics for local setup and CI.

Data flow

  1. preAction sets RunOptions (including --json) and skips ensureConfig so doctor runs without writing a config.
  2. doctor() (packages/cli/src/commands/doctor/run.ts) runs checks in order: runtimetoolsconfigpaths.
  3. Each check returns a DoctorFinding: id, severity (ok | warn | error), title, optional detail.
  4. Human mode: lines go through logger; printCommandSummary ends the session.
  5. --json: one JSON object: { kind: 'doctor', findings, strict } on stdout.

Flags

FlagRole
--only <list>Comma-separated subset: runtime, tools, config, paths (default: all)
--strictTreat warn as failure (exit 1)
Global --jsonMachine-readable output for scripts / CI

Exit codes

  • 0 — No error findings; with --strict, no warn either.
  • 1 — Any error; or any warn when --strict is set.

Checks (predicates)

IDWhat
runtimeNode.js ≥ 18
toolsrg --version on PATH (warn if missing)
configConfig file present vs defaults (warn if missing)
pathsResolved source locale, locales dir, src root exist (paths error if source JSON missing)

Updates vs npm

Update discovery is global (banner + cache + version --check), not a separate doctor post-step. See docs/versioning/README.md.

i18nprune doctor i18nprune doctor --only runtime,tools i18nprune --json doctor --strict