notmuch-tag(1) on Linux
The text cb842a2625e6, as Debian 9 (Stretch) shipped it.
add/remove tags for all messages matching the search terms
Flags it lists
-
--batch -
--input -
--remove-all