kq fmt
Rewrites each .kq file you wrote in canonical form: two-space indents, one statement per line, aligned columns, and every reference in its shortest form. Comments and blank lines are kept. Each file is read with the rest of its model, so references across files are understood, but nothing moves between files. <name>.g.kq is left alone.
kq fmt [options] <path>...
Arguments
| Argument | Is |
|---|---|
<path>... | A .kq file, or a folder of them. |
Options
| Option | Does |
|---|---|
--check | Write nothing; exit 1 if a file would change. |
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 |
The Kanoniq extension for VS Code does the same on save.
© 2026 Extenza Works. All rights reserved.