New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

env-verifier-cli

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-verifier-cli

🛡️ A command-line tool to validate .env files against a defined schema to ensure correct environment variable configurations.

latest
Source
npmnpm
Version
1.1.6
Version published
Maintainers
1
Created
Source

🛡️ env-verifier-cli

A lightweight and powerful CLI tool to validate your .env files against a defined schema. Very easy to configure with minimal setup.

CLI Terminal Sample Image

🚀 Features

Validate .env files for:

  • ❗ Missing or invalid required keys
  • ⚠️ Unused keys not defined in your schema
  • 🧪 Type checking: string, number, boolean, array, JSON (object), Object, Date
  • 🧩 Support for optional keys, allowing flexible configurations
  • 🔁 Works with multiple .env files (e.g., .env.production, .env.staging, .env.test) and supports type-specific validation for each
  • 🛠️ Customizable schema for defining required and optional keys with specific types (string, number, boolean, array, JSON)
  • 🌍 Multi-environment support with easy-to-understand validation for complex configurations

📦 Installation

Global:

npm install -g env-verifier-cli

Local (as dev dependency):

npm install --save-dev env-verifier-cli

👨‍💻 Usage

env-verifier --env .env --schema env.schema.json

Or

env-verifier --env .env.staging --schema env.schema.json

Or for different folder paths

env-verifier --env %USERPROFILE%\Downloads\.env --schema %USERPROFILE%\Downloads\env.schema.json --exit true
env-verifier --env $HOME/Downloads/.env --schema $HOME/Downloads/env.schema.json --exit 1
env-verifier --env ~/Downloads/.env --schema ~/Downloads/env.schema.json --exit false

Options:

--env     Path to the .env file to validate                                               (default: .env)
--schema  Path to the schema JSON file                                                    (default: env.schema.json)
--exit    Set true, 'true' or 1 if you want to throw on invalids or warnings              (default: true)

📂 Example (for more details see env.schema.json)

.env file:

API_KEY=abc123
DEBUG_MODE=true
PORT=3000

env.schema.json file:

{
    "REQUIRED_KEYS": {
        "API_KEY": "string",
        "DEBUG_MODE": "boolean"
    },

    "OPTIONAL_KEYS": {
        "PORT": "number"
    }
}

🧩 Supported Types

  • stringmy-api-key, https://example.com, debug
  • number3000, 42, 3.14
  • booleantrue, false
  • array["https://myapp.com", "https://admin.myapp.com"], ["feature1", "feature2", "feature3"]
  • JSON (object){"theme": "dark", "notifications": true}, {"maxRetries": 3, "timeout": 5000}
  • date2025-01-01, 2023-05-01T15:30:00Z

🔐 FAQ

Don't worry, the .env files provided in this repository contain dummy data only.

Keywords

env-verifier-cli

FAQs

Package last updated on 12 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts