Simple command line utility that prints the current global/public/dynamic IP address.
MIT License
whereami
is a simple command line utility that displays your current global/public IP address; works on macOS, Linux and Windows.
Useful for finding out the ephemeral (current external) IPv4 address.
$ whereami
123.234.123.124
$ whereami -help
Usage of whereami:
-verbose
prints detailed information if any. such as IPv6 and etc.
--verbose
option can be used to view the details of the provider's response.Manual download and install:
Install via Homebrew:
macOS, Linux and Windows WSL2. (x86_64/ARM64, M1)
brew install KEINOS/apps/whereami
Install via go install
:
Go v1.16 or above.
go install github.com/KEINOS/whereami/cmd/whereami@latest
Run via Docker:
Multiarch build for x86_64 (Intel/AMD) and ARM64/M1 architectures.
# The image is around 5.5MB in size
docker pull keinos/whereami:latest
docker run --rm keinos/whereami
docker-compose --file ./.github/docker-compose.yml run v1_17
go test -cover -race ./...
golangci-lint run
golint ./...
main
We would like to thank the following service providers that this command uses to discover global/public IP addresses.
This command requests these providers in random order and returns the first IP address with the same response. As soon as 3 of the same IP address are returned, the command stops and prints that IP address. If you notice that a provider is not working or not responding properly, please report an issue.