One line weather output from terminal
Simplest solution is ansiweather which you can install with brew. The result looks like .

If you want to write you own command/function it's not that difficult. If the output from the online location is in json, or something similar. You can use jq to parse json, and only print what you need.

curl -s http://ip-api.com/json | jq -Cr .


Read the manual page of jq to learn how to use it.

I tried the API you're using above, that's not gonna help your case. Find some other one that replies in JSON. For example:

curl -s 'api.openweathermap.org/data/2.5/weather?q={CITY,COUNTRY_CODE}&amp;APPID={GET_YOUR_API_KEY}' | jq -C '.name? .weather?.main?'


I haven't tested it personally, because you have to make an account to make a call, but you get the idea.

Comment if you get lost.