doctor
Read-only diagnostics for local setup and CI.
Data flow
preActionsetsRunOptions(including--json) and skipsensureConfigsodoctorruns without writing a config.doctor()(packages/cli/src/commands/doctor/run.ts) runs checks in order:runtime→tools→config→paths.- Each check returns a
DoctorFinding:id,severity(ok|warn|error),title, optionaldetail. - Human mode: lines go through
logger;printCommandSummaryends the session. --json: one JSON object:{ kind: 'doctor', findings, strict }on stdout.
Flags
| Flag | Role |
|---|---|
--only <list> | Comma-separated subset: runtime, tools, config, paths (default: all) |
--strict | Treat warn as failure (exit 1) |
Global --json | Machine-readable output for scripts / CI |
Exit codes
- 0 — No
errorfindings; with--strict, nowarneither. - 1 — Any
error; or anywarnwhen--strictis set.
Checks (predicates)
| ID | What |
|---|---|
runtime | Node.js ≥ 18 |
tools | rg --version on PATH (warn if missing) |
config | Config file present vs defaults (warn if missing) |
paths | Resolved 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