@packetrove/cli
v0.8.0
Published
Packetrove network calculations and IP diagnostics for scripts and agents.
Readme
Packetrove CLI
Network calculations and IP diagnostics for humans, scripts, and agents.
The @packetrove/cli package contains the packetrove executable and bundles
its runtime dependencies. CIDR calculations run locally without a network
connection. The public-ip command queries the public IP observed for this machine's
connection.
CLI versions follow Packetrove's product releases. npm versions and Git tags
use the same plain number, such as 0.1.0.
Installation
Install the npm package with Node.js and npm; Git, pnpm, and a source checkout are not needed:
npm install --global @packetrove/cli
packetrove --helpAlternatively, run a published version without a global installation:
npx @packetrove/cli cidr-cover 203.0.113.1 203.0.113.2 203.0.113.6 --jsonSupported Node.js versions are 22.22.2 or later in the 22.x line, 24.15.0 or later in the 24.x line, and 26 or later. To build your own copy, follow the source installation guide.
Cover IP addresses and CIDR ranges
packetrove cidr-cover 203.0.113.1 203.0.113.2 203.0.113.6
packetrove cidr-cover --stdin --json < addresses.txtUse 1 to 1,000 IPv4 entries or IPv6 entries. CIDR host bits are normalized;
duplicates and overlaps count once. The example returns 203.0.113.0/29,
covering eight addresses, including five beyond the supplied three. That wider
range permits additional addresses in an allowlist or blocks additional
addresses in a blocklist. The command calculates a range without applying
firewall rules.
Each entry accepts at most 64 characters. Standard-input lines are trimmed and blank lines are ignored. Line buffering stays bounded even for a very long entry or surrounding whitespace; length issues retain their combined input indexes, without echoing input values. See the CLI guide for error details.
With --json, success writes the shared result object to stdout. Errors write
the shared error object to stderr and exit with status 1. Address counts are
decimal strings, including IPv6 counts beyond JavaScript's safe integer limit.
A failed output write may leave partial stdout; check the exit status before
using a result.
Check the current public IP
packetrove public-ip
packetrove public-ip --json
packetrove public-ip --api-origin http://localhost:8787 --jsonWithout --json, stdout contains just the address and a newline. The default
endpoint is https://api.packetrove.com/v1/public-ip; a lookup makes a network request
with a 10-second timeout, no cache, and no redirects. --api-origin supports a
self-hosted HTTP or HTTPS origin without credentials, a path, query, or fragment.
The result describes the connection from the machine running the command. A VPN or proxy changes the observed address. One request observes IPv4 or IPv6; it does not separately discover both families.
Documentation and license
Packetrove is licensed under the MIT License. This package includes LICENSE
and THIRD_PARTY_NOTICES for the bundled third-party components.
