βοΈ 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β
| Key | Type | Default | Description |
|---|---|---|---|
schemaPath | string | .env.schema.json | Path to your schema file |
envDir | string | . | Directory where .env files should be searched |
strict | boolean | false | When enabled, validation fails if any variable is missing or invalid |
ignore | string[] | [] | 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:
- Load your config from
envcheckup.config.json - Look for
.envfiles inside the specifiedenvDir - Validate them using your
schemaPath - Fail the command if
strictmode 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β
| Flag | Description |
|---|---|
--schema <path> | Path to schema file |
--dir <path> | Directory containing .env files |
--strict | Enable 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.jsonmust 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β
| Source | Example | Priority |
|---|---|---|
| Config File | envcheckup.config.json | π‘ Medium |
| CLI Flag | --schema ./custom.schema.json | π΄ High |
| Default | Built-in defaults | π’ Low |
Your configuration is now ready! Next: β CLI Commands Overview