Skip to main content

βš™οΈ Configuration

Env Checkup can be customized using a configuration file named envcheckup.config.json, placed in your project root.
It allows you to define paths, rules, and preferences for how environment validation should work.


🧩 Configuration File: envcheckup.config.json​

Here’s an example configuration file:

{
"schemaPath": "./.env.schema.json",
"envDir": "./",
"strict": true,
"ignore": ["NODE_ENV", "DEBUG"]
}

βš™οΈ Options​

KeyTypeDefaultDescription
schemaPathstring.env.schema.jsonPath to your schema file
envDirstring.Directory where .env files should be searched
strictbooleanfalseWhen enabled, validation fails if any variable is missing or invalid
ignorestring[][]List of environment variables to skip during validation

🧠 Example Setup​

Project structure:

my-app/
┣ .env
┣ .env.schema.json
┣ envcheckup.config.json
┣ src/
┃ β”— index.ts
β”— package.json

envcheckup.config.json:

{
"schemaPath": "./.env.schema.json",
"envDir": "./",
"strict": true
}

When you run:

npx env-checkup validate

Env Checkup will:

  1. Load your config from envcheckup.config.json
  2. Look for .env files inside the specified envDir
  3. Validate them using your schemaPath
  4. Fail the command if strict mode is true and any variable is missing

🧩 CLI Overrides​

All config values can be overridden via CLI flags:

env-checkup validate --schema ./config/custom.schema.json --dir ./src/envs --strict

Available Flags​

FlagDescription
--schema <path>Path to schema file
--dir <path>Directory containing .env files
--strictEnable strict mode
--ignore <vars>Comma-separated list of variables to skip

🧾 Example Commands​

Validate using default config:

npx env-checkup validate

Validate using a custom schema path:

npx env-checkup validate --schema ./config/env.schema.json

Run in strict mode (fail if any variable is missing):

npx env-checkup validate --strict

Ignore specific variables:

npx env-checkup validate --ignore NODE_ENV,DEBUG

🧠 Notes​

  • envcheckup.config.json must be in the project root.
  • CLI flags always override values in the config file.
  • If no config file is found, default settings are used.

🏁 Summary​

SourceExamplePriority
Config Fileenvcheckup.config.json🟑 Medium
CLI Flag--schema ./custom.schema.jsonπŸ”΄ High
DefaultBuilt-in defaults🟒 Low

Your configuration is now ready! Next: β†’ CLI Commands Overview