Skip to main content

Quick Start

This page walks through a first run of the validator. It assumes you have already installed the tool.

Validate the current directory​

Run validator with no arguments to validate all recognized config files in the current directory and its subdirectories:

validator

The validator finds files by extension (.json, .yaml, .toml, .xml, etc.) and by known filename (.gitconfig, Pipfile, tsconfig.json, etc.). It parses each file and reports pass or fail.

Validate a specific path​

Pass one or more paths as arguments:

validator ./config ./deploy/manifests

Check the results​

A successful run exits with code 0. If any file fails, the exit code is 1 and the output shows the parse error.

Common options​

Exclude directories you don't want validated:

validator --exclude-dirs=node_modules,vendor,.git .

Limit to specific file types:

validator --file-types=json,yaml .

Enable automatic schema validation via SchemaStore:

validator --schemastore .

Suppress all output (useful in scripts — check the exit code instead):

validator --quiet .

Schema validation​

Files that declare a $schema (JSON, TOML) or yaml-language-server comment (YAML) are validated against their schema automatically. No flags required.

To also validate files that don't declare a schema, use --schemastore. This looks up schemas by filename from the SchemaStore catalog — covering package.json, GitHub Actions workflows, tsconfig.json, and hundreds more:

validator --schemastore .

See the Schema Validation guide for details.

Use a project config file​

Instead of passing flags every time, create a .cfv.toml in your project root:

exclude-dirs = ["node_modules", ".git", "vendor"]
gitignore = true
schemastore = true
reporter = ["standard"]

The validator picks it up automatically. See Configuration File for all available options.

Flags can also be set via environment variables. See Environment Variables for the full list.

Next steps​