fipsctl

July 28, 2026 · View on GitHub

Command-line client for the FIPS daemon's control socket.

Synopsis

fipsctl [-s SOCKET] <subcommand> [args...]

Description

fipsctl connects to a running daemon over its control socket (Unix domain socket on Linux/macOS, TCP loopback on Windows), sends one JSON request, and pretty-prints the response. Exits with a non-zero status if the socket cannot be reached, the daemon returns an error, or the request times out.

fipsctl keygen is a special case: it does not contact the daemon and operates purely on local files.

For the line-delimited JSON wire protocol, see control-socket.md. For the YAML configuration that defines the socket location, see configuration.md.

Global Options

FlagArgumentDescription
-s, --socketPATHOverride the control-socket path (Linux/macOS) or TCP port (Windows).
-V, --versionPrint the short version.
--versionPrint the long version.
-h, --helpPrint usage and exit. Per-subcommand help via fipsctl <subcommand> --help.

Subcommands

show <what>

Read-only queries against the daemon. Each subcommand maps 1:1 to a control-socket query (see control-socket.md) and prints the response's data object as pretty JSON.

SubcommandControl-socket commandReturns
show statusshow_statusNode-level status: identity, version, peer/link/session counts, TUN state, recent sparklines.
show peersshow_peersAuthenticated peer list with link IDs, transport addresses, MMP metrics, Noise/rekey state.
show linksshow_linksActive links (one per FMP-authenticated peer): direction, state, byte counters.
show treeshow_treeSpanning-tree state: root, my coordinates, parent, peer declarations.
show sessionsshow_sessionsEnd-to-end FSP sessions: state, traffic counters, session-MMP metrics, path MTU.
show bloomshow_bloomBloom-filter state: own filter sequence, leaf dependents, per-peer filter summaries.
show mmpshow_mmpMMP metrics summary: per-peer link-layer metrics and per-session session-layer metrics.
show cacheshow_cacheCoordinate cache: TTL, fill ratio, per-destination coords and path MTU.
show connectionsshow_connectionsPending handshake connections: state, idle time, resend count.
show transportsshow_transportsTransport instances: type, state, MTU, local address, per-transport stats.
show routingshow_routingRouting summary: pending lookups, retry state, forwarding/discovery/error/congestion counters.
show identity-cacheshow_identity_cacheCached (node_addr → npub) entries with last-seen timestamps.

acl <what>

SubcommandControl-socket commandReturns
acl showshow_aclLoaded peer-ACL state: allow/deny files, effective mode, default decision, entry counts.

stats <what>

Time-series metrics from the in-process history rings.

SubcommandControl-socket commandDescription
stats listshow_stats_listEnumerate available metrics, their units, and the per-ring retention windows.
stats metricsshow_metricsDump current counter values for every protocol metric family (forwarding, discovery, tree, bloom, congestion, errors).
stats peersshow_stats_peersList peers tracked in stats history (active or recently active).
stats history <metric> [options]show_stats_historyFetch a time-series window for one metric.

stats history options:

FlagArgumentDefaultDescription
--peernpub or hostname(none)Required for per-peer metrics; resolves through /etc/fips/hosts if not an npub.
--window<N>s / <N>m / <N>h10mWindow duration.
--granularity1s or 1m1sRing resolution. 1s uses the fast ring; 1m uses the slow ring.
--plotoffRender a Unicode-block sparkline to stdout instead of JSON.

keygen [options]

Generate a new FIPS identity keypair locally. Does not contact the daemon.

FlagArgumentDefaultDescription
-d, --dirDIR/etc/fips (Unix), %APPDATA%\fips (Windows)Output directory for fips.key and fips.pub.
-f, --forceoffOverwrite an existing fips.key.
-s, --stdoutoffPrint nsec then npub to stdout instead of writing files.

