@asdsadw12312dwd2112xz/ip-geo-cli
v1.0.0
Published
IP geolocation lookup from the terminal
Readme
ip-geo-cli
IP geolocation lookup from the terminal. Uses the free ip-api.com API — no key required.
Install
npm install -g ip-geo-cliOr run directly after build:
node dist/index.js [ip]Usage
ip-geo-cli [options] [ip]Arguments
| Argument | Description |
|----------|-------------|
| [ip] | IPv4 or IPv6 address. Omit to look up your own public IP. |
Options
| Flag | Description |
|------|-------------|
| -j, --json | Output raw JSON instead of formatted text |
| -f, --file <path> | Batch lookup — one IP per line in a text file |
| -V, --version | Print version |
| -h, --help | Show help |
Examples
# Look up your own public IP
ip-geo-cli
# Look up a specific IPv4
ip-geo-cli 8.8.8.8
# Look up an IPv6 address
ip-geo-cli 2001:4860:4860::8888
# JSON output
ip-geo-cli 1.1.1.1 --json
# Batch lookup from file
ip-geo-cli --file ips.txt
# Batch lookup as JSON
ip-geo-cli --file ips.txt --jsonOutput
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
IP: 8.8.8.8
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Country United States [US]
Region Virginia
City Ashburn
ZIP 20149
Timezone America/New_York
ISP Google LLC
Org Google Public DNS
AS AS15169 Google LLC
Coordinates 39.03, -77.5
Map https://www.openstreetmap.org/...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Output is color-coded by continent:
- North America — green
- South America — magenta
- Europe — blue
- Asia — cyan
- Africa — yellow
- Oceania — bright green
Notes
- The free ip-api.com tier allows up to 45 requests per minute. Batch mode automatically throttles to stay within limits.
- For production use with higher volumes, consider the ip-api.com paid plan.
Build from source
npm install
npm run build