kq prune
The same build, then it removes every derived element marked derived orphan and every Id entry marked orphan, printing each one, and validates what is left:
kq prune [options] <path>...
Arguments
| Argument | Is |
|---|---|
<path>... | A file or folder of each model to prune. |
Options
| Option | Does |
|---|---|
--check | Write nothing; exit 1 if a .g.kq 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 |
removed derived Interface shop/storefront/order-service/orders-api
removed Id Connection shop/storefront/web-shop -> shop/storefront/order-service/orders-api over http (8cb528d7-…)
It is the only command that removes anything that still stands; a line of .g.kq that can no longer stand is dropped by the next build. Run it when you have decided the orphans should go. In VS Code, Refactor: Delete also removes what Kanoniq added under an element you delete with it, since it cannot stay without it; see Working in VS Code. An Id it removes is gone for good: if the element comes back later, it gets a new one.
© 2026 Extenza Works. All rights reserved.