Expand description
Core library for ign — the Ignition 8.3+ gateway CLI.
This crate holds everything the binary (and, from Phase 6, the TUI) shares: config/profile management, the gateway HTTP client, actions, the typed error taxonomy, and output models.
Invariants (ARCHITECTURE.md layering, made structural in Phase 1):
- Core compiles without clap and without ratatui.
- Core never prints to stdout — it returns models; the binary renders.
- Actions are plain functions over injected
client::GatewayApi-style seams, so the CLI and the TUI call the same code.
Module map: error (the LOCKED exit-code taxonomy + failure envelope),
output (the LOCKED success envelope), config (discovery, profiles,
secrets, rigs), client (the client::GatewayApi seam + GatewayInfo),
session (the session::Session execution seam — the ONE resolution
choreography every auth/gateway client flows through), poll (the
shared wait/retry engine), rig (the compose shell-out
engine — runner seam, discovery, pre-flight), actions (the shared
verb layer), and webdev (the embedded route bundle ign webdev deploy
zips — pure data, no I/O).
Modules§
- actions
- Actions — the shared verb layer (ARCHITECTURE.md layering invariant: CLI handlers and, from Phase 6, the TUI both call these).
- client
- The gateway HTTP seam: a coarse
GatewayApitrait so actions never touch reqwest types, plus the productionReqwestGatewayApi. - config
- Config discovery, load/save, selection, and the env overlay (research Pattern 2).
- error
- Typed error taxonomy — THE exit-code contract for
ign. - output
- Success envelope rendering — the LOCKED Phase-1 output shape.
- poll
- The ONE wait/retry engine (02-04) — shared by the log tail here and
by 02-05’s
wait/restart --wait. Deliberately ~40 lines + tests instead of a retry framework (STACK.md rejected reqwest-middleware; 02-RESEARCH §Wait-loop pattern). - rig
- Rig discovery + pre-flight (04-01, RIG-01): the
RigPlanmodel, the LOCKED 5-level discovery that always ends in one resolve-then-actconfigrun, and the port-collision pre-flight. - session
- The execution session — the ONE seam every auth/gateway-client resolution flows through (CORE-09).
- webdev
- Embedded WebDev route bundle — the CLI’s own gateway-side surface.