A lightweight command-line tool written in C that retrieves geographical and network information about IP addresses using the ip-api.com API.
- Query information about your public IP address
- Query information about any specific IP address
- Display results in a clean, formatted table
- Fast and lightweight (written in C)
- Uses libcurl for HTTP requests
Download the latest release for your platform from Releases:
- Linux (x64):
get-ip-tool-linux-x64.tar.gz - macOS (Apple Silicon):
get-ip-tool-macos-arm64.tar.gz - Windows (x64):
get-ip-tool-windows-x64.zip
Installation after download:
macOS/Linux:
# Extract
tar -xzf get-ip-tool-*.tar.gz
# Move to system path
sudo mv get-ip-tool /usr/local/bin/
sudo chmod +x /usr/local/bin/get-ip-toolWindows:
# Extract the zip file, then run as Administrator:
Move-Item get-ip-tool.exe "$env:ProgramFiles\get-ip-tool\"
# Add to PATH manually via System Environment VariablesInstall with a single command:
curl -fsSL https://raw.githubusercontent.com/nicodevvv/console-get-ip-tool/main/install.sh | bashThe installer will:
- Detect your operating system
- Install required dependencies (CMake, libcurl)
- Clone and build the project
- Install the binary to
/usr/local/bin - Clean up temporary files
Prerequisites:
- Git
- CMake
- A C compiler: Visual Studio Build Tools or MinGW-w64
- vcpkg for libcurl
Installation:
- Install curl library via vcpkg:
vcpkg install curl:x64-windows-static- Run the installer as Administrator:
# Download and run
irm https://raw.githubusercontent.com/nicodevvv/console-get-ip-tool/main/install.ps1 | iex
# Or download first, then run
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/nicodevvv/console-get-ip-tool/main/install.ps1" -OutFile "install.ps1"
PowerShell -ExecutionPolicy Bypass -File install.ps1The installer will automatically add the tool to your PATH.
macOS/Linux:
sudo rm /usr/local/bin/get-ip-toolWindows:
# Run as Administrator
Remove-Item "$env:ProgramFiles\get-ip-tool" -Recurse -Force
# Manually remove from PATH in System Environment VariablesBefore building this tool, ensure you have the following installed:
- CMake (version 3.10 or higher)
- A C compiler (GCC, Clang, or MSVC)
- libcurl development libraries
macOS:
brew install cmake curlUbuntu/Debian:
sudo apt-get install cmake libcurl4-openssl-dev build-essentialFedora/RHEL:
sudo dnf install cmake libcurl-devel gcc makeWindows:
- Install CMake
- Clone or navigate to the project directory:
git clone https://github.com/nicodevvv/console-get-ip-tool.git
cd console-get-ip-tool- Create a build directory and navigate to it:
mkdir -p build
cd build- Run CMake to configure the project:
cmake ..- Build the executable:
cmake --build .The executable get-ip-tool will be created in the build directory.
- Clone the repository:
git clone https://github.com/nicodevvv/console-get-ip-tool.git
cd console-get-ip-tool- Configure with CMake (using vcpkg toolchain):
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=[path-to-vcpkg]/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static- Build:
cmake --build . --config ReleaseThe executable get-ip-tool.exe will be in the Release sub
4. Build the executable:
cmake --build .The executable get-ip-tool will be created in the build directory.
./get-ip-tool./get-ip-tool -ip 8.8.8.8┌───────────┬───────────────────────────┐
│ IP │ 8.8.8.8 │
│ País │ United States │
│ Región │ California │
│ Ciudad │ Mountain View │
│ ISP │ Google LLC │
└───────────┴───────────────────────────┘
To use the tool from anywhere in your terminal without navigating to the project directory:
macOS/Linux:
# From the build directory
sudo cp get-ip-tool /usr/local/bin/
# Make it executable (if needed)
sudo chmod +x /usr/local/bin/get-ip-toolAfter this, you can run the tool from anywhere:
get-ip-tool
get-ip-tool -ip 1.1.1.1Add the build directory to your PATH environment variable:
For Bash (~/.bashrc or ~/.bash_profile):
echo 'export PATH="$PATH:$(pwd)"' >> ~/.bashrc
source ~/.bashrcFor Zsh (~/.zshrc):
echo 'export PATH="$PATH:$(pwd)"' >> ~/.zshrc
source ~/.zshrcFor Fish (~/.config/fish/config.fish):
set -Ua fish_user_paths (pwd)# From the build directory
sudo ln -s $(pwd)/get-ip-tool /usr/local/bin/get-ip-toolIf you installed using Method 1 or 3:
sudo rm /usr/local/bin/get-ip-toolIf you used Method 2, simply remove the export line from your shell configuration file.
- The tool uses libcurl to make HTTP requests to the ip-api.com API
- If no IP is specified, the API automatically detects your public IP
- The JSON response is parsed using a simple string-matching function
- Results are formatted and displayed in a clean table format
This tool uses the free tier of ip-api.com, which allows:
- 45 requests per minute
- Non-commercial use
- No API key required
This project is provided as-is for educational and personal use.
Feel free to submit issues and enhancement requests!