Bundle
dsh-env-manager
环境变量管理:扫描代码引用的环境变量与 .env 比对检测缺失/未使用,并从 .env 生成脱敏的 .env.example
- Source
- uckkk
- License
- MIT
- Updated
- Updated 19 days ago
Readme
# dsh-env-manager · 环境变量管理
扫描代码中引用的环境变量,与 `.env` 比对检测缺失/未使用;从 `.env` 生成脱敏的 `.env.example`。纯 Node 实现,无网络、无外部服务。
## 提供的工具
| 工具 | 作用 |
|---|---|
| `env_check` | 扫描代码引用的环境变量,与 .env 比对,返回「缺失」与「未使用」清单 |
| `env_example` | 从 .env 生成 .env.example(键保留、值脱敏) |
## 安装
```bash
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、二进制/图片等文件。
## 安装
```bash
dsh plugin add github:uckkk/dsh-env-manager
```
> 安装即在本机运行第三方代码,请自行审阅源码。
## 安装
```bash
dsh plugin add github:uckkk/dsh-env-manager
```
## 使用
安装后在会话中调用该插件注册的工具即可。
## 许可
MIT
> 安装即在本机运行第三方代码,请自行审阅源码。
Install
dsh plugin --profile web add github:uckkk/dsh-env-manager
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-env-manager from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.