Skip to content
Kavachकवच

Tools for AI: query

● Intermediate2 min

kavach query answers one question exactly: who calls a function, what a type holds, which names match.

terminal
kavach query callers total_paid src/main.kav
src/main.kav:21  in report: "paid: {total_paid(orders)}"
kavach query uses Console src/main.kav
src/main.kav:24  fn main()
kavach query type Order src/main.kav
src/main.kav:1
type Order {
    id: Int
    amount: Decimal
    paid: Bool
}
kavach query find total src/main.kav
src/main.kav:8  fn total_paid

A text search for total would also find it in comments and strings, and an assistant would read files to sort them out. A query finds only real declarations and uses. uses Console lists the functions that can touch a capability, here only main, which prints; fails BankError lists those that can fail with an error.