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