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