Doctor
Quick Start
Run Doctor from the target project root:
pnpm dlx vite-doctor . # or npx/bunx/yarn dlx
For Nuxt projects, the recommended workflow is:
pnpm add -D vite-doctor
export default defineNuxtConfig({
modules: ["vite-doctor/nuxt"],
});
pnpm nuxt doctor
The standalone CLI also works for Nuxt one-off runs, CI fallback, or monorepo scans.
Workflow
- Use
vite-doctor . --changed --format agentfor uncommitted work. Usevite-doctor . --since <base-ref> --format agentfor a committed branch or pull request. Run Doctor without either scope flag when Git is unavailable or the user asks for a project audit. - Read
status,scope, and every Diagnostic's code, message, remediation, confidence, relative location, evidence, and optional edit plan. - Work only on Diagnostics owned by the requested change. Do not widen the task to unrelated findings.
- Apply the smallest fix that satisfies the remediation and preserves project conventions. Treat structured edit plans as proposed edits, not permission to skip review.
- Substitute the Diagnostic's Rule ID into
commands.verifyand run it after editing. - Run
commands.rerunbefore finishing. Report remaining Diagnostics or incomplete evidence exactly. - Use the Diagnostic Reference URL when the inline remediation is ambiguous or framework behavior needs confirmation. Routine fixes should not require network access.
Rules
- Use
vite-doctorfor Vite, Vue, Nitro, and Nuxt projects; do not invent framework-specific packages or binaries. - Treat Rule IDs as execution/filtering selectors.
- Treat Diagnostic Codes as the stable remediation identity for docs, fixes, and user-facing explanations.
- Prefer
--format agentfor remediation work. Use JSON for full run metadata and SARIF for code-scanning integrations. - An explicit
--formatis deterministic. Do not depend on automatic runtime recognition in scripts. - Use Doctor terms consistently: Doctor, Rule, Rule Pack, Diagnostic Code, and Diagnostic.
- Keep code edits scoped to reported Diagnostics unless the user asks for broader cleanup.