Local time and weather command line tool
Command-line tool to look up the local time (and weather) for time zones, countries and cities with auto-completion.
My partner (
Install as a global
npm install -g localtime-cli
Or run ad hoc:
Show full options with
--timezoneuse timezone names for search (default: true)
--no-timezonedon't use timezone names
--countryuse country names
--cityuse city names with a population >= 250,000
--city-alluse all city names
--all-min, use all location types (with minimum city population)
--alluse all location types (no city population minimum)
--weatherinclude local weather
--openweather-api-key <key>specify OpenWeather API key
--save-openweather-api-key <key>specify and save OpenWeather API key for future use
--lastbypass location search and reuse last location used
--metric, use metric units (celsius)
--imperial, use imperial units (fahrenheit)
localtime -c -y would search time zone, country and larger city names and
localtime --no-timezone -Y would search just through all city names, since time zones are always used unless explicitly excluded.
Multiple single letter options can be combined too:
The last previously used location will be sorted to the top of the list unless
--skip-last-used-sort is used.
Weather info works for city selections and requires a free OpenWeather API key provided via the
-o option to use it once or
-O to save it for future use without needing to provide it as an option again.
localtime -y -w -O abc123
In subsequent uses, you can then just run
localtime -y -w.
You can also set it via the
OPENWEATHER_API_KEY environment variable.
Initially, the metric system will be used and weather temperatures will be in celsius. Subsequent invocations will reuse the previously specified unit of measurement, unless a new one is selected via command line options.