Weather bonanza — CLI all the way

Three terminal commands for checking the weather

Bill Clarke
3 min readNov 14, 2020

Everybody loves checking weather forecasts and talking about the weather, this guide gives you three alternatives to quickly look up the weather from the terminal.

AnsiWeather

AnsiWeather gives you the current weather condition of selected locations and the output only occupies one line in the terminal, making this a very compact alternative.

ansiweather -l "los angeles,us" -s true -i false -d false -h false -p false; \
ansiweather -l london,uk -s true -i false -d false -h false -p false; \
ansiweather -l paris,fr -s true -i false -d false -h false -p false; \
ansiweather -l "new york,us" -s true -i false -d false -h false -p false; \
ansiweather -l papeete,pf -s true -i false -d false -h false -p false

wttr.in

If you want a cool alternative for weather forecasts wttr.in is for you. The current and the following two days are presented. It is very colourful making it easy to read its output.

curl wttr.in/Eastbourne

graph.no

Relying heavy on graphics is the idea behind graph.no. This choice creates a presentation that is very quick to read. So if you want the weather forecast for the following hours this is a good solution.

finger oslo@graph.no

Alias, all together now

An alias that combines the above commands is perfect for a quick look at the weather, no need to go to the browser or outside. This alias I created for Ubuntu 20.04.

tee -a .bashrc << 'EOF'
alias w1='(ansiweather -l "los angeles,us" -s true -i false -d false -h false -p false; \
ansiweather -l london,uk -s true -i false -d false -h false -p false; \
ansiweather -l paris,fr -s true -i false -d false -h false -p false; \
ansiweather -l "new york,us" -s true -i false -d false -h false -p false; \
ansiweather -l papeete,pf -s true -i false -d false -h false -p false; \
curl wttr.in/Eastbourne; \
finger oslo@graph.no) | less -r'
EOF
# reload .bashrc
. .bashrc

--

--

Bill Clarke

Linux enthusiast. Also uses macOS and Chrome OS now and then.