Validate JSON/YAML config files against JSON Schema.
npm install -g config-validate-cli# Validate with a custom schema
config-validate -c config.json -s schema.json
# Validate common configs (built-in schemas for package.json, tsconfig.json)
config-validate -c package.json
# Strict mode — disallow additional properties
config-validate -c config.yaml -s schema.json --strict
# JSON output for CI pipelines
config-validate -c config.json -s schema.json --json
# Verbose — list all checked fields
config-validate -c package.json --verbose| Flag | Description |
|---|---|
-c, --config <path> |
Path to the config file (JSON or YAML) |
-s, --schema <path> |
Path to the JSON Schema file |
--strict |
Disallow additional properties |
--json |
Output results as JSON |
--verbose |
Show all validated fields |
-V, --version |
Show version |
-h, --help |
Show help |
When no -s flag is provided, the tool uses built-in schemas for:
package.json— validates name, version, scripts, dependenciestsconfig.json— validates compilerOptions, include, exclude
0— config is valid1— config is invalid or an error occurred
MIT