Skip to main content

Module cli

Module cli 

Source
Expand description

CLI definition: the five global args (defined exactly once, here) and the subcommand enum.

Placement rules (Phase 1 research, Pattern 1):

  • Globals set the global arg attribute so they propagate to every subcommand; subcommand structs never redeclare them.
  • Never mark a global arg required (clap rejects required globals).
  • Flags-only, zero interactive prompts — ever (research anti-pattern: “Prompting ever”).

Structs§

BackupArgs
Backup subcommands (07-02, BKUP-01) — the standalone surface of the Phase 4 gwbk wire. restore is the family’s destructive verb (the 8th --yes-guarded set member: it REPLACES this gateway’s state); download is a streamed read, unguarded.
Cli
EamArgs
EAM subcommands (07-02, BKUP-02) — the read-heavy surface with guarded writes. Every runtime verb honestly reports the controller-mode state gate (eam_not_controller on a stock gateway — the README documents the manual flip).
LintArgs
ign lint args (07-04, INTR-02) — the ignition-lint delegation: PATHS map to --target <path> pairs on the child’s arg vector; -- passthrough args ride verbatim after them (power users: --profile, --checks, --fail-on, …).
LoggersArgs
LogsArgs
Logs args: the query filters ride the TOP level so bare ign logs [-f] lists/tails (must-have truth #1) while download and the loggers subtree hang off the optional subcommand — the SessionsArgs precedent.
ProfileArgs
Profile subcommands (nested: a struct wrapper carrying the subcommand enum, so Commands::Profile gets an Args payload).
ProjectArgs
Project subcommands (03-01, PROJ-01/02). delete is the family’s ONE destructive verb (--yes-guarded, exit 2 without); copy/ rename/set create or relabel — never destroy — so they carry NO guard (planner decision per research).
ResourceArgs
Resource subcommands (03-03, PROJ-05). delete is the family’s destructive verb (--yes-guarded, exit 2 without — the sessions-terminate shape); put is an upsert (create-or-replace ONE resource with explicit content) and stays friction-free per the planner decision — agents pass exactly what they want written.
RigArgs
Rig args (04-01, RIG-01): --rig rides the TOP level (the SessionsArgs --type precedent) so every rig verb shares it. The command enum carries ONLY the wired verbs — later plans extend it one variant at a time (the established extend-per-plan chore; no unimplemented!() stubs, every commit compiles clippy-clean).
ScriptArgs
Script subcommands (07-03, SCRPT-01) — the smallest family: ONE verb over the already-shipped, already-secured scriptExec route. script requires a subcommand (the rig trial shape — no bare row); the opt-in is STRUCTURAL (the route deploys only via ign webdev deploy --with-script-exec, which persists the secret at 0600), so run carries NO --yes guard by design — the deploy flag IS the opt-in and agents need the verb non-interactive (the research-adopted decision).
SessionsArgs
Sessions args: the family filter rides the TOP level so bare ign sessions [--type X] lists (must-have truth #1) while ign sessions terminate … carries the destructive half.
TagsArgs
Tags args (05-04, TAGS-01..04) — the grouped-subfamily pattern: tags provider … nests one level deeper (the family’s native REST half), browse/read/write ride the TOP level. The webdev-dependent arms carry --project (default ign-cli, the same default as deploy — the deployed routes live in that project).
TrialArgs
Trial subcommands (04-03, RIG-02/03). status reads the unauthenticated trial endpoint + banners cross-check. reset is the family’s destructive verb (--yes-guarded, exit 2 without — the reset precedent); the password NEVER rides a flag (env/secret only — redaction discipline).
WaitArgs
Wait targets (02-05, HLTH-11). gateway and restart poll the UNAUTHENTICATED /StatusPing (the dispatch builds a header-less client for them — waiting must work when auth is broken); module is an authed read.
WebdevArgs
Webdev subcommands (05-03, WEB-01/02). Deploy is deliberately NOT --yes-guarded: the dedicated project (default ign-cli) is CLI-OWNED — born from the first deploy zip and overwrite-replaced on every deploy (replace-not-merge is the CONTRACT here; user projects are never touched — README documents). scriptExec rides only on explicit request, gated by a deploy-time generated shared secret stored in the profile config at 0600.

Enums§

BackupCommand
CliBackupType
CLI value-enum mirror of the core BackupType (ignition-core stays clap-free; From converts at the dispatch seam).
CollisionPolicy
Import collision policy (03-02). Exactly the two values REST exposes — merge is the Designer import popup’s vocabulary and is NOT a value: clap’s invalid-value error lists the two real choices, and the README documents merge as Designer-only (the sanctioned rejection-with-hint shape).
Commands
ConnectionType
EamCommand
EamTaskCommand
eam task … — the guarded writes (07-02 Task 3). new carries the typed guard ladder (backup+OnDemand unguarded; mutating types and any non-OnDemand schedule need –yes; restore/install/upgrade types refuse outright — see README); force dispatches NOW, always guarded.
LogLevel
The seven spec-documented log levels (TRACE..OFF), value-enum form for clap; LogLevel::wire yields the uppercase wire token.
LoggersCmd
LogsCmd
ProfileCmd
ProjectCommand
ResourceCommand
RigCommand
ScheduleMode
Schedule modes (the openapi taxonomy’s user-facing subset — SuspendedByFailover is system-owned, not a CLI value).
ScriptCommand
SessionType
CLI value-enum mirrors of the core action enums (ignition-core stays clap-free; From converts at the dispatch seam).
SessionsCmd
TagsAlarmsCommand
tags alarms … — the alarm subfamily (05-06, TAGS-07). History needs a JOURNAL-PROVISIONED gateway (database connection + alarm-journal profile + general-alarm-settings — default rigs refuse exit 6 with the provisioning hint); acknowledge is the gateway-scope 3-arg form, so --username is REQUIRED (no default-guessing) and ack is deliberately NOT --yes-guarded (acknowledging never un-acknowledges anything — a state-advancing read-adjacent verb).
TagsCommand
TagsConfigCommand
tags config … — the configuration CRUD subfamily (05-05, TAGS-05): the get→edit-file→write-back surgical loop. Definition files are the configure shape (README’s traps table: tagType discriminator, nested children, alarms-as-LIST).
TagsHistoryCommand
tags history … — the historian subfamily (05-06, TAGS-08).
TagsProviderCommand
TagsUdtCommand
tags udt … — the UDT subfamily (05-05, TAGS-06).
TrialCommand
WaitCmd
WebdevCommand