goipinfo
is a command-line tool written in Go to fetch IP information from multiple providers and display it in a table format.
- Fetch your public IP information using different providers (ipinfo.io, ip-api.com, my-ip.io).
- Fetch information for a specific IP address using ip-api.com.
- Display fetched IP information in a nicely formatted table.
- Go (version 1.22.2 or later)
After head to the cloned repository issue the following command:
go mod tidy
make build
Note: It will be built under the path ./build/bin/goipinfo
.
./goipinfo myip --provider [ipinfo|ip-api|my-ip]
-
The default provider is
ip-api
. -
Example:
./goipinfo myip --provider ipinfo
./goipinfo info --ip 5.161.78.107
-
Note: Only
ip-api
can be used as the provider for this command. -
Example:
./goipinfo info --ip 5.161.78.107
./goipinfo myip --provider ipinfo
+----------+------------------------+
| FIELD | VALUE |
+----------+------------------------+
| IP | 104.28.242.73 |
| City | Düsseldorf |
| Region | North Rhine-Westphalia |
| Country | Germany |
| Location | 0.000000,0.000000 |
| Org | Cloudflare WARP |
| Timezone | Europe/Berlin |
+----------+------------------------+
./goipinfo info --ip 104.28.242.73
+----------+------------------------+
| FIELD | VALUE |
+----------+------------------------+
| IP | 104.28.242.73 |
| City | Düsseldorf |
| Region | North Rhine-Westphalia |
| Country | Germany |
| Location | 0.000000,0.000000 |
| Org | Cloudflare WARP |
| Timezone | Europe/Berlin |
+----------+------------------------+
make test
make clean
make fmt
make lint
Contributions are welcome! Please submit a pull request or open an issue to discuss any changes.
Get in touch with me @ [email protected] 🙏
This project is licensed under the MIT License. See the LICENSE file for details.