I recently was shown a pretty handy website that is useful for determining your public IP address, even if you are on the command line. The URL to hit is ifconfig.me. Just hit the URL with curl or some other URL tool and you’ll get back your publicly routeable IP address in dotted decimal notation, no HTML to wade through.
$ curl ifconfig.me 18.104.22.168 #your public IP shows up here. Sorry to whoever owns 22.214.171.124
More of the ifconfig.me command line interface can be found on their website. Thanks to Patrick Mosca for the tip.