Skip to content
Weather in terminal, with ANSI colors and Unicode symbols
Shell Roff
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
screenshot Adding a screenshot in the repository, and updating link in the README Jan 4, 2016
AUTHORS Remove all Twitter mentions Feb 9, 2017
ChangeLog Update ChangeLog. Jan 21, 2020
LICENSE Bump copyright year to 2020. Jan 16, 2020 Update some URLs in the README, the city ID list has moved. Nov 13, 2019
ansiweather AnsiWeather 1.16.0 release. Jan 21, 2020
ansiweather.1 Bump copyright year to 2020. Jan 16, 2020
ansiweatherrc.example Switch default delimiter from "=>" to ":" and stop prepending space. Jan 16, 2020


AnsiWeather is a Shell script for displaying the current weather conditions in your terminal, with support for ANSI colors and Unicode symbols.

AnsiWeather Screenshot

Weather data comes from the OpenWeatherMap free weather API.


AnsiWeather requires the following dependencies:

  • A command to fetch HTTP data such as FTP, cURL or wget
  • jq (lightweight and flexible command-line JSON processor)
  • bc (arbitrary precision numeric processing language), for doing float arithmetic


After cloning the repository, simply invoke the script by typing:


AnsiWeather packages are available for:


pkg_add ansiweather

Pkgsrc (NetBSD, SmartOS, Mac OS X, etc.)

pkgin install ansiweather


pkg install ansiweather


apt-get install ansiweather

Homebrew (Mac OS X)

brew install ansiweather



ansiweather [-F] [-l location] [-u system] [-f days] [-a value]
            [-s value] [-k key] [-i value] [-w value] [-h value]
            [-p value] [-d value] [-v value]


-l location
        Specify location

-u system
        Specify unit system to use ( metric or imperial )

-f days
        Toggle forecast mode for the specified number of upcoming days

-F      Toggle forecast mode for the next five days

-a value
        Toggle ANSI colors display ( true or false )

-s value
        Toggle symbols display ( true or false )

-k key  Specify API key

-i value
        Toggle UV Index display ( true or false )

-w value
        Toggle wind data display ( true or false )

-h value
        Toggle humidity data display ( true or false )

-p value
        Toggle pressure data display ( true or false )

-d value
        Toggle daylight data display ( true or false )


Display forecast using metric units for the next five days (showing symbols and daylight data) for Rzeszow, Poland:

ansiweather -l Rzeszow,PL -u metric -s true -f 5 -d true


The default config file is ~/.ansiweatherrc. The environment variable ANSIWEATHERRC can be set to override this. The following configuration options (detailed below) are available and should be set according to your location and preferences.

Example: ~/.ansiweatherrc

fetch_cmd:ftp -V -o -

The file ansiweatherrc.example contains all available configuration variables.


Location format is city,CC where CC is a two-letter ISO 3166-1 alpha-2 country code. A list of country codes is available here. Alternatively, it's also possible to specify locations by their ID, a city list is available here.

In case no location is specified, AnsiWeather will fallback to the default location.

Example: Rzeszow,PL


Fetch Command

Various tools can be used to fetch data: curl, wget, ftp.

Please note that ftp flags and options might differ among implementations and versions, and the example provided here is known to work only on OpenBSD and NetBSD.

Example: curl -sf

fetch_cmd:curl -sf

Example: wget -qO-

fetch_cmd:wget -qO-

Example: ftp -V -o -

fetch_cmd:ftp -V -o -

Default: curl -sf

System of Units

Both metric and imperial systems are supported.


Default: metric

Display ANSI sequences

Toggle ANSI sequences display. Value can be either true (requires an ANSI capable display) or false.


Default: true

Display symbols

Toggle Unicode symbols display. Value can be either true (requires a Unicode capable display) or false.


Default: false

Symbols can be configured or replaced by custom text using the following configuration variables: sun, moon, clouds, rain, fog, mist, haze, snow, thunderstorm.

Display forecast

Show upcoming forecast for the next N days (for 0 <= N <= 7). 0 will show standard output.


Default: 0

Display wind / humidity / pressure

Toggle UV Index, wind, humidity, and/or pressure display. Values can be either true or false.


Default: true

Display sunrise / sunset

Toggle daylight display. Value can be either true or false.


Default: false

Date and Time format

Configure date and time format display. See Unix date formatting docs for details.

dateformat:%a %b %d

Default: %a %b %d

timeformat:%b %d %r

Default: %b %d %r

OpenWeatherMap API key

Specify an OpenWeatherMap API key. By default AnsiWeather uses its own key, but users can optionally get their own one by creating a free OpenWeatherMap account.



AnsiWeather is released under the BSD 2-Clause license. See LICENSE file for details.


AnsiWeather is developed by Frederic Cambus.



You can’t perform that action at this time.