Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

voce validate

Run the full Voce IR validation suite against a .voce.json file. The validator executes 9 independent passes covering structural integrity, accessibility, security, SEO, and more. Any failing pass causes a non-zero exit.

Usage

voce validate <FILE> [OPTIONS]

Arguments

ArgumentDescription
<FILE>Path to a .voce.json IR file (required)

Options

FlagDefaultDescription
--format <FORMAT>terminalOutput format: terminal (colored, human-readable) or json (machine-readable)
--warn-as-erroroffTreat warnings as errors, causing a non-zero exit code

Validation Passes

The validator runs the following passes in order:

PassCode PrefixWhat it checks
StructuralSTR001–STR005Required fields, node completeness, document structure
ReferencesREF001–REF009All node refs resolve, no dangling IDs, no cycles
State MachineSTA001–STA004Valid states, transitions, initial state exists
AccessibilityA11Y001–A11Y005Keyboard equivalents, heading hierarchy, alt text, form labels
SecuritySEC001–SEC004CSRF on mutations, auth redirects, HTTPS enforcement, password autocomplete
SEOSEO001–SEO007Title present, description length, single h1, OpenGraph completeness
FormsFRM001–FRM009Fields required, labels present, unique names, email pattern validation
InternationalizationI18N001–I18N003Localized key non-empty, default value present, consistency across locales
MotionMOT001–MOT005ReducedMotion fallback required, damping > 0, duration warnings

Exit Codes

CodeMeaning
0All passes succeeded (no errors, no warnings or --warn-as-error not set)
1One or more validation errors (or warnings when --warn-as-error is set)

Examples

Validate a file with colored terminal output:

voce validate examples/landing-page.voce.json

Validate and get JSON output (useful for CI or piping to jq):

voce validate examples/landing-page.voce.json --format json

Fail the build on any warning:

voce validate my-app.voce.json --warn-as-error

Combine with other tools:

# Validate, then compile only if valid
voce validate app.voce.json && voce compile app.voce.json

JSON Output Schema

When --format json is used, the output is a JSON object:

{
  "valid": false,
  "errors": [
    { "pass": "A11Y", "code": "A11Y003", "message": "Image node missing alt text", "node_id": "img-hero" }
  ],
  "warnings": [
    { "pass": "MOT", "code": "MOT005", "message": "Animation duration exceeds 5s", "node_id": "fade-in" }
  ]
}