🔐
env-table
读取环境变量并以表格形式显示
SidecarRuntimeenv sidecarready
功能概述
从系统环境变量中读取指定的变量名列表,以表格形式展示变量名、值和是否已设置。支持批量查看多个环境变量,适合用于文档中展示项目运行所需的环境配置。
核心特性
- ✓ 通过 Sidecar 后端安全读取环境变量
- ✓ 支持按名称批量读取环境变量
- ✓ 表格形式结构化展示
- ✓ 支持 Inline 和 Block 两种渲染模式
- ✓ 安全隔离,前端无法直接访问系统变量
Actions
| Action | 标签 | 说明 |
|---|---|---|
compute | 🔐 读取 | 读取系统环境变量并返回结果 |
配置参数
| 字段 | 类型 | 必需 | 默认 | 说明 |
|---|---|---|---|---|
variables | string[] | ✅ | — | 要读取的环境变量名列表 |
输出结构
{
"type": "object",
"properties": {
"variables": {
"type": "array",
"description": "Environment variables with their values",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
},
"isSet": {
"type": "boolean"
}
}
}
},
"count": {
"type": "number",
"description": "Total count of variables"
},
"setCount": {
"type": "number",
"description": "Count of set variables"
},
"timestamp": {
"type": "string",
"description": "Read timestamp"
}
}
}使用示例
查看 Node 环境变量
读取常见的 Node.js 相关环境变量
::define[env-check]{plugin="env-table"}
```config
{
"variables": ["NODE_ENV", "PATH", "HOME"]
}
```
::渲染
- Inline:✅ 支持
- Block:✅ 支持
environmentsystemsidecar