Skip to content

dsh-env-manager

Verified

dsh-env-manager · v0.1.0 · MIT

环境变量管理:扫描代码引用的环境变量与 .env 比对检测缺失/未使用,并从 .env 生成脱敏的 .env.example

Install

dsh plugin add dsh-env-manager

Confirm the layer applied with dsh --profile default --dump-config — see the install guide.

Source

Published to npm without a public repository. Inspect the package contents before installing.

Tags

Readme

dsh-env-manager · 环境变量管理

扫描代码中引用的环境变量,与 .env 比对检测缺失/未使用;从 .env 生成脱敏的 .env.example。纯 Node 实现,无网络、无外部服务。

提供的工具

工具 作用
env_check 扫描代码引用的环境变量,与 .env 比对,返回「缺失」与「未使用」清单
env_example 从 .env 生成 .env.example(键保留、值脱敏)

安装

dsh plugin add dsh-env-manager

安装后在 profile 的 package.jsondsh.profile.bundles 中加入 "dsh-env-manager"

用法示例

帮我检查这个项目有没有漏配置的环境变量
→ 调用 env_check(root="/workspace")

生成一份 .env.example
→ 调用 env_example(root="/workspace")

说明

  • 识别 process.env.Xprocess.env["X"]import.meta.env.Xos.environ["X"]os.getenv("X") 等常见写法。
  • 自动跳过 node_modules、.git、二进制/图片等文件。