check
Validate resolved .env values against an Envfile without running a command. An Envfile in the current directory is required; .env.example is not used for validation.
Usage
Validate resolved .env values against an Envfile without running a command. An Envfile in the current directory is required; .env.example is not used for validation.
# Envfile
env "DATABASE_URL", type: "url"
env "PORT", type: "port"
env "SENTRY_DSN", optional: true
$ dotenvx check
[INVALID_ENV] DATABASE_URL is required; PORT is required
The command enforces required values, types, enums, bounds, and encryption requirements. It exits with code 1 on validation or other loading errors. Missing env files are reported but do not fail validation when the resolved values satisfy Envfile. On success, it prints ▣ valid (.env) (listing the loaded input files) and exits with code 0 on success. It does not change your shell’s environment.
A missing Envfile reports ENVFILE_REQUIRED; invalid syntax reports MALFORMED_ENVFILE.