Skip to content

Rayrsn/Weather-Cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

78 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒฆ Weather-Cli

A modern, fast CLI tool for weather information

cloud

Status Badge

Features ๐Ÿ†

  • Modern UI: Beautiful, styled terminal output with ASCII icons and colors using lipgloss.
  • Theming: Choose between vibrant, dark, and light themes.
  • Extended Forecasts: View a detailed 7-day outlook (--forecast) or a 24-hour breakdown (--hourly).
  • Interactive Selection: Easily pick from multiple city results when names are ambiguous.
  • Auto-Location: Automatically detect your current city using IP geolocation.
  • Caching: Built-in 15-minute caching for near-instant repeat lookups.
  • Multi-City Support: Query multiple cities in a single command.
  • Exporting: Save weather reports to JSON, CSV, or Markdown.
  • Configuration CLI: Manage your preferences directly through the tool.
  • Automation-Friendly: Unified --raw JSON output for piping into tools like jq.

Building ๐Ÿ”จ

Manual Build

Make sure you have Go installed.

go build -o weather-Cli

Pre-built Binaries & Packages

  • Arch Linux: Available in the weather-cli AUR.
  • Binaries: You can grab a binary from the Releases.

Usage ๐Ÿ’ป

Get Weather for a City

./weather-Cli get London

Get Multiple Cities

./weather-Cli get London Tokyo "New York"

Hourly and Extended Forecasts

./weather-Cli get Paris --hourly --forecast

Exporting Data

./weather-Cli get London --output markdown --output-file report.md

Use Imperial Units & Different Themes

./weather-Cli get "New York" --units imperial --theme dark

Examples ๐Ÿ“ธ

Standard Output

./weather-Cli get London
  โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ 
 โ”‚                                                                                              โ”‚ 
 โ”‚  WEATHER REPORT                                                                โ”‚ 
 โ”‚                                                                                              โ”‚ 
 โ”‚ ๐Ÿ“ Location:                  London, United Kingdom                       โ”‚ 
 โ”‚ ๐ŸŒ Latitude:                  51.50853                                              โ”‚ 
 โ”‚ ๐ŸŒ Longitude:                 -0.12574                                            โ”‚ 
 โ”‚ ๐Ÿ•’ Timezone:                  Europe/London                                   โ”‚ 
 โ”‚ ๐Ÿ‘ฅ Population:                8,961,989                                            โ”‚ 
 โ”‚                                                                                               โ”‚ 
 โ”‚  CURRENT CONDITIONS                                                           โ”‚ 
 โ”‚                                                                                               โ”‚ 
 โ”‚   \ _ /    ๐Ÿ”ฅ Temp:                      15.6ยฐC                                      โ”‚ 
 โ”‚  - ( )--o  ๐Ÿ’จ Wind:                      18.7 Km/h (250ยฐ)                      โ”‚ 
 โ”‚   / (___)  ๐ŸŒˆ Condition:                 Partly Cloudy                           โ”‚ 
 โ”‚            ๐Ÿ’ง Humidity:                  53.0%                                      โ”‚ 
 โ”‚            ๐Ÿ”ฅ Feels Like:                14.3ยฐC                                       โ”‚ 
 โ”‚            ๐Ÿงญ Surface Pressure:          1015.10 hPa                            โ”‚ 
 โ”‚            ๐ŸŒŠ Sealevel Pressure:         1017.80 hPa                            โ”‚ 
 โ”‚            ๐ŸŒž UV Index:                  6                                              โ”‚ 
 โ”‚                                                                                               โ”‚ 
 โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ 

7-Day Forecast

