macOS Installation (Homebrew)
brew install vespovios/ipcheck/ipcheck
Ubuntu / Debian Installation
curl -sL https://raw.githubusercontent.com/vespovios/ipcheck-cli/main/install.sh | bash
Alternatively, download the script manually and place ipcheck in /usr/local/bin.
ipcheck is a lightweight Bash CLI tool for querying IP geolocation information using the public API at https://get.geojs.io.
It supports:
- π Pretty, colored terminal output (with country flag emoji)
- π Shows both your IPv4 and IPv6 address on dual-stack connections
- β¨ Short / quiet modes for scripting
- π§© Raw JSON output (compact or pretty-printed)
- π Lookup of arbitrary IP addresses (
--ip) - β‘ Local caching to avoid repeated API calls
- π Optional update checker (
--check-update) - π Works on Linux and macOS
Displays a full geolocation summary for your current public IP.
On a dual-stack connection both addresses are listed:
ipcheckπ Public IP Information π©πͺ
-----------------------------------------
IPv4 Address: 88.198.32.117
IPv6 Address: 2a01:4f8:c17:4a1:2b3c:9d8e:7f60:1a2b
Country: Germany (DE)
Region: Berlin
City: Berlin
ISP: Hetzner Online GmbH
Timezone: Europe/Berlin
Latitude: 52.52
Longitude: 13.4
If only one address family is reachable, the original single IP Address:
line is shown instead.
Why two hosts?
get.geojs.ioonly reports the address of the connection it received, so on a dual-stack host it usually returns your IPv6 address and the IPv4 one stays invisible.ipchecktherefore also queries the family-specific GeoJS hostsipv4.geojs.ioandipv6.geojs.io.ipv6.geojs.iois AAAA-only, so it simply fails on IPv4-only networks and no address is reported for it.
ipcheck --short
# 88.198.32.117, 2a01:4f8:c17:4a1:2b3c:9d8e:7f60:1a2b - Germany (DE) π©πͺipcheck --quiet
# 88.198.32.117ipcheck --all-ips --quiet
# 88.198.32.117
# 2a01:4f8:c17:4a1:2b3c:9d8e:7f60:1a2bipcheck --ipv4
ipcheck --ipv6ipcheck --raw
ipcheck --raw-pretty--raw and --raw-pretty print the primary response only, so their output
shape is unchanged. Use ipcheck --all-ips --quiet to script against both.
ipcheck --ip 8.8.8.8
ipcheck --ip 2606:4700:4700::1111
ipcheck --ip 1.1.1.1 --shortbashcurljqpython3(recommended for IP validation + emojis)- Linux or macOS terminal
Install directly from your tap:
brew install vespovios/ipcheck/ipcheckOr tap first:
brew tap vespovios/ipcheck
brew install ipcheckUpdate:
brew upgrade ipcheckUninstall:
brew uninstall ipcheckbash <(curl -sL https://raw.githubusercontent.com/vespovios/ipcheck-cli/main/install.sh)This automatically:
- Detects your OS
- Installs dependencies
- Installs
ipcheckin the correct directory
git clone https://github.com/vespovios/ipcheck-cli.git
cd ipcheck-cli
chmod +x ipcheck
sudo cp ipcheck /usr/local/bin/ipchecksudo curl -L https://raw.githubusercontent.com/vespovios/ipcheck-cli/main/ipcheck -o /usr/local/bin/ipcheck
sudo chmod +x /usr/local/bin/ipcheckInstall dependencies:
brew install jqThen install:
sudo curl -L https://raw.githubusercontent.com/vespovios/ipcheck-cli/main/ipcheck -o /usr/local/bin/ipcheck
sudo chmod +x /usr/local/bin/ipcheckTest:
ipcheckipcheck v0.8.0
Usage: ipcheck [OPTIONS]
Fetch and display public IP geolocation information (using geojs.io).
Options:
-i, --ip IP Look up a specific IP instead of your own
-s, --short Show short output (IP, country, flag)
-r, --raw Output raw JSON from the API
--raw-pretty Output pretty-printed JSON
-q, --quiet Output only the IP address
-4, --ipv4 Only report the IPv4 address
-6, --ipv6 Only report the IPv6 address
-a, --all-ips With --quiet, print every discovered IP, one per line
--no-flag Disable country flag emoji
--check-update Check for a newer ipcheck version (if UPDATE_URL is set)
-h, --help Show this help message and exit
Both the IPv4 and the IPv6 address are shown when the host has both.
ipcheck includes a built-in update mechanism.
To check if a newer version is available:
ipcheck --check-updateThe update URL is defined inside the script:
UPDATE_URL="https://raw.githubusercontent.com/vespovios/ipcheck-cli/main/VERSION"Clone the repository:
git clone https://github.com/vespovios/ipcheck-cli.git
cd ipcheck-cliRun locally without installing:
./ipcheck --raw- Update the version in the script header:
VERSION="0.x.x" - Update the
VERSIONfile:echo "0.x.x" > VERSION
- Commit and tag:
git add ipcheck VERSION git commit -m "Bump version to 0.x.x" git tag v0.x.x git push git push origin v0.x.x
This project is licensed under the MIT License.
See the LICENSE file for details.