I feel like I need a CLI program like awk but using Rete / Datalog. It would be a souped-up join.
join
It would take a rule description and an input file of facts, and the RHS can be only "print" or "insert fact".