CLI

The nxthdr CLI is a command line tool to interact with the nxthdr platform. It supports authentication, peering operations, and probing credits management.

Source code: github.com/nxthdr/cli

Installation

Install from crates.io using Cargo:

cargo install nxthdr

Authentication

All commands that interact with the platform require authentication. The CLI uses the Auth0 device authorization flow.

Login

nxthdr login

This will display a URL and a code. Open the URL in your browser and enter the code to authenticate. Tokens are stored locally and refreshed automatically when expired.

Logout

nxthdr logout

Removes stored tokens from your system.

Status

nxthdr status

Displays your current authentication state and token expiration time.

Probing

Commands to interact with the probing platform (Saimiris).

Credits

nxthdr probing credits

Displays your daily probing credits usage. Each probe you send consumes one credit. The daily limit resets at midnight UTC.

Example output:

Probing credits (today):
  Used:  1500
  Limit: 10000
  Remaining: 8500

Peering

Commands to interact with the peering platform (PeerLab).

Get your ASN

nxthdr peering asn

Displays your assigned private ASN. An ASN is automatically assigned on first use.

Prefix management

List your active prefix leases:

nxthdr peering prefix list

Request a new /48 IPv6 prefix lease (duration in hours, 1 to 24):

nxthdr peering prefix request 12

Revoke an existing prefix lease:

nxthdr peering prefix revoke 2a06:de00:5b::/48

PeerLab environment

Generate a .env file for PeerLab with your ASN and active prefixes:

nxthdr peering peerlab env > .env

Verbosity

All commands support a --verbose flag (or -v) to increase log output. Use -vv for debug level.

nxthdr -v probing credits

Environment Variables

Variable Description Default
NXTHDR_API_URL PeerLab API base URL https://peerlab.nxthdr.dev
NXTHDR_SAIMIRIS_API_URL Saimiris Gateway base URL https://saimiris.nxthdr.dev
NXTHDR_CLIENT_ID Auth0 client ID Built in default