Previously, running chkip without any arguments attempted to resolve None
as a domain, resulting in misleading output like "No A record".
This commit adds a check to print the usage line if neither a domain nor
the --me flag is specified. This improves usability and makes the tool behave
more predictably when called without arguments.
The --me flag now respects the --json option. When used together,
chkip will return local and public IP addresses as structured JSON.
This allows easier integration into scripts or tools that consume JSON,
while maintaining human-readable output as the default.
Additionally, CGNAT detection is included in the JSON object as a boolean flag.
This commit introduces the --me flag, which allows users to quickly display
their current local IPv4 and public IPv4/IPv6 addresses.
The public IPs are retrieved using ifconfig.me via curl, ensuring accurate
detection even in CGNAT or split-DNS scenarios. Local IPv4 is determined
via the system's active route through the configured resolver.
The output also includes a CGNAT detection based on private IP ranges and
the reserved 100.64.0.0/10 block, providing a helpful warning if detected.
IPv6 privacy extensions are common, so local IPv6 detection has been removed
to avoid redundant or unstable information.
Added a compact one-liner installation command that installs all dependencies,
clones the Git repository, sets up a symbolic link to ~/.local/bin,
makes the script executable, and adds a Bash alias.
This makes it easy for users to set up the tool with a single copy-paste command,
especially useful for quick testing or sharing in forums and chats.
USE WITH CARE
Instead of copying the script file manually to ~/.local/bin using 'cp',
we now recommend creating a symbolic link with 'ln -s'.
This makes updates easier, as any changes pulled from the Git repository
are immediately reflected in the linked binary without needing to copy
the file again. It’s also safer in the long term, as users won’t
accidentally run outdated versions from ~/.local/bin.