CLI 参考
Vercel Doctor 的全部命令行选项与参数。
用法
npx -y vercel-doctor@latest [directory] [options]directory 参数默认为 .(当前目录)。
选项
| Flag | Description |
|---|---|
-v, --version | Display the current version |
--no-lint | Skip billing lint rules |
--no-dead-code | Skip dead code detection (Knip) |
--verbose | Show file paths and line numbers per rule |
--score | Output only the numeric score (useful for CI) |
-y, --yes | Skip interactive prompts, scan all workspace projects |
--project <name> | Select specific workspace project(s), comma-separated |
--diff [base] | Scan only files changed vs the base branch |
--offline | Skip anonymous telemetry used for score calculation |
示例
扫描当前目录
npx -y vercel-doctor@latest .使用详细输出扫描
npx -y vercel-doctor@latest . --verbose显示每个诊断对应的文件路径和行号。
仅扫描变更文件
npx -y vercel-doctor@latest . --diff自动检测基准分支。也可指定基准:
npx -y vercel-doctor@latest . --diff main扫描指定工作区项目
npx -y vercel-doctor@latest . --project web多个项目:
npx -y vercel-doctor@latest . --project web,api跳过死代码检测
npx -y vercel-doctor@latest . --no-dead-codeCI 使用
npx -y vercel-doctor@latest . --yes --score--yes 跳过交互式提示。与 --score 一起使用时,仅输出数字分数,便于在脚本和流水线中使用。
编程 API
Vercel Doctor 也导出编程 API:
import { run } from "vercel-doctor/api";Oxlint 插件
账单检查规则可单独作为 Oxlint 插件使用:
import plugin from "vercel-doctor/oxlint-plugin";Edit on GitHub
Last updated on