🌤 Track the weather for event days wed.fyi
wed docs cli.md
4.2 kB · 179 lines
Markdown
at main

wed CLI #

wed and its sub-commands that output weather information accept the options before the subcommand:

  • --units
  • --json
  • --chart
  • --verbose

For example, wed --json or wed --json forecast "Ottawa, ON" "2022-07-09 09:00".

Try wed --help for details.

Install #

You can download the binary for your platform from the releases page.

Example
$ curl -LO https://bucket.wed.fyi/v0.3.1/wed-x86_64-unknown-linux-gnu.tar.gz
$ tar -xzvf wed-x86_64-unknown-linux-gnu.tar.gz
$ rm wed-x86_64-unknown-linux-gnu.tar.gz
$ chmod a+x wed
$ mv wed /usr/local/bin/

Compile from source #

With cargo installed:

$ cargo install --path cli

AT Protocol #

wed includes optional support for the AT Protocol fyi.wed.event and community.lexicon.calendar.event (read-only) records:

$ wed auth

Once authenticated, just add --atproto to the commands below.

Use cases #

Weather forecast for any location, date and time #

Run wed forecast with two arguments:

$ wed forecast "Ottawa, ON" "2022-07-09 09:00"
🌤 26°C (feels like 27°C)  ☔ 40% chance of rain & 10% humidity 💨 4.2 km/h W
Or with a JSON output:
$ wed --json forecast "Ottawa, ON" "2022-07-09 09:00"
{
    "name": null,
    "location": "Ottawa, CA",
    "units": "Metric",
    "icon": "\u26c5",
    "date": "2023-05-28 07:00:00",
    "weather_code": 3,
    "probability_of_precipitation": 13,
    "temperature": 17.4,
    "feels_like": 17.8,
    "humidity": 90,
    "wind_speed": 10.8,
    "wind_direction": 244
}

Save an event #

Run wed save with three arguments:

$ wed save "National Capital Triathlon" "Ottawa, ON" "2022-07-09 09:00"
🌤 26°C (feels like 27°C)  ☔ 40% chance of rain & 10% humidity 💨 4.2 km/h W

You can also use the --before and --after flags (in hours) to save a specific time window for the event. By default, it saves the forecast starting 1 hour before and ending 3 hours after the event:

$ wed save --before 2 --after 4 "National Capital Triathlon" "Ottawa, ON" "2022-07-09 09:00"

To save the event remotely to an AT Protocol PDS instead of locally, use the --atproto flag.

Weather forecast for saved events #

Run wed with no sub-command or arguments:

$ wed
🗓 National Capital Triathlon (Jul 7, 09:00) 🌐 Ottawa, ON, Canada
🌤 26°C (feels like 27°C) ☔ 40% chance of rain & 10% humidity 💨 4.2 km/h W

Or with an hourly chart:

$ wed --chart
Or with a JSON output:
$ wed --json
[
    {
        "name": null,
        "location": "Ottawa, CA",
        "units": "Metric",
        "icon": "\u26c5",
        "date": "2023-05-28 07:00:00",
        "weather_code": 3,
        "probability_of_precipitation": 13,
        "temperature": 17.4,
        "feels_like": 17.8,
        "humidity": 90,
        "wind_speed": 10.8,
        "wind_direction": 244
    }
]

You can also combine --chart and --json to add the hourly forecast to the output.

Desktop notifications #

wed can also trigger a desktop notification:

$ wed notify
Example notification: the title goes on the first line, the location is next, followed by temperature and feels like, precipitation and wind speed, one in each line.

If the notification fails or is not supported by the operating system, it will output the same information as wed --json notify:

$ wed --json notify
{
    "title": "🗓️ Formula Run (Jun 11, 09:00)",
    "subtitle": "🌐 Ottawa, ON, Canada",
    "body": "⛅ 18°C (feels like 17°C)\n☔ 0% chance of rain & 69% humidity\n💨 9km/h E"
}

Delete a saved event #

Run wed delete with one argument, the name of the event (or its AT Protocol record key):

$ wed delete "National Capital Triathlon"

List all saved events #

Run wed list with no arguments.