efreitasn / wtw

what's the weather

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wtw

wtw is a CLI tool to show the current weather on your terminal emulator using the OpenWeatherMap API.

Install

You can download one of the binaries available on the releases page or install it using Go v1.12.9 or higher.

Installing using go

go get -u github.com/efreitasn/wtw
$(go env GOPATH)/bin/wtw

Prerequisites

Getting the city ID

  • Search for your city in this URL.
  • Once you find your city in the search results, get the city ID from the address bar (the digits after https://openweathermap.org/city/).

How to use

First of all, you need to set your API key and your city ID. In order to do that, run the following command:

wtw set --city-id YOUR_CITY_ID --api-key YOUR_API_KEY

To get the current weather info, run

wtw

Change temperature unit

By default, wtw uses degrees Celsius, but it also supports Fahrenheit and Kelvin.

For instance, in order to use degrees Fahrenheit as the temperate unit, run

wtw set --unit F

Output format

The output string is the current temperature in the specified unit followed by a description of the current weather. For instance, a cloudy day would be something like

13.94°C - Clouds

About

what's the weather

License:MIT License


Languages

Language:Go 92.5%Language:Shell 7.5%