Weazy is a simple command-line utility designed to fetch the current weather using the OpenWeatherMap service. It allows conveniently fetching weather information for a chosen city.
- Install package globally:
npm i -g weazy
Run the utility using the following command:
weazy [OPTIONS]
-
-c <city>
: Set default city. -
-t <API_KEY>
: Set OpenWeatherMap API key. -
-h
: Get help
# Set dafault city
weazy -c "Some city"
# Set token
weazy -t "Some token"
# Get the current weather in the default city
weazy
You can also use environment variables to set the default city and OpenWeatherMap API key:
-
CITY
: Set default city. -
TOKEN
: Set OpenWeatherMap API key.
Example:
# Get the current weather in a specified city
CITY="Moscow" weazy
# Get the current weather in the default city using the specified token
TOKEN="your_openweathermap_api_key" weazy
- If the city or API key is not specified, the utility will ask you to specify them.
- To obtain an OpenWeatherMap API key, register on their website and get the key from your account.
This project is licensed under the MIT License. See the LICENSE file for additional information.
Author: Eugene Panin