Skip to content

CLI Reference

Every command accepts -v / --verbose for debug-level logging and --help for detailed usage. --output-format is a global flag taking text (the default), json or markdown.

What --output-format guarantees

Read this before you parse Pacto's output in a script.

  • json describes a successful result. When a command fails to produce its result, for example because a reference is unreachable or pacto.lock is missing, the error goes to stderr as plain text and stdout stays empty, whatever --output-format says. A negative verdict is still a result: pacto validate on an invalid contract and pacto diff on a breaking change both print their whole JSON document to stdout and exit 1. An empty stdout tells you there is nothing to parse. Read stdout when it is non-empty, and read the exit code for the verdict.
  • Only pacto diff implements markdown, for posting a diff as a CI comment. Every other command renders text.
  • Keys are camelCase in every command ("path", "valid", "errors", "upToDate"). Before v4, init, validate, pack, pull and push emitted capitalised keys ("Path", "Valid").
  • An unrecognised value is rejected. --output-format yaml exits 1 with unsupported output format "yaml" before the command runs.

The interactive and side-effecting commands (login, logout, update, mcp, dashboard) inherit the flag from the root command and always emit text.


Global flags

      --config string           config file path
  -h, --help[=true|false]       help for pacto
      --no-anim[=true|false]    disable animations
      --no-cache[=true|false]   disable OCI bundle cache
      --output-format string    output format (text, json, markdown) (default "text")
  -v, --verbose[=true|false]    enable verbose output

Exit codes

Pacto exits 0, 1 or 2, apart from pacto run (below). 0 means the command produced its result and the result was acceptable. 1 means the check failed or the command could not run, so the exit status alone cannot distinguish "the check failed" from "the command could not run". 2 means pacto impact could not show that a change or an event is safe, and no other command exits 2 for its own result. pacto run exits with the exit code of the command it wraps, whatever it is, or 1 when that command exits 0 and the final verdict fails --fail-on. Recording a run record (--stats-registry, --stats-file) never changes an exit code. pacto stats publish exits 1 when a file could not be published.

Exits 1 Exits 0
pacto diff where the overall classification is BREAKING a POTENTIAL_BREAKING or NON_BREAKING diff
pacto validate reporting at least one error validation that reported only warnings
pacto lock --check on a stale lockfile, or with none at all (LOCK_MISSING) a lockfile that is up to date
pacto impact where the gate is blocked: a BREAKING change reaches a consumer that does not accept the new version and runs on a known target, or a policy referrer that fails the new policy does pacto impact where the gate is clear: the change is not BREAKING and every policy referrer was checked and passes the new policy, or the snapshot is complete and no service depends on the changed one; an event (--unavailable, --removed or --regressed) when the complete snapshot shows nothing depends on the service
pacto stats publish when a file could not be read, parsed or published pacto stats publish that published every file
pacto migrate when a pacto.yaml could not be read or written, or --to names an unsupported version pacto migrate that rewrote, kept or left every file, 1.x files included
any command that could not run, for example on an unresolvable reference, an unreadable bundle or an unknown flag
Exits 2
pacto impact where the gate is unverified: a BREAKING change that nothing is shown to block, on a partial answer or with consumers none of which is shown to be safe; or a change of any classification with a policy referrer that fails the new policy and runs nowhere known, could not be checked or could not be resolved
pacto impact --unavailable, --removed or --regressed when anything depends on the service or the answer is partial. An event never exits 1 for its result

Two cases affect CI gates:

  • A pacto diff against a missing reference exits 1, the same as a breaking change.
  • pacto impact exits 1 only when the change is breaking and a source that knows where services run shows an incompatible consumer on a target. Sources that know no targets, such as --local alone, cannot show that, so a breaking change with consumers exits 2. A job that gates on deployed impact alone can treat 2 as a pass; any other job fails on it.

Use stdout to tell a verdict from a failure. A command that produced a verdict writes it to stdout and puts a one-line summary on stderr. A command that could not run leaves stdout empty:

Invocation Exit stdout stderr
pacto diff --output-format json OLD NEW (breaking) 1 the full JSON result breaking changes detected
pacto diff --output-format json oci://…/absent:1.0.0 NEW 1 empty old contract: artifact not found: …

In a script, branch on stdout when it is non-empty, and treat an empty stdout with exit 1 as a tool failure.


OCI version resolution

All commands that accept oci:// references support automatic version resolution. When a reference omits the tag (for example oci://ghcr.io/acme/svc-pacto with no :1.0.0), pacto queries the registry for available tags and selects the highest semver version.

For dependency references declared with a compatibility constraint, only tags satisfying the constraint are considered. For example, a dependency with compatibility: "^2.0.0" and available tags 1.0.0, 2.0.0, 2.3.0, 3.0.0 resolves to 2.3.0.

Resolution ignores non-semver tags such as latest and main. Digest-pinned references (@sha256:...) and explicitly tagged references are used as-is.

Constraints apply to the CLI's dependency graph

