I have two USB Redirector devices in my KVM, created using virt-manager:
<redirdev bus="usb" type="spicevmc">
<alias name="redir0"/>
<address type="usb" bus="0" port="2"/>
</redirdev>
<redirdev bus="usb" type="spicevmc">
<alias name="redir1"/>
<address type="usb" bus="0" port="5"/>
</redirdev>
I can use these to redirect a USB device at runtime, in virt-manager by going to Virtual Machine > Redirect USB device, I can then pick which host devices to pass through the Spice channel:

How do I do the same with virsh, or some other terminal tool? I would like to be able to switch it off and on, basically to move a device from one VM to another.
virshbecause it's running on Spice and it's spice client responsibility to set this up. So depending on the client used (e.g. Boxes, virt-manager, virt-viewer), it will be managing the USB redirection using channel added to the VM.