Class J7mCli

java.lang.Object
org.j7m.middleware.deployer.cli.J7mCli

public final class J7mCli extends Object
Command-line entry point for local J7M application and nugget operations.

The CLI implements the Phase 5.2-5.6 local developer/operator workflow: package, sign, verify, deploy, plan, start, list, status, stop, unload, upgrade, rollback, repository status, and repository audit verification. It is intentionally local-runtime scoped and does not contact remote fleets, external artifact replication systems, production CAs, KMS, GRC, SIEM, PDP, or vendor services.

The nugget command family is the Phase 7 CLI client for the headless nugget administration contracts. It owns terminal parsing, prompt and target state, local/provider-backed discovery, PIN-source handling, safe status and inspection rendering, application lifecycle requests, and disabled-by-default nugget control requests. Concrete remote administration transports, script mode, and web or HTTP adapters are outside this CLI class and require separate providers over the same public contracts.

  • Method Details

    • main

      public static void main(String[] args)
      Runs the CLI as a Java main class.
      Parameters:
      args - command-line arguments
    • run

      public static int run(String[] args)
      Executes a command and writes output to System.out.
      Parameters:
      args - command arguments
      Returns:
      process-style exit code
    • run

      public static int run(String[] args, PrintStream output)
      Executes a command.
      Parameters:
      args - command arguments
      output - destination for safe public output
      Returns:
      0 success, 1 user input failure, 2 verification/security failure, 3 lifecycle/runtime failure, or 4 unexpected internal failure
    • run

      public static int run(String[] args, PrintStream output, PrintStream error)
      Executes a command with separated public output and diagnostics streams.
      Parameters:
      args - command arguments
      output - destination for safe public output
      error - destination for safe diagnostics
      Returns:
      process-style exit code
    • run

      public static int run(String[] args, InputStream input, PrintStream output, PrintStream error, NuggetCliClient nuggetClient, NuggetCliSecretReader secretReader, Clock clock, NuggetCliTicker ticker, NuggetCliEventSink eventSink, Map<String,String> environment)
      Executes a command with explicit nugget CLI integration seams.

      This overload is intended for deterministic demos, tests, embedders, and future launchers that already own the input, output, diagnostics, clock, event sink, and transport-neutral nugget client. It does not weaken production provider loading: ordinary command-line execution still obtains nugget clients through NuggetCliClientProvider. The supplied environment map is a caller-owned snapshot used only for explicitly named PIN sources such as --pin-env; values are not printed by the CLI and are copied only into shortest-scope credential material.

      Parameters:
      args - command arguments
      input - command input
      output - destination for safe command output
      error - destination for diagnostics
      nuggetClient - transport-neutral nugget client
      secretReader - interactive secret reader, or null
      clock - wall-clock source for request metadata
      ticker - monotonic time source for deadlines and credential expiry
      eventSink - safe CLI event sink
      environment - immutable environment snapshot used by explicit environment-source options
      Returns:
      process-style exit code