Remapping the order of -/_ key
Seen that you prefer cmd line solution but I would like to suggest you to try Karabiner, I'm using it for ages and it is really powerfull.

Karabiner


  A powerful and stable keyboard customizer for macOS.


https://pqrs.org/osx/karabiner/