← 返回 Skills 市场
wuhaichao87

Env Loader

作者 wuhaichao87 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
90
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install env-loader
功能描述
Shell-agnostic .env file loader. Generates a POSIX-compatible script to safely load environment variables from .env files across bash, zsh, dash, and ash. Us...
使用说明 (SKILL.md)

Env Loader

Generates and validates POSIX-compatible .env loading scripts that work consistently across bash, zsh, dash, and ash.

Problem It Solves

source .env behaves differently across shells:

  • zsh: Strips quotes from values correctly
  • bash/dash: Preserves quotes as part of the value ("value" → includes the quotes)
  • All shells: source only assigns, does not export — child processes can't see the variables

This causes silent failures in deployment when .env files contain quoted values or special characters.

Usage

Generate the Loader Script

Run the bundled script or use the template:

bash ~/.openclaw/skills/env-loader/scripts/generate-loader.sh /path/to/project

This creates load-env.sh in the target directory.

Use in Deployment Scripts

# Instead of: source .env
# Use:
. ./load-env.sh .env

Validate an Existing .env File

bash ~/.openclaw/skills/env-loader/scripts/validate-env.sh /path/to/.env

Checks for common issues: unquoted special characters, inline comments, non-POSIX variable names.

Key Design Principles

  1. POSIX-only syntax — no bashisms, no zsh-isms, works in dash/ash
  2. Manual key=value parsing — never source or eval the .env file directly
  3. Explicit quote stripping — removes surrounding single or double quotes consistently
  4. Key validation — only allows [A-Za-z_][A-Za-z0-9_]* as variable names
  5. Explicit export — every parsed variable is exported for child processes

References

See references/env-pitfalls.md for a detailed catalog of shell-specific .env parsing pitfalls.

安全使用建议
Treat this as an incomplete review, not a substantive approval. Re-run the review when metadata.json and artifact/ can be accessed so the skill contents can be assessed directly.
能力评估
Purpose & Capability
No artifact-backed purpose or capability concern could be identified because the workspace files could not be read.
Instruction Scope
No artifact-backed instruction-scope concern could be identified.
Install Mechanism
No artifact-backed install-mechanism concern could be identified.
Credentials
No artifact-backed environment or authority concern could be identified.
Persistence & Privilege
No artifact-backed persistence or privilege concern could be identified.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install env-loader
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /env-loader 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Shell-agnostic .env file loader for cross-shell compatibility
元数据
Slug env-loader
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Env Loader 是什么?

Shell-agnostic .env file loader. Generates a POSIX-compatible script to safely load environment variables from .env files across bash, zsh, dash, and ash. Us... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 90 次。

如何安装 Env Loader?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install env-loader」即可一键安装,无需额外配置。

Env Loader 是免费的吗?

是的,Env Loader 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Env Loader 支持哪些平台?

Env Loader 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Env Loader?

由 wuhaichao87(@wuhaichao87)开发并维护,当前版本 v1.0.0。

💬 留言讨论