Expand description
Shared CLI logic - table rendering, age math, status classification. Library form so binaries compose against it and unit tests exercise formatting without spinning up a real CP.
Re-exportsΒ§
pub use config::ConfigError;pub use config::FileConfig;pub use config::Overrides;pub use operator_cert::MintOperatorCertArgs;pub use operator_cert::MintOutcome;pub use operator_cert::mint_operator_cert;
ModulesΒ§
- color
- Tiny ANSI helper. No
colored/owo-colorsdep - these are 4 codes. - commands
- Operator subcommands of the
nixfleetumbrella binary. Each module exposes apub struct Args(derived fromclap::Args, not Parser) and apub fn run(args: Args) -> Result<()>handler. - config
- Operator-side config: layered resolution + TOML round-trip.
- operator_
cert - Operator-cert mint. Offline crypto only - never opens a socket. Generates an ECDSA-P-256 keypair, signs a clientAuth-EKU child with the fleet root cert + key, atomic-writes both PEMs.
StructsΒ§
- Resolved
Client Config - Resolved operator-side config. Every field is required by the time we reach a network call; layered loader (flag > env > file) populates this.
- Status
Inputs
FunctionsΒ§
- base_
status_ πlabel - build_
client - compliance_
label π - current_
column π - CURRENT-column rendering with a context-aware fallback chain. The
agentβs post-activation closure observation (
current_closure_hash) is the canonical value, but itβsNonebetween rollout-open andActivationCompleted(the switch-in-progress window). During that window the host is demonstrably executingpending_closure_hashβ the closure the agent reported running when it acked the dispatch β and the operator wants to see it. - display_
hash π - format_
age π - layout_
styled π - paint_
status π - Map a STATUS label to its colored variant. FOOTGUN:
\u{2026}also marks hash-column truncation indisplay_hash- only call this on STATUS labels emitted bystatus_label, never on hash columns. - render_
events_ summary - Compact summary table for
--no-jsonmode. One line per event:seq ts kind host. The full payload is only available via the default JSON output. - render_
hosts_ table - Render
nixfleet rollout hosts: wave-major listing of per-host dispatch state. Open dispatches show<open>in TERMINAL. - render_
status_ table - render_
status_ table_ with_ color - run_
config_ init - Write
~/.config/nixfleet/config.toml(or--path). Returns the absolute path so the bin can report it. - run_
events GET /v1/rollouts/{id}/eventsβ chronological event_log stream. CLI subcommand:nixfleet rollout events <id>. Default output is JSON because payload shapes vary bykindβ a single rendered table would mislead.json = falsefalls back to a compact summary (seq / ts / kind / host).- run_
hosts GET /v1/rollouts/{id}/hostsβ per-host summary. CLI subcommand:nixfleet rollout hosts <id>.- run_
status - short_
ts π - β2026-05-05T12:34:56.789Zβ -> β2026-05-05 12:34:56β (denser column). Falls back to the original on parse fail so malformed rows surface.
- status_
label π