How to change default app to open magnet:// link without using a third-party UI app?
I found one solution after posting the question. A command line tool duti has a live github repo and can be installed easily with: 

brew install duti


And then, check the current magnet:// link setup:

$ duti -d magnet
com.bittorrent.uTorrent


Change and set another default app with the following cmd:

$ duti -s com.foo.foo magnet


That's all.

MORE:

To get a bundle_id of the app, there are two ways:


If you know the app is a default app for an extension, you can do something like


$ duti -x html
Google Chrome.app
/Applications/Google Chrome.app
com.google.Chrome



If you know the app name, you can do something like


$ osascript -e 'id of app "Google Chrome"'
com.google.Chrome