Overview
Thevalidate command checks your webreel configuration file for errors without executing any steps or recording. It validates the file against the webreel JSON schema and reports any syntax errors, invalid fields, or missing required properties.
Syntax
Options
| Option | Type | Default | Description |
|---|---|---|---|
-c, --config <path> | string | webreel.config.json | Path to the configuration file to validate |
Usage Examples
Validate the default config
Validatewebreel.config.json in the current directory:
Validate a custom config
Validate a specific configuration file:Validate before recording
Run validation before a long recording job:What Is Validated
JSON syntax
The command checks that your file is valid JSON or JSONC (JSON with comments):- Proper bracket and brace matching
- Correct quote usage
- Valid escape sequences
- No trailing commas (in strict JSON mode)
Schema compliance
If your config includes a$schema field, validation checks:
- All required fields are present
- Field types match the schema (string, number, boolean, object, array)
- Enum values are valid
- Nested objects follow the correct structure
Field presence
Validates that required fields exist:videosobject must be present- Each video must have a
url - Each step must have an
action - Action-specific required fields (e.g.,
msforpause,keyforkeyaction)
Type checking
Ensures field values have the correct type:- Numbers for
viewport.width,viewport.height,defaultDelay,ms - Strings for
url,text,selector,key - Booleans for flags like
thumbnail.enabled - Arrays for
steps,include
Error Reporting
JSON syntax errors
If your JSON is malformed:- Missing commas
- Extra commas
- Unclosed brackets or braces
- Unquoted strings
Schema validation errors
If the config structure is invalid:- Line number (if available)
- Path to the invalid field
- Description of what is wrong
File Support
JSON files
Validation works with.json files and uses the JSONC parser, which supports:
- Single-line comments:
// comment - Multi-line comments:
/* comment */ - Trailing commas (parsed but may be flagged depending on schema)
Other file types
For non-JSON config files, validate attempts to load the config using the standard config loader, which may support other formats in the future.Schema Versions
webreel validates against different schema versions based on your$schema field:
When to Use
Usevalidate when you:
- Have made manual edits to your config file
- Are debugging configuration errors
- Want to check syntax before committing changes
- Need to validate multiple config files in a CI pipeline
- Are generating configs programmatically
Validation in Workflows
Pre-commit hook
Validate configs before committing:CI/CD pipeline
Validate in your build pipeline:Multiple configs
Validate all config files in a directory:Limitations
Runtime validation
Validate only checks config structure. It does not:- Check if URLs are accessible
- Verify that selectors exist on the page
- Validate that actions will succeed
- Test step sequences
webreel preview for runtime testing.
External files
Validate does not verify that external references exist:- Include files specified in
includearrays - Custom sound effect files in
sfxconfig - Custom output directories
record or preview.
Validation is fast and safe. It only reads your config file and does not launch browsers, download binaries, or make network requests.
Related Commands
webreel preview- Test your config with actual browser automationwebreel record- Record videos (validates config automatically before recording)webreel init- Generate a valid config template