# cp9 CLI Output Contract

Use text output for human updates and JSON output when a test or script needs structured assertions.

Important surfaces:

- `setup`: checks out and builds the latest release before preflight, TTL,
  cleanup readiness, cleanup command, and local runtime AWS profile
  reconciliation. It mutates the local CP9 checkout and `bin/cp9`, but creates
  no cloud resources. If normal GitHub remote access fails and `gh` is logged
  in, only that remote operation retries through `gh auth git-credential`;
  global git configuration is not changed. `checkout=false` keeps the current
  local version.
- `doctor`: actionable blockers with field/service/fix details.
- `up dry-run=true`: lifecycle preview without mutation.
- `status`: session state, artifact paths, Tilt runtime/services, cost availability.
- `logs`: bounded evidence with matched/empty status and source identity.
- `deploy dry-run=true`: service/Tilt-resource preview without mutation.
- `deploy`: for a source-owned service with a live-binary companion, triggers
  and waits for compilation before triggering and waiting for the shipping
  resource. A service without that companion uses and waits for its single
  shipping resource. Success means every selected Tilt update converged, not
  merely that a deploy trigger was queued.
- `artifacts resolve/refresh`: immutable owner-artifact selection and explicit
  artifact or Ready-session service-image refresh; report the resolved SHA or
  image digest, not only command success.
- `starter status`, `essential-v2 status`, and `byoc status`: product-capability
  readiness independent from top-level Dev full readiness.
- `browser-acceptance`: persisted redacted human-observed Auth0 outcome; it is
  historical evidence, not a live browser probe.
- `refresh-creds`: re-mints and patches declared AWS credential consumers;
  workload restart is separate and explicit.
- `purge`: operator cleanup planning/execution for provable ownership scope.
- `inventory`: read-only resource-family attribution; it never tags or deletes.
- `destroy`: single closeout report with stages, session-root cleanup, and either direct-cleanup survivor evidence or cloud-cleanup delegation fields. Delegation is complete for agent closeout; do not wait for the delegated workflow unless explicitly asked.
