██▒ █▓ ▄▄▄ ██▀███ ██▓ ▒█████ ▄████▄ ██ ▄█▀ ▓██░ █▒▒████▄ ▓██ ▒ ██▒▓██▒ ▒██▒ ██▒▒██▀ ▀█ ██▄█▒ ▓██ █▒░▒██ ▀█▄ ▓██ ░▄█ ▒▒██░ ▒██░ ██▒▒██ ▄ ▓███▄░ ▒██ █░░░██▄▄▄▄██ ▒██▀▀█▄ ▒██░ ▒██ ██░▒██▄ ▄██▒▓██ █▄ ▒▀█░ ▓█ ▓██▒░██▓ ▒██▒░██████▒░ █████▒░▒ ████▀ ░▒██▒ █▄ ░ ▐░ ▒▒ ▓▒█░░ ▒▓ ░▒▓░░ ▒░▓ ░░ ▒░▒░▒░ ░ ░▒ ▒ ░▒ ▒▒ ▓▒ ░ ░░ ▒ ▒▒ ░ ░▒ ░ ▒░░ ░ ▒ ░ ░ ▒ ▒░ ░ ▒ ░ ░▒ ▒░ ░░ ░ ▒ ░░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ Magic .env files built for sharing: Human-first, AI-friendly .env.schema # API key with validation, securely fetched from 1Password # @required @sensitive @type = string( startsWith = sk- ) OPENAI_API_KEY = exec ( ' op read "op://api-prod/openai/api-key" ' ) # Non-secret value, included directly # @type = url SOME_SERVICE_API_URL = https://api.someservice.com Use @decorator comments in your .env file(s) to create a declarative schema for your config and a new function call syntax to securely load secrets from external sources. Validation Powerful validation capabilities, without custom logic. Misconfiguration errors are surfaced much earlier in your development cycle, with clear error messages. Type-safety Automatically generate types according to your schema instead of writing them by hand. Security Protect your secrets from accidental leaks. Redact secrets in stdout and global console methods. Environments Compose defaults, environment-specific .env files, and local git-ignored overrides. Secure secrets Read from any external provider via CLI commands. Installation Terminal window # Install as standalone CLI via homebrew brew install varlock # OR Install via cURL curl -sSfL https://varlock.dev/install.sh | sh -s # OR init and install as a dependency in a js project npx varlock init Drop-in replacement for dotenv Replace dotenv with varlock // auto-load import 'dotenv/config'; import 'varlock/auto-load'; // CLI dotenvx run -- node app.js varlock run -- node app.js