ofershap/env-guard · Archived

env-validation

Validate .env files against .env.example or a JSON schema. Use when checking environment variables before deploy or debugging missing config.

First seen Mar 5, 2026

Installation

$ npx skills add ofershap/env-guard --skill env-validation

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

License LICENSE
Default branch main
Open issues 0
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,211 B
  • docs SUMMARY.md 163 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Environment Variable Validation

Use this skill to validate .env files against .env.example or a JSON schema. Catches missing, extra, or invalid environment variables before your app does.

Usage

# Zero config — checks .env against .env.example
npx env-guard

# Custom paths
npx env-guard --env .env.production --example .env.example

# JSON schema validation
npx env-guard --schema env-schema.json

As a Library

import { validate } from "env-guard";

const result = validate({
  env: ".env",
  example: ".env.example",
});

if (!result.valid) {
  console.error(result.errors);
  process.exit(1);
}

Key Patterns

  • Zero config by default — compares .env against .env.example in the current directory
  • JSON schema mode validates types, patterns, and required fields
  • Returns structured errors: missing variables, extra variables, type mismatches
  • Zero dependencies — no supply chain risk
  • Exit code 1 on failure — safe to use in CI pipelines and pre-deploy hooks