Skip to content

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 🚩

FlagShorthandDescription
--forecast-fShow 7-day extended forecast
--hourly-HShow 24-hour detailed forecast
--units-uUnits to use (metric or imperial)
--theme-tTheme to use (vibrant, dark, light)
--output-oExport format (json, csv, markdown)
--output-filePath to save the exported data
--no-list-lDisable interactive city selection
--no-cacheDisable local caching
--no-styleDisable styled terminal visuals
--raw-rOutput valid, unified JSON
--configPath to a custom config file
--version-vPrint 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

Stars

29 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages