Source and generation contract
The backend repository owns the CLI implementation and must publish a machine-readable command manifest with each tag. Documentation generation will render command names, aliases, arguments, flags, defaults, environment mappings, config keys, output schemas, examples, deprecations, and numeric exits directly from that artifact. Human-authored sections explain workflow and safety but cannot redefine syntax. Documentation CI will compare the imported command manifest digest with the release manifest, regenerate reference output, run every stored example against the pinned binary in a clean environment, and fail on help drift. Until that artifact exists, the command tree below is the intended product surface, not a compatibility promise.Planned command tree
Global behavior
Every command supports generated help and version output. Planned global concerns include configuration profile, API origin, output mode, color, interactivity, timeout, request correlation, and diagnostic verbosity. Exact option spellings and short aliases remain unpublished. The CLI writes requested machine output to standard output and diagnostics to standard error. In machine mode, standard output contains exactly one documented JSON value or a documented newline-delimited stream. Progress indicators, colors, prompts, and update notices are disabled. Text mode is for humans and is not a stable parser contract. The process handles interruption, closes output records, stops local child work, requests remote cancellation only when explicitly configured, and returns the released cancellation exit. A terminal event or canonical report, not a spinner or connection lifetime, establishes run outcome.Installation and version proof
Install only an exact CLI version named by a compatible release manifest. Verify package or binary digest, signature, source tag and commit, license, component inventory, supported operating system and architecture, runtime when required, and runner/API/schema/report compatibility. Planned verification form:Configuration
The future config schema will define profile names, API origins, trust-key references, output defaults, timeouts, and non-secret project or environment selectors. Credentials, API keys, refresh tokens, runner private keys, Stellar seeds, webhook secrets, customer data, and provider values never belong in the config file. Expected precedence is explicit command option, process-scoped environment reference, selected profile, then compiled safe default. The CLI prints a redacted source map for effective configuration and fails on unknown keys, conflicting network passphrases, insecure origins, invalid file permissions, or a profile that selects an unavailable release. The release must publish exact config locations for Windows, macOS, Linux, containers, and portable mode. It must not silently search project directories for credentials or load arbitrary environment files. Automation should pass profile and resource IDs through protected workflow configuration and secrets through the released credential provider.Output modes
Planned output classes are:
Commands that return a resource include stable ID, type, state, release/schema identifiers, and safe correlation data. Sensitive fields are omitted rather than masked inconsistently. File-writing commands require an explicit destination, do not overwrite by default, write atomically, and return file size and SHA-256 in machine mode.
Authentication commands
login
Starts the released interactive or device authorization flow and stores only a protected renewable session in the operating-system credential store. Planned flags select profile and non-secret organization context; automation uses a separate service-account or workload-identity flow, never interactive login.
Reject an API origin not already trusted by the selected profile. The browser callback binds state, nonce, issuer, audience, redirect, and PKCE when the released identity flow requires it. Tokens never appear in terminal output, shell history, config, logs, or error messages.
whoami
Returns authenticated subject ID, organization memberships, active profile, token expiry class, and granted scopes without returning the token. Machine output is safe for authorization checks but not proof that a later command remains authorized.
logout
Revokes the current refresh/session credential when reachable, deletes the local credential, and records partial failure distinctly. A local deletion alone does not claim server revocation. logout never revokes service accounts or runner identities unless the exact released command says so.
Target discovery
Intended form:--home-domain sketch is not safe enough for active testing because target ownership and policy must already be bound. The released command may allow passive preview of a canonical home domain, but authenticated, browser, signing, or value-moving discovery requires a verified target resource.
Output records target and network, ownership state, discovery snapshot, normalized origin, SEP-1 digest, redirects, address-policy result, capabilities, retrieval time, and infrastructure diagnostics. DNS, TLS, network-policy, size, or parser failure remains indeterminate, not conformance failure.
Scenario validation
Intended form:Suite locking and inspection
suite lock resolves a suite version, scenarios, parameters, target snapshot, standards and rule packs, generated schemas, runner image and capabilities, fixtures, policy, and release compatibility into immutable canonical bytes and a digest. The command requires exact resource IDs or versions and an explicit output file.
suite inspect verifies the lock schema and digest and renders every input, expanded case, skip condition, side effect, amount/fee limit, destination class, secret handle, artifact class, and cleanup obligation. It never resolves secret values. Re-locking identical inputs must produce the same digest.
Starting a run
Intended form:--wait, return the accepted run ID and initial state. With --wait, reconnect to the same run through event cursors and finish only at a documented terminal state: completed, failed, indeterminate, policy blocked, cancelled, or cleanup failed. A lost stream cannot create another run.
Automation sets an explicit overall deadline. If local waiting times out, query run status before cancellation or retry; the remote workflow may still be active.
Status and event replay
run status returns authoritative durable state, suite-lock and release identities, timestamps, runner class, current step summary, gate when known, and cleanup status. It does not expose raw traffic or secrets.
run events resumes from a provided event ID, handles heartbeat records, de-duplicates event IDs, and stops when history expires or a terminal event is seen. Event history is an observation channel; after a gap, use durable status and the canonical report.
Machine consumers validate every event schema and tolerate only documented additive fields. An unknown event type is recorded and prompts state reconciliation rather than being executed.
Cancellation
Intended form:--wait, finish only when the run reaches cancelled, cleanup failed, or another already-terminal state. Repeated cancellation returns the same outcome. A cancellation denied by policy, delivered after completion, or unable to reach a local runner has a distinct machine result.
Interactive interruption asks before sending cancellation unless a non-interactive automation flag defines behavior. Terminating the CLI process without a cancellation request only stops observation.
Report download and verification
report download writes canonical JSON plus explicitly selected detached verification material. Derived HTML, PDF, JUnit, and SARIF outputs use separate filenames and never replace the canonical report. The command verifies transport size/digest and will not overwrite an existing path unless the released safe option is explicit.
Intended offline verification form:
CI policy gate
Intended form:Evidence operations
Evidence commands are unavailable until the contracts repository releases generated specs, operator tooling, and verified deployment manifests.evidence publish is intended to accept a locally verified canonical report and manifest, show the exact compact commitment and target network, simulate the Soroban invocation, obtain separate signer approval, submit once, and return transaction hash, ledger, contract ID, method, report digest, and emitted event. It never uploads the report or accepts a report-signing key as the contract signer.
evidence status reads a known deployment and reports present, superseded, revoked, or absent state at a verified code hash. evidence verify compares a report and its release/suite material with the on-chain commitment and returns an integrity decision with disclaimers.
Unknown network, manifest, contract ID, code hash, method, signer, sequence, simulation, or submission outcome fails closed. An unknown submission is reconciled by transaction hash and source sequence before any retry.
Runner commands
Runner commands operate on customer-hosted service state and require the local runner release.runner registerconsumes a one-time token through a protected input and creates local mutual-TLS identity.runner startvalidates config and identity, opens the outbound lease channel, and stays foregrounded unless installed through documented service-manager tooling.runner statusreports redacted local health, version, identity expiry, capabilities, leases, cleanup backlog, and control-plane reachability.runner rotate-credentialgenerates and activates a new identity before retiring the old one.runner revokerequests control-plane revocation by exact runner ID and guides local cleanup; it is not a substitute for an owner revoking a compromised unreachable host.
PowerShell automation
The stored planned PowerShell example uses separate statements, explicit files, JSON output, semantic verification, and atry/finally cleanup boundary. It contains placeholders and is not executable.
On Windows, use PowerShell’s native argument arrays and literal paths. Do not build a command string with secrets, use shell tracing around authentication, or collapse every nonzero exit into conformance failure. Capture $LASTEXITCODE immediately after each CLI invocation.
POSIX automation
The stored planned POSIX example uses quoted variables, a temporary directory, a cleanup trap, JSON output, and distinct run/verify/gate results. It contains placeholders and is not executable. Use an argument array where the shell supports it, disable command tracing around credentials, quote every path and ID, and avoid parsing human output. Signal handling must not accidentally start a second run or skip cleanup.Semantic exit categories
The tagged CLI must assign a unique stable integer to every category. Numbers remain unassigned here to avoid creating an accidental contract.
An indeterminate report uses the released infrastructure or distinct indeterminate mapping; the final command manifest must remove any ambiguity. Wrappers preserve the numeric value and machine result rather than remapping all nonzero codes.
Troubleshooting
Use diagnostic verbosity only in a controlled environment. It cannot include secrets, raw customer data, private keys, unredacted traffic, internal target addresses, or upload capabilities.
Help-drift and example gate
A CLI release is documentable only when CI:- downloads the tagged binary/package and verifies its digest and signature;
- imports the machine-readable command manifest and verifies provenance;
- regenerates this command reference and proves a clean working tree;
- snapshots root and every subcommand’s human and machine help;
- validates config and output schemas and unique numeric exit assignments;
- runs PowerShell examples on supported Windows and POSIX examples on each supported shell;
- exercises login, discover, validate, lock, run, reconnect, cancel, download, verify, gate, evidence, and runner cases available in that release;
- asserts no secret appears in output, logs, process arguments, config, or artifacts;
- tests all semantic exits and representative invalid options;
- records the binary, command-manifest, example, report, and cleanup digests.