run with an Envfile

When an Envfile is present, run automatically validates the resolved environment before starting your command. No validation flag is needed.

Usage

When an Envfile is present, run automatically validates the resolved environment before starting your command. No validation flag is needed.

# Envfile
strict true

env "DATABASE_URL", type: "url"
env "API_KEY"
env "SENTRY_DSN", optional: true
$ dotenvx run -- node index.js
[INVALID_ENV] DATABASE_URL is required; API_KEY is required

dotenvx spec generates strict true, so validation failures stop the command. Files that omit strict or set strict false warn instead. Other loading errors require --strict to stop execution.