The CLI applies compatibility constraints when it resolves a contract's declared dependencies, for example in pacto graph. The dashboard's version discovery selects the highest semver tag and ignores per-dependency compatibility constraints. Root-contract pulls (a tagless top-level oci:// ref) also select the highest semver tag with no constraint.


pacto accept

Plans an acceptance record for the newest published version of a service: a bundle repository (oci://host/path) or the service's checkout, whose publish.bundle names it.

--proposed accepts every dependency range pacto ci proposed in the inferred record. A field, positional or with --field, accepts one proposed field: dependencies[<name>].compatibility, optionally with =<range> to accept another range, or dependencies[<name>].ref, which --proposed never accepts. --break <provider>@<version> accepts a break the provider announces for this service in breaks[], read from that published version, or from --from (the provider's checkout or a pushed oci:// ref) before it is published.

The plan names every field with its value and source, who may accept (the service's declared owner), the acceptances already attached and the intent digest. Without --dry-run, the record is signed and attached to that version in its own bundle repository with your registry credentials. Only your interactive Sigstore login (a browser, or a device code with --device) signs the record, and only a record a person who owns the service signs counts. Every other signer (--sign-key, an ambient OIDC token in CI) writes a draft, pacto-accept-draft-<n>, that a person accepts.

--draft <repo>:pacto-accept-draft-<n> accepts a draft an agent or CI wrote: its record is planned again against the registry now, refused when anything moved since the draft was written, shown with the person it names in on_behalf_of, and signed by you after a Sigstore login.

pacto accept <service-ref-or-dir> [field...] [flags]

Examples:

  # Plan accepting every proposed range of reports
  pacto accept oci://ghcr.io/acme/reports --proposed --dry-run

  # Accept the plan you reviewed, signed after a Sigstore login
  pacto accept oci://ghcr.io/acme/reports --proposed --intent sha256:...

  # Accept the break ledger 3.0.0 announces, before it is published
  pacto accept ./reports --break ledger@3.0.0 --from ../ledger

  # Accept the draft an agent wrote, signed after a Sigstore login
  pacto accept oci://ghcr.io/acme/reports --draft ghcr.io/acme/reports:pacto-accept-draft-1

Flags:

      --break string             accept the break this provider version announces, as <provider>@<version>
      --device[=true|false]      log in with a device code instead of a browser
      --draft string             accept this acceptance draft, as <repo>:pacto-accept-draft-<n>, signed by you
      --dry-run[=true|false]     print the plan and write nothing
      --field stringArray        a proposed field to accept, as <key> or <key>=<range>; repeat it for more
      --from string              the provider's checkout or oci:// ref to read an unpublished break from
      --fulcio-url string        Fulcio to get the signing certificate from (default "https://fulcio.sigstore.dev")
  -h, --help[=true|false]        help for accept
      --intent string            the intent digest of the plan you reviewed: a different plan is refused
      --oidc-client-id string    OpenID Connect client of the Sigstore login (default "sigstore")
      --oidc-issuer-url string   OpenID Connect issuer of the Sigstore login (default "https://oauth2.sigstore.dev/auth")
      --proposed[=true|false]    accept every proposed dependency range
      --rekor-url string         Rekor transparency log the signature is recorded in (default "https://rekor.sigstore.dev")
      --sign-key string          sign with this key file: a key names no person, so the run writes a draft
      --timestamp-url string     timestamp authority to date the signature with
      --trusted-root string      Sigstore trusted root JSON to verify with (default: public-good Sigstore)

pacto agent

Runs until interrupted. Watches TCP listeners and outbound connection outcomes with an eBPF program, attributes each socket to the workload that created it (a Kubernetes pod, a container, a systemd unit or a pacto run session, from its cgroup, or from its network namespace when the cgroup names none) and publishes a snapshot every --publish-interval. --sink kubernetes writes the node's NodeRuntimeObservation status (pods only; what the Pacto operator's node agent DaemonSet runs); --sink stdout prints one JSON snapshot per line.

--sink local and --sink evidence check workloads against their contracts on this host. The workloads come from --bindings (a YAML list of {match: {unit|container|cgroup|session|pid}, contract, host, interfaces: {name: port}, dependencies: {name: host:port}}) and with --docker from running containers labelled dev.pacto.contract=, dev.pacto.bind.<interface>=<port> and dev.pacto.dep.<dependency>=. Interfaces and dependencies are judged from the kernel's view, health and metrics capabilities by probing the bound port; a negative is reported once it persists for --stabilization-window. --sink local prints every target's compliance and findings each interval in --output-format; --sink evidence signs each target's evidence and sends it to an Evidence Server, which needs contracts pinned as oci://...@sha256:<digest>. Envelope sequences start at the wall clock in nanoseconds and count up, so they keep increasing across restarts as long as the clock does.

Needs Linux 5.11 or later with BTF, or 5.8 or later with BTF and root or CAP_SYS_RESOURCE; root (or BPF, PERFMON and SYS_PTRACE); and the host's /proc and cgroupfs.

pacto agent [flags]

Examples:

  pacto agent --sink stdout --publish-interval 5s
  pacto agent --sink kubernetes --cgroup-root /host/sys/fs/cgroup
  pacto agent --sink local --docker --cgroup-root /host/sys/fs/cgroup
  pacto agent --sink evidence --bindings bindings.yaml --evidence-url https://evidence.example.com \
    --evidence-key agent.key --evidence-key-id k1 --evidence-producer host-1

Flags:

      --bindings string                   with --sink local or evidence: YAML file binding workloads to contracts
      --cgroup-root string                where the host cgroup v2 hierarchy is mounted; empty attributes by network namespace only (default "/sys/fs/cgroup")
      --docker[=true|false]               with --sink local or evidence: check running containers labelled dev.pacto.contract (Docker Engine API on /var/run/docker.sock)
      --docker-label-filter stringArray   with --docker: only check containers that also carry this label (key=value or key; repeatable, all must match), e.g. com.docker.compose.project=demo
      --enable-probing[=true|false]       also probe the wire protocol of every interface found listening
      --evidence-key string               with --sink evidence: private key file envelopes are signed with
      --evidence-key-id string            with --sink evidence: key id (must match the server's trust entry)
      --evidence-producer string          with --sink evidence: producer id
      --evidence-url string               with --sink evidence: Evidence Server base URL
  -h, --help[=true|false]                 help for agent
      --namespace string                  namespace the NodeRuntimeObservation is written to with --sink kubernetes (default $POD_NAMESPACE)
      --node-name string                  name of this host; with --sink kubernetes also the NodeRuntimeObservation name (default $NODE_NAME)
      --proc-root string                  where the host /proc is mounted (a pod needs hostPID, a container --pid=host) (default "/proc")
      --publish-interval duration         how often a snapshot is published (whole seconds) (default 30s)
      --resync-interval duration          how often workloads, network namespaces and listeners are re-read from /proc (default 1m0s)
      --ringbuf-size uint32               kernel ring buffer size in bytes; a power of two and a multiple of the page size (default 262144)
      --sink string                       where snapshots go: one of [kubernetes stdout local evidence] (default "stdout")
      --stabilization-window duration     how long a negative must persist before it is reported (default 2m0s)

pacto ci

Walks root (default .) for pacto.yaml, skipping the folders the root .pactoignore names, and prints one plan: the CI platform, the registry and the base, each with its source, then one row per service: whether it changed against its published baseline, the version it would publish, the classification of the change and its impact on the consumers the fleet source flags name.

The registry is --registry, else the registry the installation advertises in what the operator detected (--detected, used only when it is fresh and no PACTO_REGISTRY_* credential is set, since those answer any host), else the CI platform's registry, else the one registry every image names.

On GitHub Actions the plan is also appended to $GITHUB_STEP_SUMMARY; on GitLab CI it is written to pacto-plan.md in $CI_PROJECT_DIR. --output-format json writes the plan as one JSON document.

Without --publish the run is a plan: it reads the registry and the consumer sources you name and writes nothing to them. A run record goes to --stats-file only, one file per impacted service.

The exit status follows the plan: 0 clear, 1 blocked, 2 unverified. A repository with no pacto.yaml, or a folder it cannot read, exits 2.

A pacto.yaml that declares an older pactoVersion is raised to the current one in memory when that keeps its meaning, recorded in the bundle's pacto.inferred.yaml and noted on its row; the file in the repository is never rewritten.

--publish publishes every changed service on the merged commit, through the engine pacto publish runs, providers before the services that depend on them. A service that fails blocks only the services of the run that depend on it; a version lost to a concurrent run is planned again, up to 3 times. A pull or merge request pipeline is refused before any token is asked for or anything is built. Each service leaves a run record. With --publish the exit status is 0 when every changed service is published, else 1.

pacto ci [root] [flags]

Examples:

  # Plan every service of this repository against a registry
  pacto ci --registry ghcr.io/acme

  # Check the impact on the consumers a target-state file names, as JSON
  pacto ci --registry ghcr.io/acme --target-state targets.yaml --output-format json

  # Why the payments row reads as it does
  pacto ci --registry ghcr.io/acme --explain payments

  # On the merged commit: publish every changed service, payments from an image built elsewhere
  pacto ci --publish --image payments=ghcr.io/acme/payments@sha256:<digest>

Flags:

      --cache[=true|false]                 include every bundle in the local OCI cache as an offline baseline revision
      --context stringArray                kubeconfig context to read live Pacto CRs from, like --k8s for the current one; repeatable, each cluster read once
      --delivery-trust string              the trust config target snapshots are verified with: a YAML file with a key scoped to each cluster (default $PACTO_DELIVERY_TRUST)
      --detected string                    add what the operator detected as inferred rows: k8s:<namespace>/<name> of its <release>-detected ConfigMap, or a file holding the same JSON
      --evidence-url stringArray           base URL of an Evidence Server to consume its read-only operational-graph contribution over HTTP (repeatable)
      --explain string                     explain one service's row: its folder, baseline, why it changed, its inferred fields and its consumers
      --external-catalog string            organization external catalog to merge over the default, as oci://REPOSITORY@sha256:DIGEST, else PACTO_EXTERNAL_CATALOG; a tag is refused
      --fingerprints string                a file (YAML or JSON) of the workload managers and promoters this installation runs, as the chart's fingerprints value: each promoter found reads promotion owned by <product> in the detected providers
      --freshness duration                 mark target evidence older than this as stale (the dashboard's window; 0 skips the check and every answer says so) (default 24h0m0s)
  -h, --help[=true|false]                  help for ci
      --image stringArray                  with --publish: the image <service> deploys, pinned by digest, as <service>=<repo>@sha256:...; Pacto builds, signs and copies none. A bare <repo>@sha256:... needs exactly one changed service
      --index string                       organization index pacto impact and pacto ci read consumers from, as <registry>/pacto-index with no tag or digest (default <registry>/pacto-index from the provider reference; none reads none; skipped when --root names the consumers; pacto ci --publish also writes its entries there; other fleet commands ignore it)
      --k8s[=true|false]                   include live Pacto CRs from the current Kubernetes cluster as targets
      --local stringArray                  local bundle root(s) to scan (repeatable) (default [.])
      --mira-source stringArray            base URL of a Mira node whose service map supplies observed calls between services (repeatable)
      --namespace string                   namespaces to read Pacto CRs from with --k8s, comma-separated (empty = all namespaces)
      --no-transparency-log[=true|false]   with --publish and --sign-key: keep the signatures out of the transparency log
      --oci stringArray                    registry reference to include as a published-baseline revision (repeatable)
      --policy stringArray                 range policy for a BREAKING change, repeatable: unknown-range=warn|fail and uncontracted=warn|fail:<window> (such as fail:7d); default warn
      --publish[=true|false]               publish every changed service, on the merged commit only
      --registry string                    registry the services publish to, for example ghcr.io/acme; default from the installation advertisement or the CI platform
      --root stringArray                   contract root whose whole dependency closure joins the snapshot: a local bundle path or an oci:// reference (repeatable)
      --sign-key string                    with --publish: sign the services whose contract declares no publish section with this cosign key file instead of keyless
      --stats-context string               comma-separated context to include in the run record: repository, run-url, environment=<name>; nothing is included unless named
      --stats-file string                  write the run record to this file for pacto stats publish, replacing the record it holds, so give each command its own file; default $PACTO_STATS_FILE
      --stats-registry string              publish an unsigned run record (statistics, never evidence) to this repository, for example ghcr.io/acme/pacto-stats; default $PACTO_STATS_REGISTRY
      --target-snapshot stringArray        signed target snapshot(s) to read targets from: an oci:// pacto-targets repository, or :cluster-<uid> tags or digests to pin the clusters CI expects (repeatable); pacto impact, pacto ci and pacto_impact on a stdio pacto mcp also take auto (the default: derived from the provider ref) and off
      --target-state stringArray           offline target-state fixture file(s) supplying targets, for demos and tests; production targets arrive as signed EvidenceSets (repeatable)
      --traces stringArray                 OTLP/JSON trace file supplying runtime-observed dependency edges, folded into the snapshot as observed relationships (repeatable)

pacto ci init

Writes the CI caller that runs pacto ci into the repository at dir (default .). With a .github folder it writes .github/workflows/pacto.yml, five lines that call the pacto-actions reusable workflow pinned by commit. With .gitlab-ci.yml it adds the pacto-actions GitLab component to its include list, or moves the commit of the entry already there, and leaves every other byte of the file as it was. --platform picks one when the repository has both or neither.

pacto ci init writes into the working tree only: you review and commit the file. An existing GitHub caller with other content is replaced only with --force. With --output-format json, content is the whole file written or to write and lines counts the lines of the caller it adds.

To plan a folder named init, run pacto ci ./init.

pacto ci init [dir] [flags]

Examples:

  # Write the caller for the CI platform this repository uses
  pacto ci init

  # Print the GitHub caller without writing it
  pacto ci init --platform github --dry-run

Flags:

      --dry-run[=true|false]   print the caller without writing it
      --force[=true|false]     replace a GitHub caller that has other content
  -h, --help[=true|false]      help for init
      --platform string        the CI platform to write the caller for, github or gitlab; default from the .github folder or .gitlab-ci.yml

pacto completion

Generate the autocompletion script for pacto for the specified shell. See each sub-command's help for details on how to use the generated script.

pacto completion [flags]

Flags:

  -h, --help[=true|false]   help for completion

pacto dashboard

Launches an operational dashboard over the fleet snapshot: the same operational graph the CLI's pacto fleet commands query, served as a web UI.

The dashboard is the exploration and observability layer of the Pacto system. It visualizes the same contracts the CLI manages and the operator verifies, organised around four workflows: an operational Overview, the Services inventory, the Operational Graph and Change analysis.

Each positional argument is a contract source reference: - oci://registry/repo → OCI registry source (can be repeated) - ./path/to/dir → local filesystem source (at most one)

When no arguments are given, sources are auto-detected: - local: enabled if pacto.yaml is found in the working directory - cache: enabled if the OCI bundle cache (~/.cache/pacto/oci) holds bundles - k8s: enabled if a kubeconfig or in-cluster config resolves - oci: from the positional arguments, the PACTO_DASHBOARD_REPO env var, or the status.contract.resolvedRef of the cluster's Pacto resources

When running alongside the Kubernetes operator, OCI repositories are automatically discovered from the status.contract.resolvedRef fields of Pacto CRD resources on every refresh. The result combines runtime state from the operator with contract content from OCI.

Every source contributes to one snapshot, rebuilt in the background, and each answer carries the as-of time and the completeness of the sources behind it.

pacto dashboard [sources...] [flags]

Examples:

  # Start dashboard with auto-detected sources
  pacto dashboard

  # Start from a specific directory
  pacto dashboard ./services

  # Include OCI repositories
  pacto dashboard oci://ghcr.io/org/order-service oci://ghcr.io/org/payment-service

  # Mix local and OCI sources
  pacto dashboard ./services oci://ghcr.io/org/payment-service

  # Custom port
  pacto dashboard --port 9090

  # Read only some Kubernetes namespaces (default: all namespaces)
  pacto dashboard --namespace payments,ledger

Flags:

      --allow-anonymous[=true|false]      serve beyond loopback without sign-in: everyone who reaches the address reads the whole fleet (also PACTO_DASHBOARD_ALLOW_ANONYMOUS)
      --context stringArray               kubeconfig context to read live Pacto CRs from (repeatable, each cluster read once); outside a pod the named contexts replace the current one and people sign in against the first (also PACTO_DASHBOARD_CONTEXT)
      --cors-origin string                explicit cross-origin allowed to call the API (default: same-origin only)
      --delivery-namespace string         namespace Pacto delivery runs in, whose published identity policy (agent, break-glass and human groups, team prefix) says who is an agent and who may answer (default "pacto-delivery")
      --delivery-trust string             the trust config delivery records are verified with, so History reads signed records (the recorder's PEM public key or a YAML trust config; default $PACTO_DELIVERY_TRUST)
      --detected string                   what the operator detected, shown as inferred rows: k8s:<namespace>/<name> of its <release>-detected ConfigMap, or a file holding the same JSON (also PACTO_DASHBOARD_DETECTED)
      --external-catalog string           organization external catalog to merge over the default, as oci://REPOSITORY@sha256:DIGEST; a tag is refused (also PACTO_DASHBOARD_EXTERNAL_CATALOG)
      --fingerprints string               a file (YAML or JSON) of the workload managers and promoters this installation runs, as the chart's fingerprints value: each promoter found reads promotion owned by <product> in the detected providers (also PACTO_DASHBOARD_FINGERPRINTS)
  -h, --help[=true|false]                 help for dashboard
      --host string                       bind address for the dashboard server (default "127.0.0.1")
      --mira-source stringArray           base URL of a Mira node whose service map supplies observed calls between services (repeatable; also PACTO_DASHBOARD_MIRA_SOURCES)
      --mira-url string                   Mira's address, to link health-check citations and open a service in Mira
      --namespace string                  Kubernetes namespaces to read, comma-separated (empty = all namespaces); delivery reads narrow to it only when it names one
      --oidc-ca-file string               PEM bundle of the CAs that sign the issuer's certificate, trusted on top of the system roots (also PACTO_DASHBOARD_OIDC_CA_FILE)
      --oidc-client-id string             OpenID Connect client id of the dashboard
      --oidc-display-name string          the identity provider's name on the sign-in button, as in Sign in with Keycloak (default OIDC; also PACTO_DASHBOARD_OIDC_DISPLAY_NAME)
      --oidc-extra-scopes strings         scopes to ask for beyond openid, profile and groups
      --oidc-groups-claim string          ID token claim the API server takes the groups from; must match its claim mapping (default groups)
      --oidc-groups-prefix string         prefix the API server puts before every group; must match its claim mapping
      --oidc-internal-issuer-url string   address the dashboard reaches the issuer at when it differs from the public issuer URL browsers use, such as an in-cluster Service; ID tokens must still name the public issuer (also PACTO_DASHBOARD_OIDC_INTERNAL_ISSUER_URL)
      --oidc-issuer-url string            OpenID Connect issuer people sign in with before the dashboard shows anything; every view then shows what the signed-in person's Kubernetes RBAC lets them read, and every action runs as them (also PACTO_DASHBOARD_OIDC_ISSUER_URL; the client secret comes from PACTO_DASHBOARD_OIDC_CLIENT_SECRET)
      --oidc-redirect-url string          the dashboard's /auth/callback as browsers reach it (https)
      --oidc-username-claim string        ID token claim the API server takes the username from; must match its claim mapping (default sub)
      --oidc-username-prefix string       prefix the API server puts before the username; must match its claim mapping (default the issuer URL and #, none for the email claim; - for none)
      --owner-policy string               the mounted owner policy (the chart's declare block as policy.json) that decides who may set a service owner (also PACTO_DASHBOARD_OWNER_POLICY)
      --port int                          port for the dashboard server (default 3000)
      --review string                     how people are reviewed: cluster asks once about every namespace and needs a ClusterRole; local asks in each --namespace only, which a namespaced Role grants, and then services without a namespace show to nobody (also PACTO_DASHBOARD_REVIEW) (default "cluster")
      --session-idle-timeout duration     a session without a request for this long ends (default 1h)
      --session-max-age duration          a session ends this long after sign-in, renewed or not (default 12h)
      --stats-registry string             stats repository the Metrics page reads run records from (unsigned statistics; also PACTO_STATS_REGISTRY); a public repository is read anonymously, otherwise with the dashboard's registry credentials
      --token-login[=true|false]          let people sign in with a Kubernetes token: a ServiceAccount token minted with --audience pacto-dashboard reads the fleet only, and a person's own token acts as them (also PACTO_DASHBOARD_TOKEN_LOGIN)
      --trace-source stringArray          named offline OTLP/JSON trace source as NAME=PATH, where NAME is its stable data-source identity (repeatable; also PACTO_DASHBOARD_TRACE_SOURCES)
      --traces stringArray                OTLP/JSON trace file to fold observed dependencies from (repeatable; also PACTO_DASHBOARD_TRACES)

It auto-detects sources: pass OCI repositories as arguments, or run it next to the operator (with a kubeconfig) and it discovers OCI repositories from each Pacto resource's status.contract.resolvedRef. Use --no-cache for a cold start (it skips scanning pre-existing cached bundles; bundles fetched during the session are still cached).

For a tour of what the dashboard surfaces, see For platform engineers; to run it as a container, see Dashboard container.


pacto declare

Declares a workload the cluster runs as a service with a contract. The workload is name, namespace/name, namespace/Kind/name or k8s:namespace/Kind/name. Its contract is drafted from the cluster with your kubeconfig credentials, as pacto init --cluster does, or read from --dir, a folder pacto init --cluster wrote (its cluster facts are read again).

Without --yes it prints the plan and writes nothing: the version (0.1.0 for a first declaration, else the published baseline raised by the change), contract only with the baseline's deploy artifact reused or none, every dependency range and who signs. Proposed ranges stay unknown unless you name the dependency with --accept. The plan ends with its intent digest.

--yes prints the plan, then publishes it: a contract-only bundle signed keyless by you through an interactive Sigstore login (a browser, or a device code with --device). Nothing is built, no deploy tag is written and no Git access is needed. Only that login writes a declared version: a key, an ambient OIDC token (SIGSTORE_ID_TOKEN included) or a CI identity writes the next draft-<n> tag instead, and the output names the command a person runs to accept it with --from-draft. --intent refuses the run when the plan differs from the one you reviewed.

Setting, changing or removing service.owner (in a --dir folder or an accepted draft) takes a person who belongs to the current owner, declared or attested, or a default approver of the installation's owner policy; anyone else is refused before anything is pushed. The owner policy is read from the signed target snapshots in <registry>/pacto-targets, verified with --delivery-trust. An owner read from the workload's team label stays in pacto.inferred.yaml as inferred.

pacto declare <service> [flags]

Examples:

  # What declaring invoices would publish
  pacto declare billing/invoices --registry ghcr.io/acme

  # Accept the proposed range of ledger and publish, signed by you
  pacto declare billing/invoices --registry ghcr.io/acme --accept ledger --yes

  # Accept a draft an agent wrote
  pacto declare invoices --registry ghcr.io/acme --from-draft draft-3 --yes

Flags:

      --accept strings           a dependency whose proposed range you accept as declared; repeat it for more
      --call-window duration     how far back a call counts as a dependency (at least 1m, default 24h)
      --delivery-trust string    the trust config the target snapshots that carry the owner policy are verified with: a YAML file with a key scoped to each cluster (default $PACTO_DELIVERY_TRUST)
      --device[=true|false]      log in with a device code instead of a browser
      --dir string               a folder pacto init --cluster wrote, declared instead of a new draft
      --from-draft string        accept this draft-<n> tag: the workload is read again and you sign
      --fulcio-url string        Fulcio to get the signing certificate from (default "https://fulcio.sigstore.dev")
  -h, --help[=true|false]        help for declare
      --intent string            the intent digest of the plan you reviewed: a different plan is refused
      --max-items int            the most items read per kind of object; a kind cut short reads as partial (default 10000)
  -n, --namespace string         the namespace of the workload (default: every namespace the name is found in)
      --oidc-client-id string    OpenID Connect client of the Sigstore login (default "sigstore")
      --oidc-issuer-url string   OpenID Connect issuer of the Sigstore login (default "https://oauth2.sigstore.dev/auth")
      --registry string          the registry the contract is published to, as host/path
      --rekor-url string         Rekor transparency log the signature is recorded in (default "https://rekor.sigstore.dev")
      --sign-key string          sign with this key file: a key names no person, so the run writes a draft
      --timestamp-url string     timestamp authority to date the signature with
      --trusted-root string      Sigstore trusted root JSON to verify with (default: public-good Sigstore)
      --yes[=true|false]         publish the plan (or write a draft) after printing it

pacto delivery

Pacto delivery decides which version each environment (a Stage) runs. Every change is an Operation: plan it to see what the promoter will do and who must agree, propose it, and a person approves only when the contracts say a consumer would break, Pacto cannot see enough or the Stage asks for approval on every promote.

There is no approve tool for agents. approve is for people.

pacto delivery [flags]

Flags:

      --delivery-namespace string   namespace Pacto delivery runs in, whose published identity policy (agent, break-glass and human groups, team prefix) says who is an agent and who may answer (default "pacto-delivery")
  -h, --help[=true|false]           help for delivery
  -n, --namespace string            namespace of the Stage and its Operations (default "default")
      --trust string                the trust config delivery records are verified with: the recorder's PEM public key, or a YAML file of keys and the streams each may sign (default $PACTO_DELIVERY_TRUST)

pacto delivery approve

Record your decision on a held operation, as the person your kubeconfig signs you in as. When the installation accepts signed approvals (delivery.identities.signers) and the Stage keeps an approvals repository, the command instead logs you in again in your browser, signs the decision keyless with that login alone and pushes the signed approval record to the registry; it never reads SIGSTORE_ID_TOKEN or a CI token. When the promoter asks for a fresh login (delivery.promoter.authFreshness), the command instead makes you log in again in your browser (prompt=login, max_age=0) with its own OpenID Connect client and sends the Approval with that login's token, never your kubeconfig's: an agent running in your shell cannot approve as you without you typing your password at that moment. The token is not stored. With --intent and no operation name it reads no kubeconfig: it approves the operation a verified intent record names, signed keyless.

pacto delivery approve [<operation>] [flags]

Flags:

      --decision string             approve, reject or accept-unknown (default "approve")
      --fulcio-url string           Fulcio to get the signing certificate from, when the installation's signer names none (default "https://fulcio.sigstore.dev")
  -h, --help[=true|false]           help for approve
      --intent string               approve the operation this intent record names (<repository>:<tag> or <repository>@<digest>) with no kubeconfig: the intent must verify with --trust, and the decision is signed keyless under a signer --signers names
      --keyless[=true|false]        sign the decision keyless into the Stage's approvals repository when the installation accepts signed approvals; false records it in the cluster (default true)
      --note string                 why, for the record
      --oidc-ca-file string         PEM bundle of the CAs that sign the issuer's certificate, trusted on top of the system roots (also PACTO_DELIVERY_OIDC_CA_FILE)
      --oidc-client-id string       OpenID Connect client used only for approvals, never by a kubeconfig (a confidential client's secret comes from PACTO_DELIVERY_OIDC_CLIENT_SECRET) (default "pacto-approve")
      --oidc-extra-scopes strings   scopes to ask for beyond openid, profile and groups
      --oidc-issuer-url string      OpenID Connect issuer the cluster trusts, to log in again with (also PACTO_DELIVERY_OIDC_ISSUER_URL)
      --oidc-redirect-port int      loopback port the identity provider sends the browser back to (default: a free port)
      --signers string              the installation's identity policy (JSON or YAML, the pacto-delivery-identities ConfigMap's policy) whose signers verify an approval a person signed; used with a record reference
      --timestamp-url string        timestamp authority to date the signature with, when the installation's signer names none

pacto delivery autonomy

How many of the services Pacto has seen have a contract, how many promotions in each Stage's window no person asked for or approved, each Stage's level with the next level Pacto proposes and its newest would-have decision, and the blockers with a fix to copy. It only reads: a level moves through a proposed and approved operation.

It runs the dashboard's own autonomy view with your kubeconfig identity, so the apiserver decides what you see. Without -n it reads the namespaces you may list Stages in and leaves out, without naming them, those outside your permissions; a namespace that refuses the list makes the answer partial and is named in unreadable. The answer is the dashboard's JSON in every output format.

pacto delivery autonomy [flags]

Flags:

      --blockers int        Where the page of blockers starts; limit and q apply to it too
      --domain string       With service: the service's registry domain, empty for the default. A Stage that names another domain is left out; one that names none matches any
  -h, --help[=true|false]   help for autonomy
      --level string        Keep only the Stages at this level; none keeps those that report no level the ladder knows. It narrows the Stages, never byLevel or the blockers (observe, advise, auto-nonbreaking, autonomous, none)
      --limit int           How many per page; 0 means the list's default
      --offset int          Where the page starts. Past the end answers the last page
      --q string            Keep only what contains this text, ignoring case
      --service string      Keep only the Stages of the service with exactly this name; it narrows byLevel too, never the blockers or promotionsWithoutPerson

pacto delivery blame

Say who put a version in place on a Stage: who asked, for whom, who approved and what every gate said

pacto delivery blame [flags]

Flags:

      --digest string       the version to blame (defaults to the one the Stage runs)
  -h, --help[=true|false]   help for blame
      --stage string        the Stage (required)

pacto delivery caller

The caller as the API server names them, their actor class (human, agent, break-glass or controller) and how it was decided, when they last logged in, whether a question that names no team has nobody who may answer it and whether owner teams narrow who may answer.

It runs the dashboard's own caller view with your kubeconfig identity, so the apiserver decides what you see. Without -n it reads the namespaces you may list Stages in and leaves out, without naming them, those outside your permissions; a namespace that refuses the list makes the answer partial and is named in unreadable. The answer is the dashboard's JSON in every output format.

pacto delivery caller [flags]

Flags:

  -h, --help[=true|false]   help for caller

pacto delivery cancel

Cancel an operation that has not moved the pointer yet

pacto delivery cancel <operation> [flags]

Flags:

  -h, --help[=true|false]   help for cancel

pacto delivery candidates

List the versions a Stage may be promoted to: what pacto publish published that its candidate source offers

pacto delivery candidates [flags]

Flags:

  -h, --help[=true|false]   help for candidates
      --stage string        the Stage (required)

pacto delivery describe

Show what an operation type checks, when a person is needed and how it is undone

pacto delivery describe <type> [flags]

Flags:

  -h, --help[=true|false]   help for describe

pacto delivery environments

Service by environment: the digest and version each Stage runs and whether it is verified, failed, frozen, held or on auto-hold. With service it also says, per Stage, which actions the caller may take and why, including freeze and undo.

It runs the dashboard's own environments view with your kubeconfig identity, so the apiserver decides what you see. Without -n it reads the namespaces you may list Stages in and leaves out, without naming them, those outside your permissions; a namespace that refuses the list makes the answer partial and is named in unreadable. The answer is the dashboard's JSON in every output format.

pacto delivery environments [flags]

Flags:

      --domain string        With service: the service's registry domain, empty for the default. A Stage that names another domain is left out; one that names none matches any
      --environment string   Keep only the services with a Stage in this environment, and only those Stages
      --except stringArray   Leave out the Stages in these environments (repeat the parameter), and the services left with none: the figure's folded station lists every environment but the ones it draws
  -h, --help[=true|false]    help for environments
      --limit int            How many per page; 0 means the list's default
      --offset int           Where the page starts. Past the end answers the last page
      --q string             Keep only what contains this text, ignoring case
      --service string       Keep only the Stages of the service with exactly this name; with service, each row also offers freeze and undo
      --state string         Keep only the services with a Stage in this state (the one counts.byEnvironment counts it in), and only those Stages (failed, frozen, autohold, waiting, unverified, empty, verified)
      --tier string          Keep only the services with a Stage in an environment whose name says this tier (inferred from the name, never an order), and only those Stages (dev, test, prod)

pacto delivery explain

Explain an operation: where it is, every verdict with its citation and how to run it again

pacto delivery explain <operation> [flags]

Flags:

  -h, --help[=true|false]   help for explain

pacto delivery get

Show an operation: phase, outcome, verdicts and the question a person is asked

pacto delivery get <operation> [flags]

Flags:

  -h, --help[=true|false]   help for get

pacto delivery history

List what happened on a Stage, from its signed records when the recorder runs, otherwise from the cluster

pacto delivery history [flags]

Flags:

      --all[=true|false]        walk every Stage in the namespace given with -n, or in every namespace you can list
      --at string               what each Stage ran at this RFC 3339 time, or this long before now, from its signed records; with --stage or --all
      --cause string            only changes whose cause (reason, operation or cited verdict) names this text, ignoring case; it narrows the timeline too
      --correlation-id string   only changes with exactly this correlation id; it narrows the timeline too
      --domain string           with --service, its registry domain; a Stage that names none matches any
  -h, --help[=true|false]       help for history
      --service string          with --all, only the Stages of this service
      --since string            only changes at or after this RFC 3339 time, or this long before now (2h)
      --stage string            the Stage (this or --all)
      --until string            only changes at or before this RFC 3339 time, or this long before now (30m)

pacto delivery inbox

Held operations whose decision by the caller the promoter would count: the caller may update the Stage's workload and, when owner teams narrow who may answer, is in a team the question names (break-glass also gets those that name no team), with the decision asked and the affected services; a change whose update rights could not be checked marks the answer partial. Also the frozen Stages of the caller's services (every frozen Stage they can read when owner teams do not narrow) and the Errored operations on them.

It runs the dashboard's own inbox view with your kubeconfig identity, so the apiserver decides what you see. Without -n it reads the namespaces you may list Stages in and leaves out, without naming them, those outside your permissions; a namespace that refuses the list makes the answer partial and is named in unreadable. The answer is the dashboard's JSON in every output format.

pacto delivery inbox [flags]

Flags:

      --domain string        With service: the service's registry domain, empty for the default. A Stage that names another domain is left out; one that names none matches any
      --environment string   Keep only what waits to enter this environment: items on Stages whose spec.environment is this
      --errored int          Where the page of Errored changes starts
      --except stringArray   Leave out what waits to enter these environments (repeat the parameter); an empty value names held changes on Stages the caller cannot read. Like environment, it never narrows byEnvironment
      --frozen int           Where the page of frozen Stages starts
      --held int             Where the page of held changes starts
  -h, --help[=true|false]    help for inbox
      --limit int            How many of each section per page; 0 means 25
      --q string             Keep only what names this text (namespace, Stage, service or change), ignoring case
      --service string       Keep only the Stages of the service with exactly this name and the changes on them; it narrows byEnvironment too, and a change on a Stage the caller cannot read is left out

pacto delivery lifecycle

Follows one artifact of a service, named by exactly one of --digest, --version or --contract, through every Stage of the service you can see: whether pacto publish published it (Flux or the registry watch verified its signature) and, on each Stage, when it arrived, was verified, re-checked, rolled back or left, each from its signed record or the Operation's unsigned status. Without -n it reads every namespace you can list; one you cannot makes the answer partial and is named.

pacto delivery lifecycle [flags]

Flags:

      --contract string     its contract: a manifest digest or a digest-pinned reference
      --digest string       the artifact digest Stages point at
      --domain string       the service's registry domain; a Stage that names none matches any
  -h, --help[=true|false]   help for lifecycle
      --service string      the service the version belongs to (required)
      --version string      the version its contract declares

pacto delivery plan

Predict what the promoter will do: verdicts, the approval floor, the one question for a person and what must move first

pacto delivery plan [flags]

Flags:

      --cause-verdict pacto delivery explain --output-format json   a verdict (JSON, as pacto delivery explain --output-format json prints it) you cite as the cause; the promoter runs it again and refuses a cause that does not hold
      --correlation-id string                                       an id that ties this change to an incident or another change, such as a ticket; kept with the change and its record, filtered by pacto delivery history --correlation-id
      --from string                                                 where the Stage is now: a digest, or a level for delivery.pacto.trianalab.io/autonomy (defaults to its pointer, or to its current level)
  -h, --help[=true|false]                                           help for plan
      --on-behalf-of string                                         the person an agent acts for, as the Kubernetes username the cluster authenticates them as (what kubectl auth whoami prints for them, any OIDC prefix included); asserted, not verified; required when an agent proposes, never a service account or other system user, and that person may not approve the change
      --reason string                                               why, for the record
      --record string                                               for delivery.pacto.trianalab.io/acknowledge: the record id (sha256:...) of the upstream stand-in, as the Stage's Ready message names it
      --stage string                                                the Stage to change (required)
      --to string                                                   where to move: for a pointer type a version (3.0.0), a tag or an artifact digest (sha256:...), where a version or tag must name exactly one version pacto publish published that the Stage may take (list them with pacto delivery candidates); for delivery.pacto.trianalab.io/autonomy a level (observe, advise, auto-nonbreaking or autonomous)
      --type string                                                 operation type (default "delivery.pacto.trianalab.io/promote")
      --undoes string                                               for a rollback: the name of the operation it undoes

pacto delivery propose

Propose an operation; with --intent-digest it fails with PlanStale if anything moved since the plan or the reason or on-behalf-of differs

pacto delivery propose [flags]

Flags:

      --cause-verdict pacto delivery explain --output-format json   a verdict (JSON, as pacto delivery explain --output-format json prints it) you cite as the cause; the promoter runs it again and refuses a cause that does not hold
      --correlation-id string                                       an id that ties this change to an incident or another change, such as a ticket; kept with the change and its record, filtered by pacto delivery history --correlation-id
      --from string                                                 where the Stage is now: a digest, or a level for delivery.pacto.trianalab.io/autonomy (defaults to its pointer, or to its current level)
  -h, --help[=true|false]                                           help for propose
      --intent-digest string                                        the intent digest from your plan; propose refuses if it no longer matches, so pass the same --to, --reason and --on-behalf-of
      --name string                                                 the Operation name (generated when empty)
      --on-behalf-of string                                         the person an agent acts for, as the Kubernetes username the cluster authenticates them as (what kubectl auth whoami prints for them, any OIDC prefix included); asserted, not verified; required when an agent proposes, never a service account or other system user, and that person may not approve the change
      --reason string                                               why, for the record
      --record string                                               for delivery.pacto.trianalab.io/acknowledge: the record id (sha256:...) of the upstream stand-in, as the Stage's Ready message names it
      --stage string                                                the Stage to change (required)
      --to string                                                   where to move: for a pointer type a version (3.0.0), a tag or an artifact digest (sha256:...), where a version or tag must name exactly one version pacto publish published that the Stage may take (list them with pacto delivery candidates); for delivery.pacto.trianalab.io/autonomy a level (observe, advise, auto-nonbreaking or autonomous)
      --type string                                                 operation type (default "delivery.pacto.trianalab.io/promote")
      --undoes string                                               for a rollback: the name of the operation it undoes

pacto delivery published

Per service the caller can see Stages of: the versions its Stages know, whether Flux or the registry watch verified their signature and which Stages run or verified each.

It runs the dashboard's own published view with your kubeconfig identity, so the apiserver decides what you see. Without -n it reads the namespaces you may list Stages in and leaves out, without naming them, those outside your permissions; a namespace that refuses the list makes the answer partial and is named in unreadable. The answer is the dashboard's JSON in every output format.

pacto delivery published [flags]

Flags:

      --domain string       With service: the service's registry domain, empty for the default. A Stage that names another domain is left out; one that names none matches any
  -h, --help[=true|false]   help for published
      --limit int           How many per page; 0 means the list's default
      --offset int          Where the page starts. Past the end answers the last page
      --q string            Keep only what contains this text, ignoring case
      --service string      Keep only the versions of the service with exactly this name; it narrows counts too
      --signed string       yes: keep only the services whose every version is signed; no: keep only the services with an unsigned version, and only those versions; unknown: keep only the services with no unsigned version and a version whose signature Pacto cannot tell, and only those versions (yes, no, unknown)

pacto delivery record

Work with the signed records of operations

pacto delivery record [flags]

Flags:

  -h, --help[=true|false]   help for record

pacto delivery record get

Reads one signed record of a Stage's stream by its full id or by the short id a text history prints (sha256: and 12 hex characters), when only one record starts with it. A record reference (<repository>:<tag> or <repository>@<digest>) reads any record, approvals and intents included, with no kubeconfig.

pacto delivery record get <id-or-ref> [flags]

Flags:

  -h, --help[=true|false]   help for get
      --signers string      the installation's identity policy (JSON or YAML, the pacto-delivery-identities ConfigMap's policy) whose signers verify an approval a person signed; used with a record reference
      --stage string        the Stage whose stream holds the record (with a record id)

pacto delivery record verify

Verifies every record of a Stage's stream against the trust config and checks the chain. With a record reference (<repository>:<tag> or <repository>@<digest>) it reads no kubeconfig: it verifies that one record, an approval or intent included, and for an approval says whether the operation record lists it (counted).

pacto delivery record verify [<ref>] [flags]

Flags:

      --all[=true|false]    verify every Stage's stream in the namespace given with -n, or in every namespace you can list
  -h, --help[=true|false]   help for verify
      --signers string      the installation's identity policy (JSON or YAML, the pacto-delivery-identities ConfigMap's policy) whose signers verify an approval a person signed; used with a record reference
      --stage string        the Stage (this or --all)

pacto delivery refusals

Recent publishes Pacto refused, newest first, with the check that refused each and the version bump the change needs. recorded false means this cluster keeps no record of refused publishes, so an empty list proves nothing.

It runs the dashboard's own refusals view with your kubeconfig identity, so the apiserver decides what you see. Without -n it reads the namespaces you may list Stages in and leaves out, without naming them, those outside your permissions; a namespace that refuses the list makes the answer partial and is named in unreadable. The answer is the dashboard's JSON in every output format.

pacto delivery refusals [flags]

Flags:

  -h, --help[=true|false]   help for refusals

pacto delivery status

Lists every Stage of one service you can see, in promotion order from each Stage's spec.candidates: the version it runs, its state as the dashboard counts it, its upstream, its candidate, its newest re-check, its level and the actions you may ask for (promote, unfreeze, freeze, undo), each with why or why not. Without -n it reads every namespace you can list; one you cannot makes the answer partial and is named. With --why it also plans the promote of each candidate, proposes nothing and says what holds it back.

pacto delivery status [flags]

Flags:

      --domain string       the service's registry domain; a Stage that names none matches any
  -h, --help[=true|false]   help for status
      --service string      the service whose Stages to show (required)
      --why[=true|false]    also plan the promote of each Stage's candidate (proposing nothing) and say what holds it back

pacto delivery targets

Work with the signed target snapshots CI reads without cluster credentials

pacto delivery targets [flags]

Flags:

  -h, --help[=true|false]   help for targets

pacto delivery targets publish

Signs a target snapshot document and pushes it to <registry>/pacto-targets:cluster-<cluster>. The document is the JSON predicate of delivery.pacto.trianalab.io/target-snapshot/v1: the cluster UID, its completeness and limitations, the Pacto objects as the read contract and the workloads no Pacto targets. The command sets asOf to now, the publisher to the signing key and the registry mode to the one detected on the cluster's existing tag.

Production clusters publish from the operator once the chart's registry value is set. This command is for demos, tests and installations that build the document themselves.

--key takes a PEM private key or a pacto evidence keygen seed. After a push the command writes <key>.pub.pem when it is absent; it refuses to publish while that file holds another key. A reader verifies the snapshot only with a trust entry that holds that public key and is scoped to the cluster (streams: ["<cluster>//"]).

pacto delivery targets publish <file> [flags]

Flags:

  -h, --help[=true|false]   help for publish
      --key string          the signing key: a PEM private key or a seed that pacto evidence keygen wrote
      --registry string     registry host and path the snapshot is written under, as <registry>/pacto-targets

pacto delivery trust

Per service with a Stage that watches the registry and the caller can see: the installation's publisher rule or signed policy, the identities a person pinned, the CI signers waiting for a person to confirm them and the newest verdicts, each saying which source decided. Pins or a policy that could not be read mark the answer partial.

It runs the dashboard's own trust view with your kubeconfig identity, so the apiserver decides what you see. Without -n it reads the namespaces you may list Stages in and leaves out, without naming them, those outside your permissions; a namespace that refuses the list makes the answer partial and is named in unreadable. The answer is the dashboard's JSON in every output format.

pacto delivery trust [service] [flags]

Flags:

      --domain string       With service: the service's registry domain, empty for the default. A Stage that names another domain is left out; one that names none matches any
  -h, --help[=true|false]   help for trust
      --limit int           How many per page; 0 means the list's default
      --offset int          Where the page starts. Past the end answers the last page
      --q string            Keep only what contains this text, ignoring case
      --service string      Keep only the service with exactly this name

pacto delivery types

List the operation types you may propose

pacto delivery types [flags]

Flags:

  -h, --help[=true|false]   help for types

pacto delivery undo

Plan how to undo an operation; it proposes nothing and prints the command that would

pacto delivery undo <operation> [flags]

Flags:

  -h, --help[=true|false]   help for undo
      --stage string        the operation's Stage, needed only when the Operation was deleted and must be found in the records

pacto diff

Compares two contracts (local paths or oci:// references) and produces a classified change set (BREAKING, POTENTIAL_BREAKING, NON_BREAKING).

pacto diff <old> <new> [flags]

Examples:

  # Compare a remote contract with a local one
  pacto diff oci://ghcr.io/acme/svc-pacto:1.0.0 my-service

  # Markdown output for CI comments
  pacto diff --output-format markdown oci://ghcr.io/acme/svc-pacto:1.0.0 my-service

Flags:

  -h, --help[=true|false]        help for diff
      --new-set stringArray      set a value on the new contract (e.g. --new-set service.version=2.0.0)
      --new-values stringArray   values file to merge into the new contract (can be repeated)
      --old-set stringArray      set a value on the old contract (e.g. --old-set service.version=1.0.0)
      --old-values stringArray   values file to merge into the old contract (can be repeated)
      --stats-context string     comma-separated context to include in the run record: repository, run-url, environment=<name>; nothing is included unless named
      --stats-file string        write the run record to this file for pacto stats publish, replacing the record it holds, so give each command its own file; default $PACTO_STATS_FILE
      --stats-registry string    publish an unsigned run record (statistics, never evidence) to this repository, for example ghcr.io/acme/pacto-stats; default $PACTO_STATS_REGISTRY

Exit code: 1 when the overall classification is BREAKING, and also when the diff could not be produced. A non-zero exit alone is therefore no contract verdict. See Exit codes for how to tell the two apart. A POTENTIAL_BREAKING result exits 0, so a CI gate that stops on it must read the classification.

The diff engine performs deep comparison of referenced OpenAPI specs, detecting changes at the path, method, parameter, request body and response level. The optional docs/ directory is ignored: documentation changes produce no diff entries and leave the compatibility classification unchanged.

When both bundles include an sbom/ directory with recognized SBOM files (.spdx.json or .cdx.json), pacto diff reports package-level changes: added, removed or modified packages (version and license). SBOM changes are informational and leave the overall classification and exit code unchanged.

When dependencies change between the old and new contracts (version upgrades, additions or removals), a dependency graph diff section is displayed showing the tree of affected nodes.

See Change Classification for the full rules.


pacto doc

Reads a pacto.yaml in the given directory (or oci:// reference) and generates structured Markdown documentation.

pacto doc [dir | oci://ref] [flags]

Examples:

  # Print documentation to stdout
  pacto doc my-service

  # Write documentation to a file
  pacto doc my-service -o docs/

  # Serve documentation in the browser
  pacto doc my-service --serve

  # Serve on a custom port
  pacto doc my-service --serve --port 9090

  # Launch an interactive API explorer (Swagger UI)
  pacto doc my-service --ui swagger

  # Select a specific interface
  pacto doc my-service --ui swagger --interface public-api

  # Point try-it-out requests to a running backend
  pacto doc my-service --ui swagger --target http://localhost:3000

  # Per-interface target mapping
  pacto doc my-service --ui swagger --target public-api=http://localhost:3000 --target admin-api=http://localhost:3001

Flags:

  -h, --help[=true|false]    help for doc
      --interface string     interface name to display (used with --ui)
  -o, --output string        output directory for generated Markdown; a NAME.html value writes a static documentation site to a NAME/ directory instead
      --port int             port for the documentation server (used with --serve or --ui) (default 8484)
      --serve[=true|false]   serve the offline dashboard-grade documentation site over a local HTTP server
      --set stringArray      set a contract value (e.g. --set service.version=2.0.0)
      --target stringArray   target server URL for try-it-out requests; supports interface=url mapping (used with --ui)
      --ui string            UI type for the interactive API explorer (one of: swagger)
  -f, --values stringArray   values file to merge into the contract (can be repeated; last wins)

The header line reports the contract's own state. pacto doc reads a bundle and observes no cluster. A contract that has never been runtime-evaluated therefore reads status NotEvaluated, and one that declares no workload reads compliance REFERENCE. Both are the expected result for a freshly scaffolded contract. See Compliance states.

Markdown prints to stdout by default. -o DIR writes DIR/<service>.md. -o NAME.html writes a self-contained static documentation site (a directory) that reuses the dashboard UI offline.

--serve serves that static site locally. --ui swagger launches an interactive API explorer.

--serve, --ui and -o are mutually exclusive. Use --interface to pick one OpenAPI interface with --ui. --target and --target iface=url point try-it-out at a backend.

Sibling dependencies are resolved in parallel. OCI bundles cache under ~/.cache/pacto/oci/. --no-cache bypasses the cache.


pacto evidence

Produce and verify the signed, versioned envelopes that carry a Pacto EvidenceSet from a remote or disconnected environment to a platform that ingests it. Keys are Ed25519; the wire format is defined by pkg/evidenceenvelope.

pacto evidence [flags]

Flags:

  -h, --help[=true|false]   help for evidence

pacto evidence keygen

Writes the private seed to <keyId>.key (base64, 0600) and the public key into --out. With --producer, the public key is written as <producer>__<keyId>.pub, which binds the key to that producer in the trust store. Hand that file to the platform. Sign with the SAME --producer and --key-id. With no --producer, a bare <keyId>.pub binds the key to a producer named after the key id (the single-producer default).

pacto evidence keygen [flags]

Flags:

      --force[=true|false]   overwrite existing key files instead of failing
  -h, --help[=true|false]    help for keygen
      --key-id string        key id (defaults to a fingerprint of the public key)
      --out string           directory to write the keypair into (default ".")
      --producer string      producer id to bind the key to (writes <producer>__<keyId>.pub)

pacto evidence provisioned

Writes an EvidenceSet that reports the provisioning state of the resource a consumer's configuration reference or dependency asked for. Sign it with pacto evidence sign and post it with pacto evidence send. Any adapter (a CI job, a controller, a script) can run it; Pacto keeps no provider-specific code. The subject defaults to <repository>//<kind>/<name>, so each resource keeps its own latest report. Prints the EvidenceSet JSON.

pacto evidence provisioned [flags]

Flags:

      --collector string       collector id recorded as provenance (defaults to pacto)
      --configuration string   consumer configuration (with a ref) that asked for the resource
      --contract string        consumer contract revision: oci://<repo>@sha256:<digest>
      --dependency string      consumer dependency that asked for the resource
      --environment string     consumer environment the resource serves
      --external-ref string    opaque handle of the resource at the provider (at most 253 printable bytes)
  -h, --help[=true|false]      help for provisioned
      --observed-at string     observation timestamp (RFC3339; defaults to now)
      --outcome string         collection outcome: Observed, Unsupported, Failed, Stale or Insufficient; anything but Observed carries no phase (default "Observed")
      --phase string           provisioning phase: Requested, Provisioning, Ready, Failed or Deleting
      --provider string        provider slug (lowercase letters, digits and hyphens)
      --subject string         EvidenceSet subject (defaults to <repository>/<environment or default>/<kind>/<name>)

pacto evidence send

Reads a signed envelope JSON file and POSTs it to an ingestion host's --url. Prints the host's JSON response and exits non-zero on a non-2xx status.

pacto evidence send <envelope.json> [flags]

Flags:

  -h, --help[=true|false]   help for send
      --url string          ingestion host envelope endpoint URL

pacto evidence serve

Starts an HTTP host that accepts signed evidence envelopes at POST /api/evidence/v1/envelopes, verifies them against --trust, evaluates the carried evidence against its resolved contract and publishes accepted records to the contract registry as OCI 1.1 referrers of the exact contract revision each report is about. Every --subject is an immutable oci://<repo>@sha256:<digest> reference; the registry is the only durable store, so the host keeps no local state and survives restarts. GET .../health is an always-200 liveness probe; .../ready reports 503 while a subject cannot be resolved or its referrers enumerated; .../producers advertises trusted producer ids; .../targets exposes the latest accepted targets. Registry credentials come from the same sources as pacto pull. Exactly one server may write to a subject set. Serves until interrupted.

pacto evidence serve [flags]

Flags:

      --cluster-id string            the kube-system namespace UID of the cluster this server runs in; the operator sets it
      --cluster-name string          display name of that cluster (needs --cluster-id)
      --cluster-name-source string   how the name was found: node-label, context, file or uid (needs --cluster-id)
  -h, --help[=true|false]            help for serve
      --listen-address string        host:port to listen on (supersedes --port)
      --port int                     port to listen on (127.0.0.1); superseded by --listen-address (default 8686)
      --producer stringArray         advertised trusted producer id (repeatable)
      --subject stringArray          exact contract revision evidence is stored on: oci://<repo>@sha256:<digest> (repeatable, required)
      --trust string                 trust store: a public-key file or a directory of <keyId>.pub files

pacto evidence sign

Reads an EvidenceSet JSON file (- reads stdin), wraps it in an Ed25519-signed envelope and prints the envelope JSON. Only --issued-at is non-deterministic (it defaults to now), so pinning it is enough to make re-signing the same evidence produce a byte-identical envelope.

pacto evidence sign <evidence.json> [flags]

Flags:

  -h, --help[=true|false]         help for sign
      --id string                 envelope id (defaults to a hash over the API version, producer id, sequence and evidence, so two producers reporting identical evidence never collide)
      --issued-at string          issued-at timestamp (RFC3339; defaults to now)
      --key string                path to the private key file
      --key-id string             producer key id (must match the trust-store entry)
      --producer string           producer id
      --producer-version string   producer version (optional)
      --sequence uint             producer-scoped monotonic sequence; each report must be strictly greater than the producer's last
      --ttl duration              validity window; 0 disables expiry (default 24h0m0s)

pacto evidence usage

Writes an EvidenceSet that reports how much of the resource a consumer's configuration reference or dependency asked for is used, and what it costs. Sign it with pacto evidence sign and post it with pacto evidence send; the signing key needs ResourceUsage in allowedObservationKinds. Pacto never sums or converts the figures. The subject defaults to <repository>//usage/<kind>/<name>, so a usage report never replaces the resource's provisioning report. Prints the EvidenceSet JSON.

pacto evidence usage [flags]

Flags:

      --collector string       collector id recorded as provenance (defaults to pacto)
      --configuration string   consumer configuration (with a ref) that asked for the resource
      --contract string        consumer contract revision: oci://<repo>@sha256:<digest>
      --cost string            cost as amount:CURRENCY:period, such as 212.40:USD:P30D (ISO 4217 code, ISO 8601 period from P1D to P1Y)
      --dependency string      consumer dependency that asked for the resource
      --environment string     consumer environment the resource serves
      --external-ref string    opaque handle of the resource at the provider (at most 253 printable bytes)
  -h, --help[=true|false]      help for usage
      --metric stringArray     a measured quantity as name=value[:unit], such as storage-used=31:Gi (repeatable, at most 16)
      --observed-at string     observation timestamp (RFC3339; defaults to now)
      --outcome string         collection outcome: Observed, Unsupported, Failed, Stale or Insufficient; anything but Observed carries no figures (default "Observed")
      --provider string        provider slug (lowercase letters, digits and hyphens)
      --subject string         EvidenceSet subject (defaults to <repository>/<environment or default>/usage/<kind>/<name>)

pacto evidence verify

Decodes an envelope and verifies its signature, freshness and trust against a --trust public-key file or directory of <keyId>.pub files. Exits non-zero when verification fails.

pacto evidence verify <envelope.json> [flags]

Flags:

  -h, --help[=true|false]   help for verify
      --trust string        trust store: a public-key file or a directory of <keyId>.pub files

pacto explain

Parses a pacto.yaml in the given directory (or oci:// reference) and produces a human-readable summary of the service contract. Each configuration lists its effective values per environment: its inline values with that environment's file merged on top. With two or more environments it also lists the values they disagree on, for every environment or the ones --environments names. Last it lists what Pacto inferred from the service's folder, apart from the contract, each value with its source and the YAML that would declare it.

pacto explain [dir | oci://ref] [flags]

Examples:

  pacto explain my-service
  pacto explain oci://ghcr.io/acme/orders@sha256:<digest> --output-format json
  pacto explain my-service --environments test,production

Flags:

      --environments strings   compare the effective configuration values of two or more environments, such as test,production
  -h, --help[=true|false]      help for explain
      --set stringArray        set a contract value (e.g. --set service.version=2.0.0)
  -f, --values stringArray     values file to merge into the contract (can be repeated; last wins)

What it covers. The text output summarises identity, workload, state, capabilities, interfaces, dependencies and readiness. To read configurations and policies, use pacto doc or open pacto.yaml. metadata is carried by --output-format json only; the text output omits it.

Readiness output. When the contract declares a readiness section (a pactoVersion: "2.0" feature), explain adds a Readiness block: the derived Score, the Gate result (PASS/FAIL with score / minScore), Earned and Total Weight, the partial credit multiplier, the assessment expires date with countdown (or an Expired state) and a per-check table showing each check's declared status (done/partial/not-done/deferred), category, weight, earned weight and evidence. The Readiness block also includes a revision-history table when history[] is present. --output-format json includes the same data plus doneCount, partialCount, notDoneCount, deferredCount and expired (boolean). Readiness status is time-dependent: the score is 0 when the current date is past the assessment-level expires.


pacto export

Write what Pacto knows in another tool's format

pacto export [flags]

Flags:

  -h, --help[=true|false]   help for export

pacto export backstage

Write the services Pacto knows as one multi-document YAML file of Backstage catalog entities: a Component per service, an API per interface, a Resource per external system, a System per business domain and a stub Component, tagged pacto-observed, per observed caller with no contract. Every entity says how Pacto knows it (pacto.trianalab.io/provenance), when (as-of) and how completely (completeness); an inferred value never fills spec.owner, spec.system, spec.dependsOn or spec.consumesApis.

The export reads the same sources as pacto fleet, except that it scans no local directory unless --local is set. When a source could not be read, or the fleet is empty, it writes nothing and exits 2, so a scheduled sync never drops the services that source holds; --allow-partial writes the file anyway. A --namespace scope whose namespaces were all read is not a failure: the file is written and each entity says partial.

pacto export backstage [flags]

Examples:

  pacto export backstage --oci ghcr.io/acme/payments --oci ghcr.io/acme/ledger > catalog/pacto-entities.yaml
  pacto export backstage --root oci://ghcr.io/acme/platform --k8s -o catalog/pacto-entities.yaml

Flags:

      --allow-partial[=true|false]    write the file even when the fleet is partial or empty
      --cache[=true|false]            include every bundle in the local OCI cache as an offline baseline revision
      --context stringArray           kubeconfig context to read live Pacto CRs from, like --k8s for the current one; repeatable, each cluster read once
      --delivery-trust string         the trust config target snapshots are verified with: a YAML file with a key scoped to each cluster (default $PACTO_DELIVERY_TRUST)
      --detected string               add what the operator detected as inferred rows: k8s:<namespace>/<name> of its <release>-detected ConfigMap, or a file holding the same JSON
      --evidence-url stringArray      base URL of an Evidence Server to consume its read-only operational-graph contribution over HTTP (repeatable)
      --external-catalog string       organization external catalog to merge over the default, as oci://REPOSITORY@sha256:DIGEST, else PACTO_EXTERNAL_CATALOG; a tag is refused
      --fingerprints string           a file (YAML or JSON) of the workload managers and promoters this installation runs, as the chart's fingerprints value: each promoter found reads promotion owned by <product> in the detected providers
      --freshness duration            mark target evidence older than this as stale (the dashboard's window; 0 skips the check and every answer says so) (default 24h0m0s)
  -h, --help[=true|false]             help for backstage
      --index string                  organization index pacto impact and pacto ci read consumers from, as <registry>/pacto-index with no tag or digest (default <registry>/pacto-index from the provider reference; none reads none; skipped when --root names the consumers; pacto ci --publish also writes its entries there; other fleet commands ignore it)
      --k8s[=true|false]              include live Pacto CRs from the current Kubernetes cluster as targets
      --local stringArray             local bundle root(s) to scan (repeatable; none unless set)
      --mira-source stringArray       base URL of a Mira node whose service map supplies observed calls between services (repeatable)
      --namespace string              namespaces to read Pacto CRs from with --k8s, comma-separated (empty = all namespaces)
      --oci stringArray               registry reference to include as a published-baseline revision (repeatable)
  -o, --output string                 write the entities to this file instead of standard output
      --root stringArray              contract root whose whole dependency closure joins the snapshot: a local bundle path or an oci:// reference (repeatable)
      --target-snapshot stringArray   signed target snapshot(s) to read targets from: an oci:// pacto-targets repository, or :cluster-<uid> tags or digests to pin the clusters CI expects (repeatable); pacto impact, pacto ci and pacto_impact on a stdio pacto mcp also take auto (the default: derived from the provider ref) and off
      --target-state stringArray      offline target-state fixture file(s) supplying targets, for demos and tests; production targets arrive as signed EvidenceSets (repeatable)
      --traces stringArray            OTLP/JSON trace file supplying runtime-observed dependency edges, folded into the snapshot as observed relationships (repeatable)

pacto fleet

Compose contracts, contract revisions and operational targets from local bundles and ingested evidence into a versioned, navigable graph, then search, inspect, traverse and explain it. Every answer reports its as-of time and completeness.

pacto fleet [flags]

Flags:

      --cache[=true|false]            include every bundle in the local OCI cache as an offline baseline revision
      --context stringArray           kubeconfig context to read live Pacto CRs from, like --k8s for the current one; repeatable, each cluster read once
      --delivery-trust string         the trust config target snapshots are verified with: a YAML file with a key scoped to each cluster (default $PACTO_DELIVERY_TRUST)
      --detected string               add what the operator detected as inferred rows: k8s:<namespace>/<name> of its <release>-detected ConfigMap, or a file holding the same JSON
      --evidence-url stringArray      base URL of an Evidence Server to consume its read-only operational-graph contribution over HTTP (repeatable)
      --external-catalog string       organization external catalog to merge over the default, as oci://REPOSITORY@sha256:DIGEST, else PACTO_EXTERNAL_CATALOG; a tag is refused
      --fingerprints string           a file (YAML or JSON) of the workload managers and promoters this installation runs, as the chart's fingerprints value: each promoter found reads promotion owned by <product> in the detected providers
      --freshness duration            mark target evidence older than this as stale (the dashboard's window; 0 skips the check and every answer says so) (default 24h0m0s)
  -h, --help[=true|false]             help for fleet
      --index string                  organization index pacto impact and pacto ci read consumers from, as <registry>/pacto-index with no tag or digest (default <registry>/pacto-index from the provider reference; none reads none; skipped when --root names the consumers; pacto ci --publish also writes its entries there; other fleet commands ignore it)
      --k8s[=true|false]              include live Pacto CRs from the current Kubernetes cluster as targets
      --local stringArray             local bundle root(s) to scan (repeatable) (default [.])
      --mira-source stringArray       base URL of a Mira node whose service map supplies observed calls between services (repeatable)
      --namespace string              namespaces to read Pacto CRs from with --k8s, comma-separated (empty = all namespaces)
      --oci stringArray               registry reference to include as a published-baseline revision (repeatable)
      --root stringArray              contract root whose whole dependency closure joins the snapshot: a local bundle path or an oci:// reference (repeatable)
      --target-snapshot stringArray   signed target snapshot(s) to read targets from: an oci:// pacto-targets repository, or :cluster-<uid> tags or digests to pin the clusters CI expects (repeatable); pacto impact, pacto ci and pacto_impact on a stdio pacto mcp also take auto (the default: derived from the provider ref) and off
      --target-state stringArray      offline target-state fixture file(s) supplying targets, for demos and tests; production targets arrive as signed EvidenceSets (repeatable)
      --traces stringArray            OTLP/JSON trace file supplying runtime-observed dependency edges, folded into the snapshot as observed relationships (repeatable)

pacto fleet attention

Lists what needs attention, most severe first, each item with its reason and next step. --category undeclared lists runtime calls no contract declares and callers with no contract. --category lifecycle lists services that use a deprecated or past-sunset provider, or whose range refuses its successor.

pacto fleet attention [flags]

Flags:

      --business-domain string    exact business domain, (none) for none or (unknown) for unknown
      --category string           attention category
  -h, --help[=true|false]         help for attention
      --key string                items about the entity with this exact key
      --kind string               items about entities of this kind (service, revision, target, owner, source, domain, offering, external)
      --limit int                 maximum results (0 = 200, capped at 500)
      --offset int                result offset for paging
      --owner string              free-text owner search over team, DRI and contacts
      --owner-key string          exact owner key, such as team:platform or dri:alice
      --service string            items of this service: its key, or a name only one domain uses
      --severity string           attention severity (error, warning, info)
      --source string             items a fleet source reported, by source key
      --stale-only[=true|false]   only the items about stale evidence
      --status string             items about entities with this canonical compliance status

pacto fleet entities

Lists services, owners, business domains and platform offerings, paged, or the one --kind you name. A filter that applies to one kind only (--readiness, --scope, --source-kind, --source-health) lists that kind when --kind is empty. Use --kind owner to learn the owner keys (team:NAME, dri:NAME) that --owner-key takes.

pacto fleet entities [text] [flags]

Flags:

      --business-domain string           exact business domain, (none) for none or (unknown) for unknown
      --capability string                services whose revisions declare this capability key, such as health or acme.io/cost
      --class string                     with --kind external, external systems of this class (vendor-api, managed-cloud, legacy, unclassified, other-egress)
      --cluster string                   entities in this cluster, by its UID as meta.clusters lists it: targets, services with a target or an inferred workload there and revisions a target there runs; other kinds ignore it
      --consumes string                  services that depend on or reference a provider of this platform offering
      --created-from string              services created from this golden path, by key; (none) for no declared origin or (unresolved) for an origin that resolves to no golden path
      --declaration string               inferred keeps only the services Pacto infers from workloads no contract describes; declared leaves them out
      --domain string                    exact registry path, the domain part of a service key
      --environment string               with --kind target, targets in this environment (the delivery.pacto.trianalab.io/environment label); with --consumes and --phase, only the consumers whose status in that phase is in this environment
      --failed[=true|false]              with --kind offering, offerings with at least one failed provisioning request
      --gap string                       services whose contracts leave this out (no-summary, no-domain, no-interface-docs, no-readiness, not-deployed, unverified-capability), or unknown for those Pacto cannot judge
      --group string                     inferred services the cluster groups under this key (rule/namespace/name: workload.group.key in pacto fleet entity --output-format json)
      --has-non-compliant[=true|false]   owners and domains with at least one non-compliant service only
  -h, --help[=true|false]                help for entities
      --kind string                      entity kind (service, revision, target, owner, source, domain, offering, external; empty lists services, owners, domains and offerings)
      --lifecycle string                 offerings whose worst provider lifecycle (each provider's newest revision a target runs, else its newest readable one), or services whose newest revision, is deprecated or sunset
      --limit int                        maximum results (0 = 100, capped at 500)
      --offering string                  services that provide this platform offering, and the offering itself
      --offset int                       result offset for paging
      --owner string                     free-text owner search over team, DRI and contacts
      --owner-key string                 exact owner key, such as team:platform or dri:alice
      --ownership string                 how ownership is declared on a service (consistent, conflicting, unowned, unknown or unidentified; conflicting means owners disagree: targets run different owners, or one version declares two; unknown is a service whose contract Pacto cannot read, unidentified every service with no single canonical owner)
      --phase string                     with --consumes: only the consumers with a provisioning status of that offering in this phase
      --readiness string                 revisions by declared readiness (passing, below-threshold, expired, not-declared)
      --scope string                     targets in this scope, such as a namespace
      --service string                   this service and its revisions and targets, by service key
      --sort string                      order: name, health (least healthy first; owners and domains by non-compliant, failing, unknown, stale and gap services), services (owners with the most services first), nonCompliant (owners and domains with the most non-compliant services first), rate (owners and domains with the highest share of non-compliant services first), created (golden paths that created the most services first), failed (offerings with the most consumers with a failed provisioning request first), consumers (offerings with the most declared consumers first) or gaps (owners and domains with the most services that leave knowledge out first)
      --source string                    entities read from this fleet source, by source key
      --source-health string             sources by health (available, partial, stale, unavailable, or incomplete for any of the last three)
      --source-kind string               sources of this exact kind only (oci, kubernetes, evidence-http, ...)
      --status string                    canonical compliance status
      --template string[="only"]         golden paths only, or exclude to leave them out

pacto fleet entity

Inspect one entity. For a service, --reached also reads, with your cluster credentials, when each change's revision first reached each Stage you may read, from delivery history. A --local fleet keys revisions by content, so their changes match no delivery record.

pacto fleet entity <kind> <key> [flags]

Flags:

  -h, --help[=true|false]      help for entity
      --reached[=true|false]   read when each change reached a Stage from signed delivery records, with your cluster credentials
      --trust string           with --reached: the trust config delivery records are verified with (default $PACTO_DELIVERY_TRUST)

pacto fleet explain

Explain the deterministic reasons for a service or target state. Give external:<identity> to list the sources that declare an external system and the catalog entry that classified it.

pacto fleet explain <subject> [flags]

Flags:

  -h, --help[=true|false]   help for explain

pacto fleet get

Inspect a logical service by name, an external system by external:<identity> (a vendor, managed service or legacy host no Pacto contract describes) or an operational target with --target.

pacto fleet get [service] [flags]

Flags:

  -h, --help[=true|false]   help for get
      --target string       inspect an operational target by key or name

pacto fleet graph

Traverse the operational graph from an explicit root. Give a service name to aggregate across its revisions, or --revision/--target to root an exact revision (never 'latest'). The walk also follows observed runtime calls, so services no contract connects appear too; each node reports its provenance (declared, observed or declared+observed, or inferred for an external system's consumer known only from its configuration or a runtime call one of whose ends no contract describes). Those inferred calls are listed after the nodes with the sources that saw them, and a service asked for by the key of an inferred service it replaced says so first. Give external:<identity> to list the consumers of an external system (its only direction is dependents).

pacto fleet graph <service> [flags]

Flags:

      --direction string          traversal direction (dependencies, dependents); unset means dependencies, or dependents for an external: root
  -h, --help[=true|false]         help for graph
      --max-depth int             maximum transitive depth (0 = unlimited)
      --revision string           root an exact contract revision key
      --target string             root the revision linked to this target key or name
      --transitive[=true|false]   traverse transitively (cycle-safe)

pacto fleet neighborhood

Shows who a service depends on and who depends on it, to the requested depth, each with its owner and status, then the edges between them: each says whether a contract declares it, telemetry observed it or both, and how the two compare. A runtime call one of whose ends no contract describes is listed as inferred, with the sources that saw it, and never satisfies a dependency. The service is a name, or its key when the name is used in more than one domain.

pacto fleet neighborhood <service> [flags]

Flags:

      --depth int           how many hops to walk (0 = 1, at most 6)
      --direction string    which side to walk (dependencies, dependents, both) (default "both")
  -h, --help[=true|false]   help for neighborhood
      --max-edges int       maximum edges (0 = 120, at most 1000)
      --max-nodes int       maximum services (0 = 60, at most 500)
      --views string        comma-separated knowledge views (expected, observed, differences) (default "expected,observed")

pacto fleet overview

Summarizes the organization in one answer: target compliance (with how many compliant targets rest on stale evidence), operational health, the knowledge gaps the contracts leave, ownership, evaluation coverage, the business domains and where to look next. A target is failing when its own health check reports it is not healthy and unknown when Pacto cannot tell; unknown is never a pass.

pacto fleet overview [flags]

Flags:

  -h, --help[=true|false]   help for overview

pacto fleet providers

Lists what Pacto detected in each source it read: the evidence it found, what it uses each provider for and its status, with the limitations that make a row partial. A Kubernetes source Pacto could not read is listed as not read, never as nothing detected.

pacto fleet providers [flags]

Flags:

  -h, --help[=true|false]   help for providers

pacto fleet publish-inferred

Builds the fleet snapshot from the source flags and, for every external system it knows with at least one consumer, publishes an inferred contract to <registry>/pacto-inferred/<identity>: a pacto.yaml naming the external and a pacto.inferred.yaml listing the hosts, ports and client majors the fleet sees, each with the sources that saw it. A new 0.0.<n> tag is pushed only when that surface changed, annotated run.pacto.contract.provenance: inferred and signed with --key. It names no consumer, and a range is never checked against it.

Clusters publish from the operator once the chart's registry value is set. This command is for installations that run no operator, such as the Compose demo; never run it against a registry an operator already writes.

--key takes a PEM private key or a pacto evidence keygen seed. Readers recognise its signature as the operator's only when their --detected advertisement names its public key; otherwise they say the signature could not be checked.

pacto fleet publish-inferred [flags]

Flags:

  -h, --help[=true|false]   help for publish-inferred
      --key string          the installation signing key: a PEM private key or a seed that pacto evidence keygen wrote
      --registry string     registry host and path the installation repositories live under, as <registry>/pacto-inferred/<identity>

pacto fleet reconcile

Reconciles what the fleet's contracts declare against what runtime traces prove. Reports matched dependencies, declared-but-not-observed (dormant or unseen in the trace window, so possibly still in use) and observed-but-not-declared (shadow dependencies).

pacto fleet reconcile [flags]

Examples:

  pacto fleet reconcile --traces traces.json --local .

Flags:

  -h, --help[=true|false]   help for reconcile
      --traces string       OTLP/JSON trace file supplying observed dependencies (required)

Search logical services in the fleet. A search on text alone, first page, also lists up to 20 external systems whose identity, label or alias holds the text; any other filter or --offset lists none.

pacto fleet search [text] [flags]

Flags:

      --business-domain string        filter by business domain, (none) for none or (unknown) for unknown
      --compliance string             filter to services with a target of this compliance
      --declaration string            inferred keeps only the services Pacto infers from workloads no contract describes; declared leaves them out
      --has-capability[=true|false]   only services declaring a capability
      --has-dependency[=true|false]   only services declaring a dependency
  -h, --help[=true|false]             help for search
      --label stringArray             filter by label key=value (repeatable)
      --limit int                     maximum results (0 = 100, capped at 500)
      --not-ready[=true|false]        only services whose readiness gate does not pass (below minScore, expired or undeclared)
      --offering string               filter by the platform offering a service provides (service.offering)
      --offset int                    result offset for paging
      --owner string                  filter by owner (team, DRI or contact)
      --ready[=true|false]            only services whose readiness gate passes (score >= minScore, not expired)
      --scope string                  correlate to a target with this scope
      --source string                 filter by observing source
      --status string                 filter by aggregate status (Compliant, Invalid, NonCompliant, NotEvaluated, Reference, Unknown, Warning)
      --template string[="only"]      golden paths only, or exclude to leave them out
      --workload string               filter by workload (service, job, scheduled)

pacto fleet snapshot

Emit the whole fleet snapshot

pacto fleet snapshot [flags]

Flags:

  -h, --help[=true|false]   help for snapshot

pacto fleet status

Reports what needs attention: non-compliant, unknown, invalid and stale targets, revisions without readiness, unresolved dependencies, dependencies whose provider version is outside the declared range, services that use a deprecated or past-sunset provider, services with no declared owner and undeclared runtime dependencies. With no category flag it reports every category.

pacto fleet status [flags]

Flags:

      --golden-path-deployed[=true|false]   report running services that declare service.template (GOLDEN_PATH_DEPLOYED)
  -h, --help[=true|false]                   help for status
      --invalid[=true|false]                report structurally invalid contracts
      --lifecycle[=true|false]              report services that use a deprecated or past-sunset provider (DEPENDENCY_SERVICE_DEPRECATED, DEPENDENCY_SERVICE_SUNSET, SUCCESSOR_OUT_OF_RANGE)
      --limit int                           maximum results (0 = 200)
      --missing-readiness[=true|false]      report revisions without a readiness assessment
      --needs-attention[=true|false]        report every attention category
      --non-compliant[=true|false]          report non-compliant targets
      --stale[=true|false]                  report targets with stale evidence
      --stats-file string                   also write the coverage run record to this file, for pacto stats publish in another job; never read from PACTO_STATS_FILE
      --stats-registry string               also write a coverage run record of the whole fleet to this stats repository (unsigned statistics; none with --namespace); never read from PACTO_STATS_REGISTRY
      --undeclared[=true|false]             report runtime calls no contract declares and callers with no contract
      --unknown[=true|false]                report targets with unknown compliance
      --unowned[=true|false]                report services with no declared owner
      --unresolved-deps[=true|false]        report unresolved declared dependencies
      --unsatisfied-ranges[=true|false]     report dependencies whose provider version is outside the declared range (DEPENDENCY_RANGE_UNSATISFIED)

pacto fleet versions

Lists each provider's versions of a platform offering, newest first, with whether a target runs each one and the service lifecycle it declares. With --range, each version shows whether it satisfies the range and each provider names its latest compatible version. The list comes from the contract revisions the snapshot holds; the registry may publish others.

pacto fleet versions <offering> [flags]

Flags:

  -h, --help[=true|false]   help for versions
      --provider string     only this provider: its key, or a name only one domain uses
      --range string        semver range to check each version against, such as ^16.0.0

pacto generate

Invokes a pacto-plugin-<name> binary to generate deployment manifests, documentation or other artifacts from a contract directory or oci:// reference.

pacto generate <plugin> [dir | oci://ref] [flags]

Examples:

  pacto generate schema-infer my-service --option file=config.yaml -o out/

Flags:

  -h, --help[=true|false]    help for generate
      --option stringArray   plugin option as key=value (can be repeated)
  -o, --output string        output directory (default: <plugin>-output/)
      --set stringArray      set a contract value (e.g. --set service.version=2.0.0)
  -f, --values stringArray   values file to merge into the contract (can be repeated; last wins)

pacto generate <plugin> invokes the pacto-plugin-<plugin> binary. See Plugins for plugin discovery, the plugin registry and the official plugins bundled with Pacto.


pacto graph

Resolves the dependency tree from a pacto.yaml in the given directory (or oci:// reference) and displays the graph, cycles and version conflicts.

pacto graph [dir | oci://ref] [flags]

Examples:

  pacto graph my-service
  pacto graph --with-references
  pacto graph --only-references

Flags:

  -h, --help[=true|false]              help for graph
      --only-references[=true|false]   Show only config/policy reference edges (no dependencies)
      --set stringArray                set a contract value (e.g. --set service.version=2.0.0)
  -f, --values stringArray             values file to merge into the contract (can be repeated; last wins)
      --with-references[=true|false]   Include config/policy reference edges alongside dependencies

Dependencies resolved from local paths are annotated with [local]. Shared dependencies (referenced by multiple parents) are annotated with (shared).

Reports cycles, version conflicts and unreachable dependencies.

Sibling dependencies are resolved in parallel. OCI bundles are cached locally in ~/.cache/pacto/oci/ for faster subsequent operations. Use --no-cache to bypass the cache.


pacto impact

Composes a semantic contract diff (old→new) with the operational graph to answer which consumers a change really affects, how strong the evidence is and whether their declared compatibility still holds.

When no fleet source holds the changed service, the new revision is added to the snapshot so the services that depend on it are found.

With --running, impact judges <new> against the revisions of its service that run on known targets instead of an <old> revision, and keeps the worst gate. A running consumer whose range rejects <new> blocks it whatever the classification, and a partial answer never clears. A local <new> takes the fleet domain that holds its service name; a name several domains hold exits 1 with their keys (judge the oci:// reference instead). With no running revision the new one is a first version: it is blocked when a running consumer's range rejects it, and clear only on a complete answer whose running consumers all accept it. A running revision Pacto could not link, pull or trust, one linked by tag only, an inferred workload of the service, a workload source Pacto could not read and a local <new> in no fleet domain each make the answer unverified at best. Running revisions are pulled only from the hosts of the target snapshots and of an oci:// <new>, plus the comma-separated hosts in $PACTO_RUNNING_REGISTRIES.

With --unavailable, --removed or --regressed, impact answers what happens if that service becomes unavailable, is removed or a revision of it regressed. --unavailable and --removed also take offering:<name>, which asks the same of every service that provides the platform offering. Consumers are graded breaks (every edge on their path is required), may degrade (an optional edge) or unknown. The gate is unverified (exit 2) when anything depends on the service and clear (exit 0) only when the complete snapshot shows nothing does. --regressed with an artifact digest reads delivery's recorded failures with your own cluster credentials when a cluster is reachable.

The answer ends in a release gate, and the exit status follows it: 0 clear: the change is not BREAKING and every service that references its policy passes the new policy, or the snapshot is complete and no service depends on the changed one. 1 blocked: a consumer that runs on a known target does not accept the new version of a BREAKING change, or its contract fails the changed service's new policy, whatever the classification. 2 unverified: nothing is shown to block the change, but the answer cannot clear it: a BREAKING change whose answer is partial or whose consumers none is shown to be safe, or a service that references the changed policy and fails it running nowhere known, could not be checked or could not be resolved. A run over --local bundles alone knows no targets, so a BREAKING change with consumers exits 2. A command that could not run also exits 1, with nothing on stdout. Add --target-state (or a live source) so the gate can tell deployed impact apart.

Pacto finds consumers only in the sources you pass, such as --local, --root, --oci, --cache, --k8s, --evidence-url, --traces and the target snapshot. With --local alone Pacto sees only the contracts in those folders, so "No affected consumers" is not evidence of safety.

When you pass no --k8s, --target-state, --evidence-url or --target-snapshot, impact reads the signed target snapshot each cluster's operator publishes (--target-snapshot auto, the default): from the oci:// ref of the change it tries <prefix>/pacto-targets under each path prefix of its repository, deepest first and at most three segments deep (the registry value the operator publishes under), then <host>/pacto-targets, and prints a Registry line saying where it looked and a Targets line per cluster snapshot it read. auto reads only the clusters whose snapshot exists at that moment, so CI that knows its clusters pins them with --target-snapshot oci://<registry>/pacto-targets:cluster-<uid> (repeatable). --delivery-trust names the trust config that verifies each snapshot; an unverified or stale snapshot never clears a BREAKING change. --target-snapshot off reads none.

From the same ref impact also reads the consumers published to the organization index, <host>//pacto-index then <host>/pacto-index, checks them against the target snapshot it reads and prints a Consumers line; --index names another <registry>/pacto-index, --index none reads none, a --root list skips it and a pair of --local folders reads no index.

pacto impact <old> <new> | --running <new> | --unavailable <service> | --removed <service> | --regressed <service>@<revision> [flags]

Examples:

  # Impact of upgrading a local service against the local fleet
  pacto impact ./svc-v1 ./svc-v2 --local .

  # Impact of a published service against the clusters that run it, read
  # from the target snapshot next to its registry
  pacto impact oci://ghcr.io/acme/svc:1.0.0 ./svc --delivery-trust trust.yaml

  # Judge a folder's contract against the revisions that run in the pinned
  # clusters, as a GitOps render gate does
  pacto impact --running . --target-snapshot oci://ghcr.io/acme/pacto-targets:cluster-<uid> --delivery-trust trust.yaml

  # Include observed (runtime) evidence and emit JSON
  pacto impact oci://ghcr.io/acme/svc:1.0.0 ./svc --include-observed --output-format json

  # What breaks if redis becomes unavailable, or postgresql is removed
  pacto impact --unavailable redis --local .
  pacto impact --removed postgresql --local . --target-state targets.yaml

  # What breaks if every provider of the postgresql offering becomes unavailable
  pacto impact --unavailable offering:postgresql --local .

  # What a regressed artifact affects, with delivery's recorded failures
  pacto impact --regressed payments-service@sha256:<digest> --local .

Flags:

      --cache[=true|false]              include every bundle in the local OCI cache as an offline baseline revision
      --context stringArray             kubeconfig context to read live Pacto CRs from, like --k8s for the current one; repeatable, each cluster read once
      --delivery-trust string           the trust config target snapshots are verified with: a YAML file with a key scoped to each cluster (default $PACTO_DELIVERY_TRUST)
      --detected string                 add what the operator detected as inferred rows: k8s:<namespace>/<name> of its <release>-detected ConfigMap, or a file holding the same JSON
      --evidence-url stringArray        base URL of an Evidence Server to consume its read-only operational-graph contribution over HTTP (repeatable)
      --external-catalog string         organization external catalog to merge over the default, as oci://REPOSITORY@sha256:DIGEST, else PACTO_EXTERNAL_CATALOG; a tag is refused
      --fingerprints string             a file (YAML or JSON) of the workload managers and promoters this installation runs, as the chart's fingerprints value: each promoter found reads promotion owned by <product> in the detected providers
      --freshness duration              mark target evidence older than this as stale (the dashboard's window; 0 skips the check and every answer says so) (default 24h0m0s)
  -h, --help[=true|false]               help for impact
      --include-observed[=true|false]   let observed (runtime) relationships raise consumer confidence
      --index string                    organization index pacto impact and pacto ci read consumers from, as <registry>/pacto-index with no tag or digest (default <registry>/pacto-index from the provider reference; none reads none; skipped when --root names the consumers; pacto ci --publish also writes its entries there; other fleet commands ignore it)
      --k8s[=true|false]                include live Pacto CRs from the current Kubernetes cluster as targets
      --local stringArray               local bundle root(s) to scan (repeatable) (default [.])
      --mira-source stringArray         base URL of a Mira node whose service map supplies observed calls between services (repeatable)
      --namespace string                namespaces to read Pacto CRs from with --k8s, comma-separated (empty = all namespaces)
      --new-set stringArray             set a value on the new contract (e.g. --new-set service.version=2.0.0)
      --new-values stringArray          values file to merge into the new contract (can be repeated)
      --oci stringArray                 registry reference to include as a published-baseline revision (repeatable)
      --old-set stringArray             set a value on the old contract (e.g. --old-set service.version=1.0.0)
      --old-values stringArray          values file to merge into the old contract (can be repeated)
      --policy stringArray              range policy for a BREAKING change, repeatable: unknown-range=warn|fail and uncontracted=warn|fail:<window> (such as fail:7d); default warn
      --regressed string                what happens if <service>@<revision> regressed; an artifact digest reads delivery's recorded failures
      --removed string                  what happens if this service (a fleet service key, or a name only one domain holds) is removed; offering:<name> asks it of every provider of an offering
      --root stringArray                contract root whose whole dependency closure joins the snapshot: a local bundle path or an oci:// reference (repeatable)
      --running[=true|false]            judge <new> against the revisions of its service that run on known targets instead of an <old> revision; a running revision with the new digest is not a baseline; with no running revision only consumers' ranges are checked
      --stats-context string            comma-separated context to include in the run record: repository, run-url, environment=<name>; nothing is included unless named
      --stats-file string               write the run record to this file for pacto stats publish, replacing the record it holds, so give each command its own file; default $PACTO_STATS_FILE
      --stats-registry string           publish an unsigned run record (statistics, never evidence) to this repository, for example ghcr.io/acme/pacto-stats; default $PACTO_STATS_REGISTRY
      --target-snapshot stringArray     signed target snapshot(s) to read targets from: an oci:// pacto-targets repository, or :cluster-<uid> tags or digests to pin the clusters CI expects (repeatable); pacto impact, pacto ci and pacto_impact on a stdio pacto mcp also take auto (the default: derived from the provider ref) and off
      --target-state stringArray        offline target-state fixture file(s) supplying targets, for demos and tests; production targets arrive as signed EvidenceSets (repeatable)
      --traces string                   OTLP/JSON trace file; its observed edges corroborate and surface consumers (implies --include-observed)
      --unavailable string              what happens if this service (a fleet service key, or a name only one domain holds) becomes unavailable; offering:<name> asks it of every provider of an offering

pacto init

Writes the contract for the service in dir (default: the current folder).

An empty or new folder gets a blank contract with the bundle structure (interfaces/, configuration/) and the owner and domain you pass; with no --owner the owner is a commented placeholder that Unknown names. A folder that already holds a service gets a contract read from its Dockerfile and Kubernetes manifests, and a list of what Pacto found and what it could not tell (Unknown). The workload's environment, including the ConfigMaps it reads, becomes a configuration schema of keys and types, with no values: a key read from a Secret, named like a password, secret, token, key, credential, private key or DSN, or holding a URL with credentials is marked writeOnly, and a literal value for one is named under next steps. A URL in the environment that names another service in the cluster becomes a dependency with compatibility unknown: with that service's contract in --fleet, its bundle and a proposed range from its version in a comment; without it, the comment says no range was proposed. Vendors, managed services and legacy hosts that the folder names (the environment, Helm values files, Compose, Kustomize generators, SDK manifests and lockfiles, Terraform resources and Crossplane objects) are classified with the external catalog and listed under External dependencies as inferred: they go in pacto.inferred.yaml, never in pacto.yaml. --external-catalog merges an organization catalog, pinned by digest, over the default. Only their host and port are shown; a Secret gives its name and key names, never a value. A readiness, liveness or startup probe becomes a health check. A folder that already holds pacto.yaml at pactoVersion 2.5 (or none) is completed, never with --cluster: Pacto never changes it and lists what the folder adds, which pacto pack and pacto publish put in pacto.inferred.yaml. An older pacto.yaml is not completed, and the plan says to raise its pactoVersion.

Neither contract has a publish section or a service.version: pacto ci --publish derives both, and the image tag is named under Found as the version to declare for a first publish. --describe-only changes only the next steps, which say how to validate the contract instead of how to publish it. --delivery also writes the cluster pieces, reading the repositories pacto ci --publish publishes to under --registry (default: the workload's image registry, else the registry.example placeholder): the Pacto resource that checks the running service, and per environment a Stage with the Flux OCIRepository and Kustomization it applies through. Each Stage verifies an identity that matches nothing until you set the one pacto ci --publish signs as. Each Stage starts at observe: it plans every new version and moves nothing, and the OCIRepository stays pinned to the tag you deploy, so GitOps keeps applying what it did. The last environment's Stage also asks a person to approve every promote.

--owner is the team's bare name, such as billing: usually the team label on the workload. --domain is the business domain, such as payments. An AI agent is a service too: its tools are an mcp interface, the model it calls is a dependency and its eval suite is a checks entry; see https://pacto.run/latest/contract-reference/checks/#an-agent-is-a-service.

Several folders are each pactified, with a summary at the end. --cluster drafts a contract for every workload in the namespaces that no Pacto describes yet, in <out>/<namespace>/<name>: its manifests are read from the cluster, and the services its pods were seen calling become dependencies with compatibility unknown and a proposed range, in a comment, from the lowest version the Pactos describing each one report, when they agree on one contract. Ranges are proposed, never declared: declare each one. Each draft also gets pacto.inferred.yaml, completed by the engine pacto ci uses, with when each cluster fact was read and whether every node was observed. --max-items bounds each kind of object read; a kind cut short is listed under Coverage, and a run it stopped while listing workloads prints the command that resumes with --continue. Drafts are only written, never published, and a draft that is not valid fails the command.

With --from the service is created from a golden path: an oci:// reference or a directory whose contract declares service.template. The path's contract is copied with its identity reset: the name, version 0.1.0, --owner (required) and --domain, with --values and --set applied over any field and service.origin recording the path it came from. A path read from a registry is pulled by digest; when the trust config (--trust, else $PACTO_DELIVERY_TRUST) names a template key, the path must be signed by one or nothing is created, and otherwise the signature is reported Unknown. The created contract is validated with its references resolved before anything is written, and the Status block says what was checked and what Pacto cannot tell yet. Each plugin the path names is listed with the binary it resolves to; only the ones you name with --run-plugins run, never with --plan, and the files they return are added like the path's own. --delivery plans the cluster pieces from the created contract when the path publishes manifests under publish.deploy; otherwise the delivery step says why none were planned.

It only adds files and missing .pactoignore lines; any other file already there is yours and is left as it is, so running it twice is safe. --plan shows exactly what would be added and changes nothing.

pacto init [dir...] [flags]

Examples:

  pacto init my-service
  pacto init my-service --owner billing --domain payments --registry ghcr.io/acme
  pacto init --plan
  pacto init --describe-only --owner billing
  pacto init --delivery --owner payments --fleet ../contracts
  pacto init --delivery --insecure-registry
  pacto init --delivery --registry-secret registry-creds
  pacto init services/checkout services/payments --plan
  pacto init --cluster --namespace shop --out drafts
  pacto init gift-cards --from oci://ghcr.io/acme/paths/http-service:1.0.0 --owner checkout --domain commerce

Flags:

      --call-window duration               with --cluster: how far back a call counts as a dependency (at least 1m, default 24h)
      --cluster[=true|false]               draft a contract for every workload in the cluster that no Pacto describes, reading the current kubeconfig context
      --continue string                    with --cluster: resume the read where a run --max-items stopped while listing workloads left off
      --delivery[=true|false]              also declares each --env in pacto.yaml with an empty values file, and writes the cluster pieces of a manifests deploy: the Pacto resource, a Stage per environment and a Flux OCIRepository and Kustomization; a chart deploy gets no applier object
      --describe-only[=true|false]         write a contract that only describes the service: its next steps say how to validate it, never how to publish it
      --domain string                      business domain, such as payments
      --env strings                        environments for --delivery: declared in the contract and given a Stage each, in promotion order (default [test,prod])
      --external-catalog string            organization external catalog to merge over the default, as oci://REPOSITORY@sha256:DIGEST; a tag is refused (also PACTO_EXTERNAL_CATALOG)
      --fleet strings                      folders of other services' contracts to find the services that use this one
      --from string                        a golden path to create the service from: an oci:// reference or a directory
  -h, --help[=true|false]                  help for init
      --insecure-registry[=true|false]     with --delivery: the Flux OCIRepositories read the registry over plain HTTP (a local registry only)
      --max-items int                      with --cluster: the most items read per kind of object; a kind cut short reads as partial (default 10000)
      --name string                        service name (default: the workload's name, then the folder's)
      --namespace strings                  with --cluster: a namespace to read; repeat it for more (default: every namespace)
      --no-transparency-log[=true|false]   with --from: write transparencyLog: false under the golden path's publish.sign
      --out string                         with --cluster: the folder the drafts go in, one <namespace>/<name> folder each
      --owner string                       the team that owns the service, as a bare name such as billing (default: the workload's team label)
      --plan[=true|false]                  show what would be added and change nothing
      --registry string                    where to publish, as host/path (default: read from the workload's image)
      --registry-secret string             with --delivery: the docker-registry Secret, in each environment's namespace, that Flux and the Pacto resource log in to a private registry with
      --run-plugins strings                run these plugins the golden path names, by name (see the plan's plugin steps); each step prints the binary it runs
      --set stringArray                    set a contract value (e.g. --set service.version=2.0.0)
      --trust string                       the trust config the golden path's signature is verified with: a PEM public key or a trust config file (default $PACTO_DELIVERY_TRUST)
  -f, --values stringArray                 values file to merge into the contract (can be repeated; last wins)

In an empty folder it scaffolds three files: a valid pacto.yaml, a placeholder OpenAPI spec at interfaces/openapi.yaml and a configuration JSON Schema at configuration/schema.json.

The folder's last part becomes service.name, which must match ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$, so pacto init fleet/checkout-web writes a contract for checkout-web in fleet/checkout-web. Pass --name to choose another name.

--owner becomes service.owner.team; without it the owner is a commented placeholder and Unknown names it. --domain becomes service.domain. The contract gets no publish section and no service.version: pacto ci --publish derives both and publishes to the registry its own --registry names.

All three files are required by the scaffolded contract, because its interfaces: and configurations: sections point at the other two files. If you delete a directory, also delete the section that references it, or validation fails with FILE_NOT_FOUND. A contract that declares neither section needs only pacto.yaml, so drop the section and the directory together.

--from creates one service from a golden path, in a folder that holds no pacto.yaml yet, so it refuses --cluster and several folders. --values, --set, --trust and --run-plugins go with --from. --values files apply first, then --set; a null removes a field. --trust takes a trust config file or a bare PEM public key, which then verifies golden paths in every repository; a bare key in $PACTO_DELIVERY_TRUST verifies records only. Only role: template keys verify a golden path; see Trust. The path's pacto.lock is not copied: run pacto lock in the new folder to pin its references. --delivery, with --env, --registry-secret and --insecure-registry, plans the cluster pieces from the new contract when the path publishes manifests under publish.deploy; otherwise the delivery step says why none were planned.


pacto lock

Resolves the full transitive dependency and reference closure and writes a committed pacto.lock pinning each to its OCI digest. With --check, verifies the existing lock without writing.

pacto lock [dir] [flags]

Examples:

  pacto lock
  pacto lock --update
  pacto lock --update-name auth
  pacto lock --check

Flags:

      --check[=true|false]        verify pacto.lock is up to date without writing (non-zero exit on drift)
  -h, --help[=true|false]         help for lock
      --set stringArray           set a contract value (e.g. --set service.version=2.0.0)
      --update[=true|false]       re-resolve dependencies to the newest version within their constraint
      --update-name stringArray   re-resolve only the named dependency, preserving all other pins (repeatable)
  -f, --values stringArray        values file to merge into the contract (can be repeated; last wins)

See Lockfile for the lock model and how .pactoignore keeps a pacto.lock out of a pushed bundle.


pacto login

Stores credentials for an OCI registry in ~/.config/pacto/config.json.

pacto login <registry> [flags]

Examples:

  pacto login ghcr.io -u my-username

Flags:

  -h, --help[=true|false]   help for login
  -p, --password string     registry password
  -u, --username string     registry username

Credentials are stored in ~/.config/pacto/config.json (or $XDG_CONFIG_HOME/pacto/config.json), keeping them separate from Docker's configuration.

GitHub Container Registry (ghcr.io)

For GitHub registries (ghcr.io and docker.pkg.github.com), pacto can reuse credentials from the GitHub CLI, so you can skip pacto login.

If you already have gh installed and authenticated, pacto will use gh auth token to obtain a token transparently. To verify your setup:

# Check if gh is authenticated
gh auth status

# Verify the token is available
gh auth token

To push container images or packages, your token needs the write:packages scope. If you authenticated gh without it, refresh your scopes:

gh auth refresh --scopes write:packages

After this, pacto push oci://ghcr.io/... will work without any additional login step.

If gh is missing or unauthenticated, pacto moves on to the next credential source in the chain.


pacto logout

Removes credentials for an OCI registry from ~/.config/pacto/config.json.

pacto logout <registry> [flags]

Examples:

  pacto logout ghcr.io

Flags:

  -h, --help[=true|false]   help for logout

pacto mcp

Starts a Model Context Protocol (MCP) server exposing Pacto tools for AI agents. Supports stdio (default) and HTTP transports.

When a bundle reference (local directory or oci:// ref) is given, the server also exposes one executable tool per OpenAPI operation in the bundle's openapi interfaces, plus a pacto_skill tool for any skills/*.md domain knowledge. Read-only (GET/HEAD) operations are exposed by default; pass --allow-writes to expose mutating operations.

With --root, the server exposes a read-only contract catalog: the given roots plus their dependency closure, resolved once at startup and then frozen, so the session keeps its startup view even when a registry tag moves. Roots that fail to resolve stay visible as partial knowledge. The catalog grants no authorization and executes nothing.

With --fleet, the server exposes the read-only operational-graph query tools over a fleet snapshot, rebuilt when a call arrives 30 seconds or more after the last rebuild attempt. With --dashboard-url their answers link each entity to its page on that dashboard. The shared fleet source flags (--local, --target-state, --evidence-url, --traces, --mira-source, --oci, --cache, --k8s, --namespace and --freshness) compose that snapshot and are read in --fleet mode only.

With --delivery, the server exposes the Pacto delivery tools (pacto_delivery_*) over the ambient cluster: operation types, plan, get, explain, history, blame, undo plans and record checks, the dashboard's delivery views (caller, inbox, environments, autonomy, published and refusals, scoped by --namespace like the dashboard's), plus propose and cancel only when the apiserver says the caller is an agent (a service account, or an agent by the identity policy Pacto delivery publishes). It has no approve tool.

Over HTTP on loopback without --auth-issuer, the server prints a bearer at launch (pmcp_..., this launch only) and every request must carry it, so other local processes cannot call the server.

Over HTTP, --auth-issuer and --resource make every request carry a bearer token the server verifies (issuer, audience, expiry) and publish protected-resource metadata (RFC 9728); a bind beyond loopback needs them and refuses --auth and --allow-writes, which would lend this process's service credential to every caller. With --delivery the server then exchanges each caller's token for one the apiserver accepts (RFC 8693, --exchange-client-id) and builds the tools for that caller on every request, so an agent proposes as itself and a person gets the read-only tools. With --fleet the server exchanges each caller's token the same way, asks the apiserver who the caller is (a SelfSubjectReview) and asks Kubernetes RBAC what that user may read.

With --publish, the authoring server also exposes pacto_publish_plan and pacto_publish, which publish a contract's version exactly as pacto publish does, with this process's registry credentials.

Over HTTP the contract tools are pacto_schema and pacto_declare: pacto_create, pacto_edit and pacto_check read and write the server's folders and follow refs with its credentials, so they run beside the agent over stdio. pacto_declare plans declaring a running workload; over stdio it writes a draft-<n> tag a person accepts with pacto declare --from-draft, and over HTTP (with --auth-issuer and token exchange) it plans with the caller's own cluster credentials, only in the registries --oci names, and writes nothing.

A bundle reference, --fleet and --delivery combine in one server; --root and --publish select servers of their own. Call pacto_capabilities to learn what a server serves.

pacto mcp [bundle-ref] [flags]

Examples:

  # Start MCP server over stdio (default)
  pacto mcp

  # Start MCP server over HTTP
  pacto mcp -t http

  # Expose a bundle's OpenAPI operations as agent tools
  pacto mcp ./my-service --base-url https://api.example.com

  # Include mutating operations and an auth credential
  pacto mcp oci://ghcr.io/acme/svc:1.0.0 --base-url https://api.example.com \
    --auth bearerAuth=$TOKEN --allow-writes

  # Expose a contract catalog discovered from explicit roots
  pacto mcp --root oci://ghcr.io/acme/platform:1.4.0 --root ./experimental-platform

Flags:

      --allow-writes[=true|false]     expose mutating operations (POST/PUT/PATCH/DELETE) as tools
      --audience string               with --auth-issuer: the audience incoming tokens must carry (default --resource)
      --auth stringArray              credential for a security scheme as name=value (repeatable)
      --auth-issuer string            OpenID issuer whose bearer tokens every HTTP request must carry
      --base-url string               base URL for live invocation (overrides the OpenAPI servers[] URL)
      --cache[=true|false]            include every bundle in the local OCI cache as an offline baseline revision
      --context stringArray           kubeconfig context to read live Pacto CRs from, like --k8s for the current one; repeatable, each cluster read once
      --dashboard-url string          with --fleet: base URL of a Pacto dashboard; fleet answers then carry an href to each entity's page there
      --delivery[=true|false]         expose the Pacto delivery tools over the ambient cluster
      --delivery-namespace string     in --delivery mode: namespace Pacto delivery runs in, whose published identity policy (agent, break-glass and human groups, team prefix) says who is an agent and who may answer (default "pacto-delivery")
      --delivery-trust string         the trust config delivery records (in --delivery mode), the golden paths pacto_create creates from and the target snapshots (the owner policy pacto_declare reads included) pacto_impact and --target-snapshot read are verified with (a PEM public key or a YAML trust config: the recorder's key for records, the operator's advertised installation key for a target snapshot, which verifies only under a key scoped to its cluster: streams ["<uid>/*/*"]; default $PACTO_DELIVERY_TRUST)
      --detected string               add what the operator detected as inferred rows: k8s:<namespace>/<name> of its <release>-detected ConfigMap, or a file holding the same JSON
      --evidence-url stringArray      base URL of an Evidence Server to consume its read-only operational-graph contribution over HTTP (repeatable)
      --exchange-audience string      with --fleet or --delivery over HTTP with --auth-issuer: the audience to exchange for, one the apiserver accepts (default "pacto-cli")
      --exchange-client-id string     with --fleet or --delivery over HTTP with --auth-issuer: the server's own OAuth client, which exchanges each caller's token for the cluster (RFC 8693); its secret comes from PACTO_MCP_EXCHANGE_CLIENT_SECRET
      --external-catalog string       organization external catalog to merge over the default, as oci://REPOSITORY@sha256:DIGEST, else PACTO_EXTERNAL_CATALOG; a tag is refused
      --fingerprints string           a file (YAML or JSON) of the workload managers and promoters this installation runs, as the chart's fingerprints value: each promoter found reads promotion owned by <product> in the detected providers
      --fleet[=true|false]            expose read-only operational-graph (fleet) query tools
      --freshness duration            mark target evidence older than this as stale (the dashboard's window; 0 skips the check and every answer says so) (default 24h0m0s)
  -h, --help[=true|false]             help for mcp
      --host string                   bind address for HTTP transport; beyond loopback it needs --auth-issuer, and on loopback without it every request carries the bearer printed at launch (default "127.0.0.1")
      --index string                  organization index pacto impact and pacto ci read consumers from, as <registry>/pacto-index with no tag or digest (default <registry>/pacto-index from the provider reference; none reads none; skipped when --root names the consumers; pacto ci --publish also writes its entries there; other fleet commands ignore it)
      --k8s[=true|false]              include live Pacto CRs from the current Kubernetes cluster as targets
      --local stringArray             local bundle root(s) to scan in --fleet mode (repeatable); over HTTP none unless set (default [.])
      --mira-source stringArray       base URL of a Mira node whose service map supplies observed calls between services (repeatable)
      --namespace string              namespaces to read Pacto CRs from with --k8s, comma-separated (empty = all namespaces)
      --oci stringArray               registry reference to include as a published-baseline revision (repeatable)
      --oidc-groups-claim string      ID token claim the API server takes the groups from; must match its claim mapping (default groups)
      --oidc-groups-prefix string     prefix the API server puts before every group; must match its claim mapping
      --oidc-username-claim string    ID token claim the API server takes the username from; must match its claim mapping (default sub)
      --oidc-username-prefix string   prefix the API server puts before the username; must match its claim mapping (default the issuer URL and #, none for the email claim; - for none)
      --owner-policy string           over HTTP: the mounted owner policy (the chart's declare block as policy.json) that names who may set a service owner in pacto_declare plans; refused over stdio, which reads it from the signed target snapshots
      --port int                      port for HTTP transport (default 8585)
      --publish[=true|false]          expose pacto_publish_plan and pacto_publish beside the authoring tools
      --resource string               with --auth-issuer: this endpoint's URL as clients reach it, served as protected-resource metadata (RFC 9728)
      --review string                 with --fleet over HTTP with --auth-issuer: how people are reviewed: cluster asks once about every namespace and needs a ClusterRole; local asks in each --namespace only, which a namespaced Role grants, and then services without a namespace show to nobody (default "cluster")
      --root stringArray              contract root to discover a read-only catalog from: a local bundle path or an oci:// reference (repeatable)
      --stats-read-registry string    with --fleet: the stats repository pacto_stats reads; it reads and never records. Over stdio the default is $PACTO_STATS_REGISTRY; over HTTP only this flag enables pacto_stats
      --target-snapshot stringArray   signed target snapshot(s) to read targets from: an oci:// pacto-targets repository, or :cluster-<uid> tags or digests to pin the clusters CI expects (repeatable); pacto impact, pacto ci and pacto_impact on a stdio pacto mcp also take auto (the default: derived from the provider ref) and off
      --target-state stringArray      offline target-state fixture file(s) supplying targets, for demos and tests; production targets arrive as signed EvidenceSets (repeatable)
      --traces stringArray            OTLP/JSON trace file supplying runtime-observed dependency edges, folded into the snapshot as observed relationships (repeatable)
  -t, --transport string              transport type: stdio or http (default "stdio")

The default server exposes the four authoring tools below and pacto_capabilities, which reports what the server serves. A bundle reference and four flags add tools or select a different server. See Server modes after this table:

Tool Description
pacto_create Create a new contract from intent-level inputs (name, description, interfaces, runtime semantics), or with from from a golden path (stdio only). Supports dry run.
pacto_edit Edit an existing contract: add or remove interfaces, dependencies and configuration references, add environments and set their values, set the service lifecycle or the golden path template, change runtime, update metadata. Checks values against a referenced contract's schema before writing. Supports dry run.
pacto_check Validate a contract and return errors, warnings and actionable improvement suggestions.
pacto_schema Return the Pacto format explanation and full JSON Schema reference.

These four authoring tools operate on local contract directories (they read and write pacto.yaml on disk) and accept no oci:// refs. Over HTTP the server serves only pacto_schema of the four.

Server modes

The default server exposes the authoring tools above. A bundle reference, --fleet and --delivery add their tools and combine in one server. --root and --publish each select a server of their own, and passing either with another mode is an error:

Invocation Server
pacto mcp Authoring tools.
pacto mcp <bundle-ref> Authoring tools plus the bundle's OpenAPI operations as executable agent tools, alongside a pacto_skill tool for any bundled skills.
pacto mcp --fleet Authoring tools plus read-only operational-graph query tools.
pacto mcp --publish Authoring tools plus pacto_publish_plan and pacto_publish, which publish a version to your registry, and pacto_capabilities. Stdio only.
pacto mcp --delivery Authoring tools plus the delivery tools over the cluster your kubeconfig points at: read delivery state and the dashboard's delivery views and, for an agent, ask for or cancel a change. There is no approve tool.
pacto mcp --fleet --delivery [<bundle-ref>] Authoring tools plus the tools of every mode named, in one session.
pacto mcp --root <ref> [--root <ref>] A read-only contract catalog discovered from the named roots. Catalog mode registers only catalog tools, and none of them writes to disk.

--root is repeatable and takes a local bundle directory or an oci:// reference. The roots and their dependency closure are resolved once, at startup, through the same reference parsing, credentials and cache the rest of the CLI uses; after that the session is frozen, so every answer reflects startup state even if a registry tag moves. A root that fails to resolve stays visible with a classified reason, and the catalog reports itself as partial. The catalog reads only the named roots and their closure, never refreshes and persists nothing.

Fleet tool arguments

The arguments each fleet query tool takes. Arguments are optional unless marked:

Tool Arguments
pacto_fleet_search text, owner, business_domain, offering, status, compliance, workload, scope, source, ready, not_ready, has_capability, has_dependency, template (only keeps golden paths, exclude leaves them out), label (target labels as key=value), limit, offset
pacto_fleet_get service (a logical service) or target (an operational target by key or name)
pacto_fleet_graph service, revision or target to root the traversal, then direction, transitive and max_depth (0 = unlimited)
pacto_fleet_status needs_attention for every category, or any of invalid, non_compliant, unknown, stale, unresolved_deps, unsatisfied_ranges, missing_readiness, unowned, undeclared, golden_path_deployed; plus limit. No category, including empty input, reports every category
pacto_fleet_explain subject (required): a service name or a target key or name
pacto_fleet_entities text, kind (any entity kind; empty lists services, owners, domains and offerings, or the one kind a readiness, scope, source_kind or source_health filter applies to), owner, owner_key, business_domain, offering, consumes (services that depend on or reference a provider of this offering), phase, environment, template (only lists golden paths, exclude leaves them out), created_from (the services created from this golden path, by service key), ownership, status, has_non_compliant, capability, domain, service, source, scope, readiness, source_kind, source_health, sort, limit, offset
pacto_fleet_entity kind and key (both required): a service, revision, target, owner, source, business domain or offering
pacto_fleet_attention category, severity, owner, owner_key, business_domain, service, kind, key, source, status, stale_only, limit, offset
pacto_fleet_neighborhood service (required): a service name or key, then direction (dependencies, dependents or both, the default), depth, views (comma-separated expected, observed and differences; empty means expected,observed), max_nodes and max_edges
pacto_fleet_versions offering (required), then provider (a key, or a name only one domain uses) and range (a semver range; each version then carries rangeStatus and each provider its latestCompatible version)
pacto_fleet_revision_document key and path (both required): a revision key and a document path its docs list
pacto_impact old_ref and new_ref, plus include_observed and traces; or running with new_ref alone; or event (unavailable, removed or regressed) with service, plus revision for regressed
pacto_stats registry (stdio only), since and until (30d, 12h, a date or RFC 3339; default the last 30 days), by (service, owner, domain, repository or environment), service and kinds (comma-separated run-record kinds, for example diff,impact). It appears with --fleet over stdio, and over HTTP only when the server was started with --stats-read-registry

Argument names differ from flag names: the substring filter is text. Every tool above closes its schema, so an unknown argument is an error.

With --fleet, the server rebuilds its snapshot when a call arrives 30 seconds or more after the last rebuild attempt, and pacto_impact analyses over the same snapshot as the other tools. Add --dashboard-url <url> to make search, graph, status, entities, entity, attention, neighborhood and versions answers carry an href to each entity's page on that Pacto dashboard, and each contracted consumer in a pacto_impact answer an href to its service page.

See MCP Integration for setup and the MCP reference for serving a bundle's operations as tools and the catalog surface.


pacto migrate

Walks the given directories (the current one by default) with the rules of the local fleet source and raises the pactoVersion of every pacto.yaml it finds. Hidden folders, node_modules and vendor are skipped; folders past depth 8 and folders a root .pactoignore names are skipped and printed as skipped.

A file is raised only when validation finds nothing new at the new version. Its version token changes, and two removals can apply even to a file already at the version: a leftover delivery section, and any publish.artifacts[].build block that pacto ci --publish detection reproduces. Every other byte stays as written, and each line names what changed. A raise that would change what the contract means keeps the file and says why. 1.x files are left to MIGRATION.md.

Exits 1 only when a file cannot be read or written, or --to names an unsupported version.

pacto migrate [dir...] [flags]

Examples:

  pacto migrate
  pacto migrate --dry-run
  pacto migrate services/payments
  pacto migrate --to 2.4

Flags:

      --dry-run[=true|false]   print what would change and write nothing
  -h, --help[=true|false]      help for migrate
      --to string              pactoVersion to raise to (default: the newest this Pacto supports)

pacto otel

Observe runtime dependencies from OpenTelemetry traces

pacto otel [flags]

Flags:

  -h, --help[=true|false]   help for otel

pacto otel observe

Reads an OTLP/JSON trace export and derives the service dependency edges its outbound spans prove. By default it prints the observed edges as text; add --output-format json for machine-readable output. With --evidence it emits one EvidenceSet per calling service as a JSON array. Each set's ContractRef is empty because traces carry no contract revision. pacto evidence sign reads one EvidenceSet from a file, so write the array out, split it and set each ContractRef to the revision it describes before signing (pacto evidence sign) and reporting (pacto evidence send).

pacto otel observe <traces.json> [flags]

Examples:

  pacto otel observe traces.json
  pacto otel observe traces.json --evidence --output-format json > sets.json

Flags:

      --evidence[=true|false]   emit signable EvidenceSets instead of raw edges
  -h, --help[=true|false]       help for observe
      --source string           collector/source name recorded as provenance (default "otel")

pacto pack

Validates the contract in the given directory and creates a tar.gz archive of the bundle, ready for distribution.

pacto pack [dir] [flags]

Examples:

  pacto pack my-service

Flags:

  -h, --help[=true|false]    help for pack
  -o, --output string        output file path (default: <name>-<version>.tar.gz)
      --set stringArray      set a contract value (e.g. --set service.version=2.0.0)
  -f, --values stringArray   values file to merge into the contract (can be repeated; last wins)

The contract is validated before packing. If validation fails, no archive is created.

Files matched by .pactoignore are excluded from the archive. See Packaging ignore.


pacto publish

Publishes every artifact the contract's publish section declares (pactoVersion 2.1), the contract bundle and the deploy artifact Flux applies, all tagged with service.version. Docker or the declared command builds. Pacto pushes each artifact to a new tag, signs every digest with Sigstore (built in) and attaches the SBOM files the build wrote. A breaking change since the last published version is refused below a major bump (a minor before 1.0).

--plan shows what is missing and changes nothing. Running publish again from the same commit finishes what is missing and changes nothing else. --propose hands the deploy artifact to Pacto delivery as a promote on a Stage, once the Stage records it as published, meaning Flux polled the candidate OCIRepository and verified the signature. It waits up to --propose-timeout for that.

pacto publish [dir] [flags]

Examples:

  # What would be published, and what refuses it
  pacto publish --plan

  # The same, for the contract in ./payments
  pacto publish --plan ./payments

  # Publish, then propose the version on the test Stage
  pacto publish --propose test/payments

Flags:

      --correlation-id string              with --propose, an id that ties the promote to an incident or another change, such as a ticket; kept with the change and its record, filtered by pacto delivery history --correlation-id
  -h, --help[=true|false]                  help for publish
      --image string                       with no publish section: the image to deploy, pinned by digest (repo@sha256:...); Pacto builds, signs and copies none
      --index string                       organization index repository for this version's entry, as <registry>/pacto-index with no tag or digest (default <registry>/pacto-index from the contract's repository; none writes no entry)
      --no-transparency-log[=true|false]   with --sign-key: keep the signatures out of the transparency log
      --on-behalf-of string                with --propose, the person an agent acts for, as the Kubernetes username the cluster authenticates them as (what kubectl auth whoami prints for them, any OIDC prefix included); asserted, not verified; required when an agent proposes, never a service account or other system user, and that person may not approve the change
  -p, --path string                        path to contract directory, the same as [dir] (default: current directory)
      --plan[=true|false]                  show what is missing and what refuses it; change nothing
      --propose string                     after publishing, propose the deploy artifact on <namespace>/<stage> (needs delivery.enabled on the pacto-operator chart)
      --propose-timeout duration           how long --propose waits for the Stage to record the version as published (default 10m0s)
      --registry string                    with no publish section: the registry to publish to (default: what the CI context or the workload image names)
      --revision string                    source revision stamped on every artifact (default: the git commit of the contract directory, which must have no uncommitted changes)
      --set stringArray                    set a contract value (e.g. --set service.version=2.0.0)
      --sign-key string                    with no publish section: sign with this cosign key file instead of keyless
      --stats-context string               comma-separated context to include in the run record: repository, run-url, environment=<name>; nothing is included unless named
      --stats-file string                  write the run record to this file for pacto stats publish, replacing the record it holds, so give each command its own file; default $PACTO_STATS_FILE
      --stats-registry string              publish an unsigned run record (statistics, never evidence) to this repository, for example ghcr.io/acme/pacto-stats; default $PACTO_STATS_REGISTRY
      --values stringArray                 values file to merge into the contract (can be repeated; last wins)

pacto pull

Pulls a contract bundle from the specified OCI reference and extracts it to a local directory.

pacto pull <ref> [flags]

Examples:

  # Pull a specific version
  pacto pull oci://ghcr.io/acme/my-service-pacto:1.0.0

  # Pull the latest available version
  pacto pull oci://ghcr.io/acme/my-service-pacto

Flags:

  -h, --help[=true|false]        help for pull
  -o, --output string            output directory (default: service name)
      --trusted-root string      Sigstore trusted root JSON --verify-identity checks against (default: public-good Sigstore)
      --verify-identity string   pull only a bundle signed keyless by this certificate identity, such as an email (needs --verify-issuer)
      --verify-issuer string     the OIDC issuer of --verify-identity
      --verify-key string        pull only a bundle signed by the key of this PEM public key file

pacto push

Validates the contract (including remote policy and config refs), builds an OCI artifact and pushes it to the specified registry reference. Pushing the same content again succeeds without writing anything; different content under an existing reference is refused unless --force.

pacto push <ref> [flags]

Examples:

  # Push with auto-tag (uses contract version)
  pacto push oci://ghcr.io/acme/my-service-pacto -p my-service

  # Push with explicit tag
  pacto push oci://ghcr.io/acme/my-service-pacto:latest -p my-service

  # Force overwrite an existing artifact
  pacto push oci://ghcr.io/acme/my-service-pacto -p my-service --force

Flags:

  -f, --force[=true|false]   overwrite existing artifact in registry
  -h, --help[=true|false]    help for push
      --index string         organization index repository for this version's entry, as <registry>/pacto-index with no tag or digest (default <registry>/pacto-index from the contract's repository; none writes no entry)
  -p, --path string          path to contract directory (default: current directory)
      --set stringArray      set a contract value (e.g. --set service.version=2.0.0)
      --values stringArray   values file to merge into the contract (can be repeated; last wins)

If the tag already holds the same content, pacto push succeeds and writes nothing. If it holds different content, pacto push refuses with a non-zero exit and writes nothing. Use --force to overwrite.

--values has no -f shorthand on push

On every other override-taking command -f is the shorthand for --values. On pacto push, -f is --force, so --values must be spelled out in full here.


pacto run

Starts the command and watches the TCP sockets of its whole process tree: the interfaces bound with --bind must be listened on, the dependencies bound with --dep reached. Every --interval it prints the contract's compliance and findings in --output-format; once the command exits it prints a final round from the last view taken while the command ran, and exits with the command's exit code. With --fail-on it exits 1 instead of 0 when the final verdict is that bad or worse.

The command runs in a process group of its own, so a Ctrl-C reaches it once. When pacto run owns the terminal, the command's group takes it over: it reads the terminal and gets Ctrl-C and Ctrl-Z straight from it, and pacto run takes the terminal back once it exits. Otherwise SIGINT and SIGTERM sent to pacto run are passed on to the command's whole group.

Pacto leaves the command's stdin, stdout and stderr untouched. Rounds go to stderr, each in a single write, or with --report to a file: the file is truncated when the run starts and every round is appended to it in a single write, so a reader following it sees whole rounds (with json, one object per line).

With root (or BPF, PERFMON, SYS_PTRACE and write access to its own cgroup) on Linux 5.11 or later with BTF and cgroup v2 (or 5.8 or later with BTF and root or CAP_SYS_RESOURCE), the command starts inside a new cgroup pacto-run-<pid> and an eBPF program sees every listener and every connection outcome of the tree, failures included (collector pacto-run+ebpf). Otherwise it falls back to polling /proc every second and says so (collector pacto-run): listeners are seen in full, so a missing one is still confirmed, but a connection is seen only while it is open at a poll and a failed connection never, so a dependency is reported reachable or unknown, never unreachable. If the program attached but the command cannot start inside the new cgroup, the run falls back to polling too and says so. Elsewhere than Linux the command runs unobserved and every runtime assertion is unsupported.

A negative is reported once it persists for --stabilization-window. Health and metrics capabilities are probed on --host at their bound interface's port. With --evidence-url every round is also signed and sent to an Evidence Server, which needs the contract pinned as oci://...@sha256:<digest>.

pacto run --contract <dir|oci ref> [flags] -- command [args...]

Examples:

  pacto run --contract ./payments --bind api=8080 --dep postgres=127.0.0.1:5432 -- ./payments-server
  pacto run --contract oci://ghcr.io/acme/payments:1.4.0 --bind api=8080 --fail-on noncompliant \
    --stabilization-window 30s --output-format json --report rounds.jsonl -- java -jar payments.jar

Flags:

      --bind stringArray                interface=port the command serves the interface on (repeatable)
      --cgroup-root string              cgroup v2 directory the session cgroup is created in (default: the caller's own cgroup under /sys/fs/cgroup)
      --contract string                 contract bundle directory or oci:// reference (required)
      --dep stringArray                 dependency=host:port the command reaches the dependency at (repeatable)
      --enable-probing[=true|false]     also probe the wire protocol of every interface found listening
      --evidence-key string             private key file envelopes are signed with
      --evidence-key-id string          key id (must match the server's trust entry)
      --evidence-producer string        producer id
      --evidence-url string             Evidence Server base URL
      --fail-on string                  exit 1 when the command exits 0 but the final verdict is this bad or worse: one of [none noncompliant unknown] (default "none")
  -h, --help[=true|false]               help for run
      --host string                     address capability and protocol probes dial (default "127.0.0.1")
      --interval duration               how often a round is evaluated and printed (whole seconds) (default 10s)
      --proc-root string                where /proc is mounted (default "/proc")
      --report string                   file every round is appended to instead of stderr (truncated when the run starts)
      --ringbuf-size uint32             kernel ring buffer size in bytes; a power of two and a multiple of the page size (default 262144)
      --stabilization-window duration   how long a negative must persist before it is reported (default 2m0s)

pacto stats

Pacto can record what it catches as unsigned statistics in a registry you name; pacto stats and the dashboard Metrics page total them, and nothing leaves your registry. Total the run records in a stats repository for a time window, as text or JSON. Run records are unsigned statistics about Pacto runs: nothing that decides ever reads them, and this command only reads. Every answer says how many records were read, how many could not be read and which bound cut the read; a rate with nothing to take it over is marked unknown. With --by owner or --by domain, owner and domain are inferred from the fleet snapshot the fleet source flags build. See https://pacto.run/latest/measure-what-pacto-does/.

pacto stats [flags]

Examples:

  pacto stats --registry ghcr.io/acme/pacto-stats
  pacto stats --since 7d --by environment --output-format json
  pacto stats --by owner --kind impact --kind publish

Flags:

      --by string                     group the numbers by service, owner, domain, repository, environment
      --cache[=true|false]            include every bundle in the local OCI cache as an offline baseline revision
      --context stringArray           kubeconfig context to read live Pacto CRs from, like --k8s for the current one; repeatable, each cluster read once
      --delivery-trust string         the trust config target snapshots are verified with: a YAML file with a key scoped to each cluster (default $PACTO_DELIVERY_TRUST)
      --detected string               add what the operator detected as inferred rows: k8s:<namespace>/<name> of its <release>-detected ConfigMap, or a file holding the same JSON
      --evidence-url stringArray      base URL of an Evidence Server to consume its read-only operational-graph contribution over HTTP (repeatable)
      --external-catalog string       organization external catalog to merge over the default, as oci://REPOSITORY@sha256:DIGEST, else PACTO_EXTERNAL_CATALOG; a tag is refused
      --fingerprints string           a file (YAML or JSON) of the workload managers and promoters this installation runs, as the chart's fingerprints value: each promoter found reads promotion owned by <product> in the detected providers
      --freshness duration            mark target evidence older than this as stale (the dashboard's window; 0 skips the check and every answer says so) (default 24h0m0s)
  -h, --help[=true|false]             help for stats
      --index string                  organization index pacto impact and pacto ci read consumers from, as <registry>/pacto-index with no tag or digest (default <registry>/pacto-index from the provider reference; none reads none; skipped when --root names the consumers; pacto ci --publish also writes its entries there; other fleet commands ignore it)
      --k8s[=true|false]              include live Pacto CRs from the current Kubernetes cluster as targets
      --kind stringArray              total only run records of this kind: diff, impact, publish, operation, coverage (repeatable)
      --local stringArray             local bundle root(s) to scan (repeatable) (default [.])
      --mira-source stringArray       base URL of a Mira node whose service map supplies observed calls between services (repeatable)
      --namespace string              namespaces to read Pacto CRs from with --k8s, comma-separated (empty = all namespaces)
      --oci stringArray               registry reference to include as a published-baseline revision (repeatable)
      --registry string               stats repository to read or publish to, for example ghcr.io/acme/pacto-stats (default $PACTO_STATS_REGISTRY)
      --root stringArray              contract root whose whole dependency closure joins the snapshot: a local bundle path or an oci:// reference (repeatable)
      --service string                total only the run records of this service: the contract's service.name
      --since string                  start of the window: 30d, 12h, a date or RFC 3339 (default 30d)
      --target-snapshot stringArray   signed target snapshot(s) to read targets from: an oci:// pacto-targets repository, or :cluster-<uid> tags or digests to pin the clusters CI expects (repeatable); pacto impact, pacto ci and pacto_impact on a stdio pacto mcp also take auto (the default: derived from the provider ref) and off
      --target-state stringArray      offline target-state fixture file(s) supplying targets, for demos and tests; production targets arrive as signed EvidenceSets (repeatable)
      --traces stringArray            OTLP/JSON trace file supplying runtime-observed dependency edges, folded into the snapshot as observed relationships (repeatable)
      --until string                  end of the window, exclusive: 30d, 12h, a date or RFC 3339 (default now)

pacto stats publish

Publish run record files, written by --stats-file, to a stats repository as unsigned statistics. Operation records are written only by the delivery promoter and are refused. Every file is tried; the command fails when any of them could not be read, parsed or published. The publishing job vouches for the files with its own credentials: never publish files from untrusted (fork) jobs into a repository others read.

pacto stats publish <file...> [flags]

Flags:

  -h, --help[=true|false]   help for publish

pacto tui

Opens a full-screen terminal UI over the same fleet snapshot pacto fleet queries. Navigate services, revisions, targets, owners and sources, then run pacto's verbs against the selection, which becomes the command's argument.

Read verbs run in-process against the loaded snapshot. Write verbs shell out to this same binary so they own the terminal, and every one of them asks for confirmation first. Pass --read-only to hide the write verbs entirely.

Requires an interactive terminal. In a pipeline or CI, use the plain commands.

pacto tui [flags]

Examples:

  # Browse the local fleet
  pacto tui --local .

  # Browse a live cluster plus the local bundles, without write verbs
  pacto tui --local . --k8s --read-only

Flags:

      --cache[=true|false]            include every bundle in the local OCI cache as an offline baseline revision
      --context stringArray           kubeconfig context to read live Pacto CRs from, like --k8s for the current one; repeatable, each cluster read once
      --delivery-trust string         the trust config target snapshots are verified with: a YAML file with a key scoped to each cluster (default $PACTO_DELIVERY_TRUST)
      --detected string               add what the operator detected as inferred rows: k8s:<namespace>/<name> of its <release>-detected ConfigMap, or a file holding the same JSON
      --evidence-url stringArray      base URL of an Evidence Server to consume its read-only operational-graph contribution over HTTP (repeatable)
      --external-catalog string       organization external catalog to merge over the default, as oci://REPOSITORY@sha256:DIGEST, else PACTO_EXTERNAL_CATALOG; a tag is refused
      --fingerprints string           a file (YAML or JSON) of the workload managers and promoters this installation runs, as the chart's fingerprints value: each promoter found reads promotion owned by <product> in the detected providers
      --freshness duration            mark target evidence older than this as stale (the dashboard's window; 0 skips the check and every answer says so) (default 24h0m0s)
  -h, --help[=true|false]             help for tui
      --index string                  organization index pacto impact and pacto ci read consumers from, as <registry>/pacto-index with no tag or digest (default <registry>/pacto-index from the provider reference; none reads none; skipped when --root names the consumers; pacto ci --publish also writes its entries there; other fleet commands ignore it)
      --k8s[=true|false]              include live Pacto CRs from the current Kubernetes cluster as targets
      --local stringArray             local bundle root(s) to scan (repeatable) (default [.])
      --mira-source stringArray       base URL of a Mira node whose service map supplies observed calls between services (repeatable)
      --namespace string              namespaces to read Pacto CRs from with --k8s, comma-separated (empty = all namespaces)
      --oci stringArray               registry reference to include as a published-baseline revision (repeatable)
      --read-only[=true|false]        hide every write verb
      --root stringArray              contract root whose whole dependency closure joins the snapshot: a local bundle path or an oci:// reference (repeatable)
      --target-snapshot stringArray   signed target snapshot(s) to read targets from: an oci:// pacto-targets repository, or :cluster-<uid> tags or digests to pin the clusters CI expects (repeatable); pacto impact, pacto ci and pacto_impact on a stdio pacto mcp also take auto (the default: derived from the provider ref) and off
      --target-state stringArray      offline target-state fixture file(s) supplying targets, for demos and tests; production targets arrive as signed EvidenceSets (repeatable)
      --traces stringArray            OTLP/JSON trace file supplying runtime-observed dependency edges, folded into the snapshot as observed relationships (repeatable)

pacto update

Downloads and installs the specified version of pacto. If no version is given, updates to the latest release.

pacto update [version] [flags]

Examples:

  # Update to the latest release
  pacto update

  # Update to a specific version
  pacto update v1.1.0

Flags:

  -h, --help[=true|false]   help for update

Note

pacto update works only on release builds. If you built from source without version injection, install a release build first.

Update notifications

When a newer version is available, pacto displays a notification after any command:

A new version of pacto is available: v1.0.0 -> v1.2.0
Run 'pacto update' to update.

The check runs asynchronously and adds no latency. Results are cached for 24 hours in ~/.config/pacto/update-check.json.

Notifications are suppressed when:

  • Running a dev build
  • Using --output-format json or --output-format markdown (the notice shows only for text output)
  • The PACTO_NO_UPDATE_CHECK=1 environment variable is set

pacto validate

Validates a pacto.yaml in the given directory (or oci:// reference) against the specification, running the three validation layers: structural, cross-field and policy.

The output has one PASS, FAIL or SKIP line per stage, in order: load, lock, structural, cross-field, policy, configuration-refs, environments, guarantees, readiness and closure. The configuration-refs stage fetches the contract each configuration ref names and checks the values against its configuration schema; a ref that cannot be fetched fails it when values depend on it. The environments stage checks each environment's file against the schema of every configuration it names. Each error sits under its stage with its file:line:column when Pacto can locate it. A failed load or lock stage skips every stage after it, and a failed structural, cross-field or policy stage skips the stages after it up to environments. A failed configuration-refs stage skips nothing. The guarantees, readiness and closure stages run even when an earlier stage fails. The last line, Next:, names the one command to run now. With --output-format json the same comes as stages and next.

pacto validate [dir | oci://ref] [flags]

Examples:

  # Validate a local contract
  pacto validate my-service

  # Validate from current directory
  pacto validate

  # Validate from an OCI registry
  pacto validate oci://ghcr.io/acme/my-service-pacto:1.0.0

  # JSON output
  pacto validate --output-format json my-service

  # Also check the readiness gate (fail if score < minScore)
  pacto validate --readiness my-service

  # Also check every dependency against this contract's policies
  pacto validate --closure my-service

Flags:

      --closure[=true|false]     also check every contract in the dependency closure against the policies this contract resolves. Fails when a dependency cannot be resolved and warns about deprecated interfaces of direct dependencies. Fetches each dependency once
  -h, --help[=true|false]        help for validate
      --readiness[=true|false]   also check the readiness gate: fail if the derived readiness score is below the declared (or default 100) minScore. Opt-in because gate evaluation is time-dependent (check expiry is compared against the run time), which would otherwise make plain validation non-deterministic
      --set stringArray          set a contract value (e.g. --set service.version=2.0.0)
  -f, --values stringArray       values file to merge into the contract (can be repeated; last wins)

The --readiness gate is opt-in because it is time-dependent: it compares the assessment's single readiness.expires date against the run time, which would make plain validate non-deterministic. Expiry is declared once for the whole assessment. Individual claims carry no expires field, and adding one fails to load with PARSE_ERROR. Without the flag, validation checks the contract's structure and rules. It still checks the shape of readiness claims and skips the freshness gate. See the readiness reference for the score and gate semantics.

A contract with a mistyped value fails like this:

svc is invalid
PASS load
SKIP lock               no pacto.lock
FAIL structural
  svc/pacto.yaml:6:1: ERROR [SCHEMA_VIOLATION] workload: at '/workload': value must be one of 'service', 'job', 'scheduled' (did you mean "service"?)
SKIP cross-field        structural failed
SKIP policy             structural failed
SKIP configuration-refs structural failed
SKIP environments       structural failed
SKIP guarantees         no dependency declares requires
SKIP readiness          not requested (--readiness)
SKIP closure            not requested (--closure)
Next: fix workload at svc/pacto.yaml:6:1 [SCHEMA_VIOLATION], then run pacto validate svc

Errors within a stage are listed in file order. An unknown field or an enum value close to a known one carries a did you mean hint. A failed lock stage names the pacto lock command that repairs it. When every stage passes, Next is pacto impact PUBLISHED_REF <dir>, which shows the services the change breaks; replace PUBLISHED_REF with the oci:// reference of the version you run today. In JSON, stages lists each stage with its status, reason and errors, each error carries line and column when known, file is the file they point into, and next holds the command. errors and warnings still list every stage's findings. With --set or -f an error in pacto.yaml carries no line or column, because those flags validate a merged document whose lines differ from the file. An error in an environment's file keeps them.

Exit code: Non-zero if validation fails.


pacto version

Prints the current pacto version.

pacto version [flags]

Examples:

  pacto version

Flags:

  -h, --help[=true|false]   help for version

Environment variables

Boolean variables are parsed the way Go parses a boolean: 1, t, T, true, TRUE and True enable them and 0, f, F, false, FALSE and False disable them. Any other value, including yes and on, reads as off with no warning. The two opt-outs PACTO_NO_ANIM and PACTO_NO_UPDATE_CHECK are the exception: for them any other non-empty value reads as on.

Variable Description
PACTO_CACHE_DIR Cache directory for the pacto dashboard bundle scan. The core CLI cache location is controlled by XDG_CACHE_HOME (see below).
PACTO_NO_CACHE Boolean. Disable OCI bundle caching (equivalent to --no-cache)
PACTO_NO_ANIM Boolean. Disables spinners and animations (equivalent to --no-anim).
PACTO_NO_UPDATE_CHECK Boolean. Disables automatic update checks.
PACTO_REGISTRY_USERNAME Registry username for authentication
PACTO_REGISTRY_PASSWORD Registry password for authentication
PACTO_REGISTRY_TOKEN Registry token for authentication
PACTO_INSECURE_REGISTRIES Comma-separated registry hosts that Pacto reaches over plain HTTP. It applies to every registry access: pacto push, pacto pull, dependency and policy resolution and the Evidence Server. Scoped per host, so HTTPS registries are unaffected. Loopback hosts use plain HTTP without being listed. Use it only for a controlled in-cluster registry: it disables transport encryption, so credentials and payloads travel in the clear.
PACTO_EVIDENCE_SOURCE_URL Base URL of an Evidence Server whose read-only operational-graph contribution pacto dashboard should consume. The operator sets it when it wires a managed Evidence Server. Unset means no evidence source configured, which the dashboard reports separately from an unavailable source.
XDG_CONFIG_HOME Override config directory (default: ~/.config). Affects pacto login credentials and update check cache
XDG_CACHE_HOME Override cache directory (default: ~/.cache). Affects OCI bundle cache location

Dashboard environment variables

The following variables configure the dashboard when set (see also Dashboard Container). Each mirrors the flag named beside it: an explicitly passed flag wins, and otherwise the variable overrides that flag's default.

Variable Flag Description
PACTO_DASHBOARD_REPO (positional args) Comma-separated OCI repositories, used only when no positional oci:// argument is given
PACTO_DASHBOARD_HOST --host Bind address (default: 127.0.0.1)
PACTO_DASHBOARD_PORT --port HTTP port (default: 3000)
PACTO_DASHBOARD_NAMESPACE --namespace Kubernetes namespaces to read, comma-separated (empty = all)
PACTO_DASHBOARD_CORS_ORIGIN --cors-origin One explicit origin allowed to call the API. Unset means same-origin only.
PACTO_DASHBOARD_TRACES --traces OTLP/JSON trace files to fold observed dependencies from
PACTO_DASHBOARD_MIRA_SOURCES --mira-source Space-separated Mira base URLs whose service map supplies observed calls
PACTO_DASHBOARD_TRACE_SOURCES --trace-source Named offline trace sources as NAME=PATH, where NAME is the source's identity (what the fleet, the API and the dashboard's Data Source list call it) and PATH is the trace file location. Identity and location are separate, so reordering the configuration or moving the file keeps the source's name. Two sources whose files share a basename stay two sources. A name must be unique across every Data Source the dashboard assembles.

The three list variables split on whitespace

PACTO_DASHBOARD_TRACES, PACTO_DASHBOARD_TRACE_SOURCES and PACTO_DASHBOARD_MIRA_SOURCES go through the same generic flag binding as every other dashboard variable, which splits a multi-valued string on spaces. PACTO_DASHBOARD_TRACES="a.json b.json" supplies two files; PACTO_DASHBOARD_TRACES=a.json,b.json supplies one, named a.json,b.json. PACTO_DASHBOARD_REPO is read directly and splits on commas.

The dashboard starts either way: it skips a trace file it cannot read, so the symptom is missing observed dependencies with no error. Check the snapshot's reported limitations if the operational graph looks emptier than you expect.


Authentication

Pacto follows this credential resolution chain:

  1. Environment variables (PACTO_REGISTRY_TOKEN, or PACTO_REGISTRY_USERNAME + PACTO_REGISTRY_PASSWORD)
  2. Pacto config (~/.config/pacto/config.json, written by pacto login, which persists --username and --password)
  3. GitHub CLI (gh auth token, for ghcr.io and docker.pkg.github.com only)
  4. Docker config (~/.docker/config.json) and credential helpers (including cloud-registry helpers for ECR, GCR and ACR)
  5. Anonymous fallback

For GitHub registries, step 3 means you can skip pacto login entirely if you have gh authenticated with the write:packages scope (see pacto login above).

Pacto stores no credentials in contract files.