run with a Dotenvxfile
When a Dotenvxfile is present, run automatically validates the resolved environment before starting your command. No validation flag is needed.
Usage
When a Dotenvxfile is present, run validates resolved values before starting your command. No validation flag is needed.
# Dotenvxfile
strict true
env "DATABASE_URL", type: "url", required: true, redacted: true
env "API_KEY", required: true, redacted: true
env "SENTRY_DSN", optional: true
$ dotenvx run -- node index.js
Missing required values report INVALID_ENV. With strict true, validation failures stop the command. Files that omit strict or set strict false warn instead. CLI --strict also stops on loading errors.