My ~/bin/mitmproxy.sh:
interface=$( ifconfig en0 | grep inet | grep -v inet6 | awk '{ print $2 }' )
mitmproxy --no-mouse -b $interface
Edit: This causes the IP address to show up in the mitmproxy UI. I use mitm for iOS development, and having my IP visible is handy when setting up the phone to use a proxy.