./weather-Cli get London -f
 โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ 
 โ”‚                                                                                       โ”‚ 
 โ”‚  WEATHER REPORT                                                         โ”‚ 
 โ”‚                                                                                       โ”‚ 
 โ”‚ ๐Ÿ“ Location:                  London, United Kingdom                โ”‚ 
 โ”‚ ๐ŸŒ Latitude:                  51.50853                                       โ”‚ 
 โ”‚ ๐ŸŒ Longitude:                 -0.12574                                      โ”‚ 
 โ”‚ ๐Ÿ•’ Timezone:                  Europe/London                            โ”‚ 
 โ”‚ ๐Ÿ‘ฅ Population:                8,961,989                                     โ”‚ 
 โ”‚                                                                                        โ”‚ 
 โ”‚  CURRENT CONDITIONS                                                    โ”‚ 
 โ”‚                                                                                        โ”‚ 
 โ”‚   \ _ /    ๐Ÿ”ฅ Temp:                      15.6ยฐC                               โ”‚ 
 โ”‚  - ( )--o  ๐Ÿ’จ Wind:                      18.7 Km/h (250ยฐ)               โ”‚ 
 โ”‚   / (___)  ๐ŸŒˆ Condition:                 Partly Cloudy                     โ”‚ 
 โ”‚            ๐Ÿ’ง Humidity:                  53.0%                                โ”‚ 
 โ”‚            ๐Ÿ”ฅ Feels Like:                14.3ยฐC                                 โ”‚ 
 โ”‚            ๐Ÿงญ Surface Pressure:          1015.10 hPa                      โ”‚ 
 โ”‚            ๐ŸŒŠ Sealevel Pressure:         1017.80 hPa                      โ”‚ 
 โ”‚            ๐ŸŒž UV Index:                  6                                        โ”‚ 
 โ”‚                                                                                          โ”‚ 
 โ”‚  7-DAY FORECAST                                                             โ”‚ 
 โ”‚                                                                                          โ”‚ 
 โ”‚ ๐Ÿ—“๏ธ  Wed, May 20:              18.6/12.8ยฐC     Light Drizzle            โ”‚ 
 โ”‚ ๐Ÿ—“๏ธ  Thu, May 21:              22.8/12.3ยฐC     Overcast                  โ”‚ 
 โ”‚ ๐Ÿ—“๏ธ  Fri, May 22:              26.6/16.9ยฐC     Overcast                   โ”‚ 
 โ”‚ ๐Ÿ—“๏ธ  Sat, May 23:              26.9/19.6ยฐC     Overcast                  โ”‚ 
 โ”‚ ๐Ÿ—“๏ธ  Sun, May 24:              31.3/18.9ยฐC     Clear Sky                 โ”‚ 
 โ”‚ ๐Ÿ—“๏ธ  Mon, May 25:              29.0/20.9ยฐC     Clear Sky               โ”‚ 
 โ”‚ ๐Ÿ—“๏ธ  Tue, May 26:              20.6/13.1ยฐC     Clear Sky                 โ”‚ 
 โ”‚                                                                                          โ”‚ 
 โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Raw JSON Output (Automation-Friendly)

./weather-Cli get London --raw
{
  "location": {
    "name": "London",
    "country": "United Kingdom",
    "latitude": 51.50853,
    "longitude": -0.12574,
    "timezone": "Europe/London",
    "population": 8961989
  },
  "forecast": {
    "current_weather": {
      "temperature": 15.6,
      "windspeed": 18.7,
      "winddirection": 250,
      "weathercode": 2
    },
    ...
  }
}

Configuration โš™๏ธ

You can manage your configuration using the config command:

# Set a default city
./weather-Cli config set default_city "Amsterdam"

# Disable interactive selection
./weather-Cli config set interactive false

# Set default units
./weather-Cli config set units imperial

The configuration is stored at $HOME/.weather-cli.yaml.

Flags ๐Ÿšฉ

Flag Shorthand Description
--forecast -f Show 7-day extended forecast
--hourly -H Show 24-hour detailed forecast
--units -u Units to use (metric or imperial)
--theme -t Theme to use (vibrant, dark, light)
--output -o Export format (json, csv, markdown)
--output-file Path to save the exported data
--no-list -l Disable interactive city selection
--no-cache Disable local caching
--no-style Disable styled terminal visuals
--raw -r Output valid, unified JSON
--config Path to a custom config file
--version -v Print version number

Acknowledgments ๐Ÿ“š

Questions โ‰๏ธ

If you have any questions or just want to talk, add me on Discord or use my username Rayr#6401.

About

An app made to get weather information through the terminal written in Go

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages