Envdoctor

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Nov 7, 2026

Local environment doctor: runtime, tools, env files, and services, pass or fail.

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

本地环境体检工具:检查仓库目录的 Node 版本、git、npm、锁文件与 .env 键名,并返回通过或问题报告。

可以做什么
  • 对仓库目录运行一组确定性检查,返回 JSON 报告与 HEALTHY 或 ISSUES 结论。
  • 比对当前 Node 版本与 package.json 中 engines.node 的范围,并确认 git 与 npm 可用。
  • 检查是否存在锁文件(npm、yarn 或 pnpm),并说明找到的是哪一个。
  • 比对 .env 与 .env.example 的键名,列出缺失的键,不读取任何值。
  • 汇总已运行、通过、失败、警告与跳过的检查数量,以及按严重程度分类的问题条目。
适用场景
适合在助手需要排查项目为何无法在当前机器上构建或启动时使用,或在克隆仓库后、开始配置前确认是否满足声明的先决条件。它是范围很窄的只读检查,不是通用的系统或服务监控。
运行要求
以本地 stdio 进程运行,可通过 npx 使用 npm 包,或使用已发布的容器镜像。机器上需要 Node.js 与 npm,git 检查需要 git。未声明任何账号、API 密钥、环境变量或请求头。
安装前请注意
只读:不执行目标仓库中的代码,仅运行 git --version 与 npm --version。会解析 .env 但丢弃其中的值,只报告键名。不检查端口、运行中的服务、数据库、网络连通性或磁盘空间,因此 HEALTHY 结论仅限所列的五项检查。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Envdoctor,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

envdoctor

envdoctor checks whether this machine's environment matches what a repo says it needs. Point it at a repo directory and it runs a small set of deterministic checks, each one passing or failing with the fix named. It never runs code from the repo, and it never prints a secret value.

Install

Run it without installing:

sh
npx @reneturcios/envdoctor doctor [path]

Or install it globally:

sh
npm install -g @reneturcios/envdoctor

CLI

sh
envdoctor doctor [path] [--json]envdoctor mcpenvdoctor --version
  • doctor [path] checks the repo at path (default: the current directory) and prints a human readable report. Add --json for the machine readable report.
  • mcp starts the MCP server on stdio.
  • --version prints the version.

Exit codes: 0 when the verdict is HEALTHY, 1 when the verdict is ISSUES, 2 for a usage error such as a target that does not exist, and 141 when the reader closed the output pipe early.

MCP

The MCP server exposes one tool:

  • doctor_env takes a path argument, runs the same checks as the CLI, and returns the JSON report.

Checks

v0.1 runs five checks, in this order:

  1. NODE-VERSION - Compares the running Node version (process.version) against the engines.node range in the target's package.json. Supported range syntax: >=, <=, >, <, =, caret ranges such as ^20.0.0, tilde ranges such as ~20.11.0, exact versions such as 20.11.0, x-ranges such as 20.x and 20.11.x, partial versions, and space separated combinations such as >=18 <21. A range outside that syntax is reported as an info finding with rule RANGE-UNSUPPORTED instead of a guess. When the target has no package.json, this check is skipped with an info finding with rule NO-PACKAGE-JSON, and the remaining checks still run.
  2. GIT-PRESENT - Passes when git --version succeeds.
  3. NPM-PRESENT - Passes when npm --version succeeds.
  4. LOCKFILE - Passes when one of package-lock.json, yarn.lock, or pnpm-lock.yaml exists at the target (the report says which one). A missing lockfile is a medium finding with rule NO-LOCKFILE.
  5. ENV-FILE - Only applies when .env.example exists at the target. If .env is missing, that is a medium finding with rule ENV-MISSING and the fix "copy .env.example to .env and fill values". If .env exists, the key names in .env.example are compared against the key names in .env, and each name missing from .env is a medium finding with rule ENV-KEYS-MISSING. When there is no .env.example, the check passes because no env file is required.

Every passed check is counted in counts.checksPassed and appears in the report findings as an info entry with rule CHECK-PASS, so the printed report lists every check that ran.

Env values are never read into output

This guarantee is plain: envdoctor compares key names only.

  • Both .env.example and .env are parsed by reading only the text left of the first = on each line. That text is the key name.
  • Everything from the first = onward is a value. Values are discarded at parse time. They are not stored, not returned, not logged, and not printed in any report, finding, summary, or error.
  • Findings about env files name keys, never values. For example, an ENV-KEYS-MISSING finding says a key named in .env.example is missing from .env; it says nothing about any value.

Verdict rules

  • HEALTHY - No medium or high findings. Passed checks, skipped checks with a stated reason, and info notes such as RANGE-UNSUPPORTED do not change this verdict.
  • ISSUES - At least one medium or high finding exists.

The report counts are checksRun, checksPassed, checksFailed, checksWarned, and checksSkipped, plus a findings total broken down by severity.

Limits

  • v0.1 checks Node, git, npm, and files only: the engines.node range, the two tool versions, the lockfile, and the env files described above.
  • Ports, running services, databases, and network reachability are not checked in v0.1. Port and service checks are future work.
  • Disk space is out of scope.
  • Only the Node range syntax listed under NODE-VERSION is supported. Any other range syntax produces a RANGE-UNSUPPORTED info finding rather than a pass or fail.
  • Nothing in the target repo is executed. The only commands envdoctor runs are git --version and npm --version.

来源:README.md,提交 2e224a4

工具

1

doctor_env

Run environment checks for a repo directory: node version satisfies package.json engines, git is available, the expected lockfile for the project exists, a .env file is present when .env.example declares one is needed (only key names compared, values never read), and npm is on PATH. Each check reports pass or fail with the fix. Verdict HEALTHY or ISSUES.

输入参数path必填

版本历史

1
  1. v0.1.0最新Oct 30, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分