Skip to content

Command line tool to check the weather of your current location.

Notifications You must be signed in to change notification settings

hazeliscoding/wx-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

9 Commits

Repository files navigation

wx-cli ๐ŸŒฆ๏ธ

Simple, crossโ€‘platform CLI for a fast 7โ€‘day weather forecast

Go versionLicense

wx-cli pulls live data from WeatherAPI.com and presents it in a tidy, Unicodeโ€‘powered table.
It autoโ€‘detects your location via ipinfo.io, so a single command is all you need:

wx-cli forecast

โœจ Features

  • Oneโ€‘command forecast โ€“ no flags required
  • Autoโ€‘detect location using your public IP
  • 7โ€‘day forecast with sunrise/sunset, temps & rain chance
  • Works anywhere Go runs (Windows, Linux, macOS)
  • Zero runtime dependencies beyond the compiled binary

๐Ÿ“ธ Quick Demo

$ wx-cli forecast โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ ๐ŸŒ Location: Houston, Texas, United States โ”‚ ๐Ÿ“… Date: 05/12 | Monday โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ ๐ŸŒก๏ธ Current: partly cloudy, 78ยฐF (Feels like 80ยฐF) โ”‚ ๐Ÿ”ฝ Min: 72ยฐF | ๐Ÿ”ผ Max: 86ยฐF โ”‚ ๐Ÿ’ง Humidity: 64% โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ๐Ÿ“… 6โ€‘Day Forecast: โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Date โ”‚ Temp (ยฐF) โ”‚ Rain Chance โ”‚ Condition โ”‚ Sunrise โ”‚ Sunset โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ 05/12 Mon โ”‚ 78 โ”‚ 0 % โ”‚ partly cloudy โ”‚ 06:20 AM โ”‚ 08:04 PM โ”‚ โ”‚ โ€ฆ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Installation

Prerequisites

RequirementNotes
Go 1.21+In your PATH
WeatherAPI keySign up free at https://www.weatherapi.com

1. Install via go install (recommended)

go install github.com/hazeliscoding/wx-cli@latest

This drops a binary in $GOPATH/bin (commonly ~/go/bin). Add that directory to your PATH so you can call wx-cli anywhere.

2. (or) Build from source

git clone https://github.com/hazeliscoding/wx-cli.git cd wx-cli go build -o wx-cli .

On Windows youโ€™ll get wx-cli.exe.


๐Ÿ”ง Configuration

wx-cli looks for an environment variable WEATHERAPI_API_KEY. Create a small .env file so you donโ€™t have to export it every session.

OSOneโ€‘liner
Linux / macOSbash mkdir -p ~/.config/wx-cli && echo "WEATHERAPI_API_KEY=<YOUR_KEY>" > ~/.config/wx-cli/.env
Windows (PowerShell)pwsh New-Item -ItemType Directory -Force "$env:USERPROFILE\.config\wx-cli"; Set-Content "$env:USERPROFILE\.config\wx-cli\.env" 'WEATHERAPI_API_KEY=<YOUR_KEY>'

Prefer a global variable? โ€ข Linux/macOS export WEATHERAPI_API_KEY=โ€ฆ โ€ข Windows setx WEATHERAPI_API_KEY โ€ฆ


๐Ÿƒ Usage

wx-cli forecast # normal usage โ€“ autoโ€‘detects city & region go run . forecast # if youโ€™re hacking inside the repo

Exit codes: 0 = success ยท 1 = config/network error.


๐Ÿค Contributing

  1. Fork & create a feature branch
  2. go fmt ./... before committing
  3. Open a PR โ€“ GitHub Actions will run checks

๐Ÿ—บ Roadmap

  • --city / --zip flags to override autoโ€‘detect
  • Metric/ยฐC output
  • Caching for offline viewing
  • Test suite & CI badges

๐Ÿ“ License

This project is released under the MIT License. See the LICENSE file for details.


Made with โค๏ธ by Hazel Granados

About

Command line tool to check the weather of your current location.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages