← Back to Skills Marketplace
wuhaichao87

Env Loader

by wuhaichao87 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
90
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install env-loader
Description
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...
README (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.

Usage Guidance
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install env-loader
  3. After installation, invoke the skill by name or use /env-loader
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Shell-agnostic .env file loader for cross-shell compatibility
Metadata
Slug env-loader
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 90 downloads so far.

How do I install Env Loader?

Run "/install env-loader" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Env Loader free?

Yes, Env Loader is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Env Loader support?

Env Loader is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Env Loader?

It is built and maintained by wuhaichao87 (@wuhaichao87); the current version is v1.0.0.

💬 Comments