fips.key is written with mode 0600 and fips.pub with mode 0644 on Unix. After running keygen, set node.identity.persistent: true in fips.yaml or the daemon will overwrite the keys on next start.

connect <peer> <address> <transport>

Tell the daemon to dial a peer over a specific transport.

ArgumentDescription
peernpub (bech32) or hostname from /etc/fips/hosts.
addressTransport endpoint, e.g. 192.168.1.10:2121, [2001:db8::1]:2121, or a Tor onion. FIPS-mesh ULAs (fd00::/8) are rejected for the IP-based transports (udp, tcp, ethernet).
transportOne of udp, tcp, tor, nym, ethernet. The named transport must be configured and running.

disconnect <peer>

Tell the daemon to drop a peer link.

ArgumentDescription
peernpub (bech32) or hostname from /etc/fips/hosts.

profile tick <on|off|status>

Reading the output. Step durations are wall clock measured across await points, not CPU time: a step that waits on I/O accrues that wait, and other tasks may run inside the span. That is the intended measure for head-of-line delay, and it means a large step is not necessarily an expensive one. arm_starvation is measured directly as the entry time minus the deadline the interval scheduled that tick for. It is not derived from tick_entry_gap, which carries no starvation signal on its own: under a steady delay every gap is exactly one tick period.

Start, stop and inspect a capture of the rx-loop tick body. Present only when both fipsctl and the daemon are built with --features profiling; the feature is off by default, so a stock package does not carry this subcommand and a stock daemon reports profile_tick_* as an unknown command.

SubcommandControl-socket commandDescription
profile tick onprofile_tick_onCreate the capture file and start recording. Fails if a capture is already running (naming the active file) or if the directory cannot be written.
profile tick offprofile_tick_offStop the capture. The writer is woken immediately, drains once more and is joined, so the command returns promptly. Succeeds, reporting nothing active, when no capture is running.
profile tick statusprofile_tick_statusReport idle, running, stopped_by_cap or stopped_by_error, plus the active path, bytes written, flush interval and byte cap.

profile tick on options:

FlagArgumentDefaultDescription
--dirdirectory path/var/log/fipsWhere to write the capture. Created if absent. Use it to profile a non-root cargo run, or on a platform whose log root differs.

One file is written per capture, named profile-<UTC timestamp>.tsv. It opens with a #-prefixed header block (node npub, build version, platform, configured tick period, flush interval, byte cap, start time), then a tab-separated column header, then one row per measured step per flush interval:

ts_unix  kind  domain  name  count  max  total  unit

kind is step for a timed span and gauge for a sampled scalar, so a gauge value never lands under a duration column; unit names the unit of max and total for that row. Every step present in the build gets a row every interval, including zero-count rows. Gauges cover ticks per interval, peer count, the wall gap between successive tick-arm entries, and the arm-starvation delay, which is measured against the deadline the tick was scheduled for rather than derived from the gap.

A capture stops itself on reaching 32 MB, appending a # line saying so; profile tick status then reports stopped_by_cap until the next on or off clears it.

Exit Codes

CodeMeaning
0Daemon returned {"status":"ok",...}.
1Argument parse failure, control-socket connection failure, daemon returned {"status":"error",...}, or local I/O failure (keygen). The error message is printed to stderr.

Environment

VariableDescription
XDG_RUNTIME_DIRUsed to derive the default control-socket path when /run/fips is absent.

fipsctl does not consume RUST_LOG; logging is for the daemon.

Files

PathPurpose
/etc/fips/hostsMaps hostnames to npubs for the connect, disconnect, and --peer arguments. See configuration.md.
Control socket (default)Same resolution as the daemon: /run/fips/control.sock if present, else $XDG_RUNTIME_DIR/fips/control.sock, else /tmp/fips-control.sock (Unix); TCP localhost:21210 (Windows).

If you get Permission denied connecting to the socket on Linux, add your user to the fips group (sudo usermod -aG fips $USER) and log out and back in.

See also