kq materialize
Writes every baseline your repository's preset names out as a policy set of your own, of the baseline's kind, in model/policies.kq, so you can change it: remove a policy, tighten one, add your own. It then removes preset from kanoniq.repository.json, with the comment written on or directly above it, and keeps everything else there, other comments included.
kq materialize [options] [<path>]
Arguments
| Argument | Is |
|---|---|
[<path>] | A file or folder of the model; the current folder by default. |
Options
| Option | Does |
|---|---|
--check | Write nothing; list what would be written and removed, and exit 1 if anything would. |
Environment
| Variable | Does |
|---|---|
KANONIQ_TELEMETRY | off, 0 or false stops kq reporting the run; so does DO_NOT_TRACK=1. |
Exit codes
| Code | Means |
|---|---|
0 | Done |
1 | Failed: the model has an error, a check found a change, or a file could not be read or written |
2 | Usage error: an unknown command or option, a missing or extra argument, a path that does not exist, or an output folder kq will not clear |
Each policy keeps the Id it had, so findings stay the same findings in a SARIF viewer, and an exemption of baseline-model-recommended/vaulted still names it. It refuses, writing nothing, where preset is not set, or where the model already has a set with any of the presets' Codes. The written sets are your own from then on, so they are checked only with a license for a paid plan, as your other sets are; without one, kq materialize says so, and writes them all the same.
$ kq materialize models/my-model
rewrote models/my-model/model/policies.kq, writing out policy sets baseline-model-recommended, baseline-architecture-recommended
rewrote models/my-model/model/my-model.g.kq, keeping the Ids of baseline-model-recommended, baseline-architecture-recommended and their policies
removed 'preset' from models/my-model/kanoniq.repository.json
© 2026 Extenza Works. All rights reserved.