Skip to content

maciakl/weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌤 weather

Show weather forecast on the command line.

This tool queries the National Weather Service to get current forecast for your current location.

⚠ Note: internet connection required.

By default, your location is determined either by querying your devices location service, or based on ip address geolocation via ip-api.com and then passed to weather service API to get your forecasting area.

Note that using a VPN may skew the results.

You can override this behavior, by using the -zip switch and providing a US zip code to see a forecast for that specific location. In that case, your geographical location will be determined via Zipppopotam.us API instead.

You can use the -location switch to check what location of forecast. Please note that the -location displays your forecast area returned by the National Weather Service API based on your latitude and longtitude. The forcast areas are sometimes larger than a zip codes, so you may not always see your exact town name displayed -- this is normal.

Usage

Usage:
  -version
        display version number and exit
  -location
        show the location of the forecast
  -week
        show the forecast for the entire week
  -zip <zip code>
        show the forecast a specific zip code
  -debug
        show debugging messages

Example:

weather -week -zip 12345 -location

Look and Feel

Sample output:

weather1

Weekly forecast for specific location:

weather2

Optional Dependencies

macOS

On macOS an optional dependency is the CoreLocationCli tool. You can install it via brew:

brew install corelocationcli

This is completely optional, and weather will work perfectly fine without it. It will simply fall back on IP geolocation if it's not available.

⚠ Note: if you choose to use corelocationcli please make sure you test it first, and give it permission to access the location service.

Linux

On Linux an optional dependency is is the geoclue service. You can install it via your package manager. For example, on Ubuntu:

sudo apt install geoclue-2.0

The weather tool uses the where-am-i demo tool that ships with geoclue by default to get your location. This is optional, and weather will continue to work even if the tool is not present or not working by falling back on built-in IP geolocation.

⚠ Note: On some systems geoclue package is broken, and you may need to fix it using these instructions.

Installing

There are few different ways:

Platform Independent

Install via go:

go install github.com/maciakl/weather@latest

Mac & Linux

Install via grab:

grab maciakl/weather

Windows

On Windows, this tool is distributed via scoop (see scoop.sh).

First, you need to add my bucket:

scoop bucket add maciak https://github.com/maciakl/bucket
scoop update

Next simply run:

scoop install weather

If you don't want to use scoop you can simply download the executable from the release page and extract it somewhere in your path.

About

Show weather forecast on the command line

Topics

Resources

Stars

Watchers

Forks

Languages