A fast CLI tool that shows your public IP address along with optional geolocation details and local weather — powered by Cloudflare Radar and Open-Meteo.
- Go 1.23+
git clone <repo> cd myip make build
The binary is written to ./myip. Move it somewhere on your $PATH:
mv myip ~/.local/bin/To build a specific version:
make build VERSION=1.0.0
The -w -s ldflags are applied by default (strips debug info for a smaller binary).
export PATH="$HOME/.local/bin:$PATH"
myip [flags]
| Flag | Description |
|---|---|
--detail |
Show full IP geolocation info (city, region, country, ASN, colo, ...) |
--weather |
Show current weather at your detected IP location |
--local |
Show the computer's local IPv4 and IPv6 addresses (cannot be combined with --detail, --weather, --unit, or --no-cache) |
--json |
Output as pretty-printed JSON (modifier for --detail, --weather, or --local) |
--unit |
Temperature unit for --weather: celsius or fahrenheit (auto-detected for US and a few other countries) |
--no-cache |
Bypass the local cache — always fetch fresh data |
--help |
Show help and version |
# Print your public IP address (default) myip # Full IP geolocation table myip --detail # Current weather at your location myip --weather # Both tables combined myip --detail --weather # IP info as JSON myip --detail --json # Combined JSON output myip --detail --weather --json # Skip cache, fetch fresh myip --no-cache # Force Fahrenheit myip --weather --unit fahrenheit # Force Celsius myip --weather --unit celsius # Show local IPv4 / IPv6 addresses myip --local # Local addresses as JSON myip --local --json
IP geolocation results are cached at ~/.myip/cache for 30 minutes. Use --no-cache to bypass reading from and writing to the cache.
| Target | Description |
|---|---|
make build |
Build the binary (default) |
make tidy |
Tidy Go module dependencies |
make lint |
Run go vet |
make staticcheck |
Run staticcheck — install with go install honnef.co/go/tools/cmd/staticcheck@latest |
make security |
Run govulncheck — install with go install golang.org/x/vuln/cmd/govulncheck@latest |
make version |
Print the current version |
- IP info —
https://ipv4-check-perf.radar.cloudflare.com/api/info - Weather —
https://api.open-meteo.com(no API key required)