Simple, crossโplatform CLI for a fast 7โday weather forecast
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- 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
$ 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 โ โ โฆ โ โ โ โ โ โ โโโโโโโโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโ| Requirement | Notes |
|---|---|
| Go 1.21+ | In your PATH |
| WeatherAPI key | Sign up free at https://www.weatherapi.com |
go install github.com/hazeliscoding/wx-cli@latestThis drops a binary in $GOPATH/bin (commonly ~/go/bin). Add that directory to your PATH so you can call wx-cli anywhere.
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.
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.
| OS | Oneโliner |
|---|---|
| Linux / macOS | bash 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=โฆโข Windowssetx WEATHERAPI_API_KEY โฆ
wx-cli forecast # normal usage โ autoโdetects city & region go run . forecast # if youโre hacking inside the repoExit codes: 0 = success ยท 1 = config/network error.
- Fork & create a feature branch
go fmt ./...before committing- Open a PR โ GitHub Actions will run checks
--city/--zipflags to override autoโdetect- Metric/ยฐC output
- Caching for offline viewing
- Test suite & CI badges
This project is released under the MIT License. See the LICENSE file for details.
Made with โค๏ธ by Hazel Granados