Commands · reference

config-weave validate

3 min read · 2026-09-02 · config-weave 0.1.0

validate runs the whole validation pipeline and executes nothing. The same pipeline runs implicitly at the start of every check, apply, test and docs invocation, so a playbook that passes validate will not fail those commands before execution starts. Validation is platform independent: a playbook validates identically on Linux and Windows.

Synopsis

console
config-weave validate [OPTIONS] <PLAYBOOK_DIR>

Arguments

ArgumentMeaning
PLAYBOOK_DIRThe playbook directory.

Options

All global options apply. --json switches the summary to a JSON object with ok, playbook, version, packages, plays, steps and a diags list. The variable and password options are accepted but not consulted.

Pipeline stages

The stages run in order and all findings are reported together.

  1. Parse playbook.wcl and every pkgs/*/package.wcl. A WCL parse error stops here.
  2. Structural checks: referenced packages, resources and gatherers exist; every mandatory description is present; gatherer invocation names are unique; every script file exists; every secret() call is encrypted.
  3. Schema validation: each step's properties and each gatherer invocation's params are checked against the declared schema. An unknown key, a missing required key or a coarse type mismatch is an error.
  4. Build the step DAG for every play, expanding composites, and reject cycles and unknown requires targets.
  5. Compile every wscript script (resources, gatherers, verify scripts, scenarios and lib/ files) against the full host API. The wscript type checker enforces the entry-point signatures and catches misuse of a host module.

See Playbooks, plays and steps for the structure the checks enforce and Script entry points for the signatures stage 5 requires.

Examples

console
config-weave validate ./my-playbook
ok: playbook 'my-playbook' v0.1.0 — 2 package(s), 2 play(s), 8 step(s)

A failure lists every diagnostic on stderr and ends with a count.

console
config-weave validate ./my-playbook
error: step 'nginx_conf' in play 'web': unknown property 'contents' (did you mean 'content'?)
validation failed with 1 error

Exit status

0 when the playbook is clean. 2 when any stage reported an error.