READMESource: main@74def2df
dsh-env-manager · 环境变量管理
扫描代码中引用的环境变量,与 .env 比对检测缺失/未使用;从 .env 生成脱敏的 .env.example。纯 Node 实现,无网络、无外部服务。
提供的工具
| 工具 | 作用 |
|---|---|
env_check |
扫描代码引用的环境变量,与 .env 比对,返回「缺失」与「未使用」清单 |
env_example |
从 .env 生成 .env.example(键保留、值脱敏) |
安装
dsh plugin add dsh-env-manager
安装后在 profile 的 package.json 的 dsh.profile.bundles 中加入 "dsh-env-manager"。
用法示例
帮我检查这个项目有没有漏配置的环境变量
→ 调用 env_check(root="/workspace")
生成一份 .env.example
→ 调用 env_example(root="/workspace")
说明
- 识别
process.env.X、process.env["X"]、import.meta.env.X、os.environ["X"]、os.getenv("X")等常见写法。 - 自动跳过 node_modules、.git、二进制/图片等文件。
No comments yet. Be the first to write one.