Commands · reference

config-weave init

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

init scaffolds a skeleton playbook that validates as written. It creates one package named example with a resource, a gatherer and a verify script, so every kind of file has a working starting point. Your first playbook walks through the result.

Synopsis

console
config-weave init [OPTIONS] <DIR>

Arguments

ArgumentMeaning
DIRDestination directory for the new playbook. Created when missing. The command refuses to run when DIR/playbook.wcl already exists.

Options

Only the global options apply. None of them change what init writes.

What it writes

FilePurpose
playbook.wclA playbook with one play that uses the example package.
pkgs/example/package.wclA package declaring the file_present resource, the os_info gatherer and a test.
pkgs/example/resources/file_present.wsA resource script with check and apply entry points.
pkgs/example/gatherers/os_info.wsA gatherer script with a gather entry point.
pkgs/example/tests/greeting_verify.wsA verify script for the package's test.
lib/README.md, pkgs/example/lib/README.mdPlaceholders explaining the playbook-level and package-level lib/ import roots.
.gitignoreIgnores .repo-cache/, the clone cache used by config-weave pkg.

Examples

console
config-weave init ./my-playbook
scaffolded a playbook in ./my-playbook — next: edit, then `config-weave validate ./my-playbook`
config-weave validate ./my-playbook
ok: playbook 'My Playbook' v0.1.0 — 2 package(s), 1 play(s), 3 step(s)

The second package is the built-in weave package, which ships inside the binary. The three steps are the greeting step plus the two steps the greeting_pair composite expands into.

Exit status

0 when every file was written. 2 when playbook.wcl already exists in the target directory or a file could not be written.