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 分