Skip to main content
Version: Next

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

ArgumentIs
<path>...A file or folder of each model to prune.

Options

OptionDoes
--checkWrite nothing; exit 1 if a .g.kq file would change.

Environment

VariableDoes
KANONIQ_TELEMETRYoff, 0 or false stops kq reporting the run; so does DO_NOT_TRACK=1.

Exit codes

CodeMeans
0Done
1Failed: the model has an error, a check found a change, or a file could not be read or written
2Usage 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.