Skip to content

Installation

Install the pacto command-line tool (CLI). Use the installer script: it installs pacto and the plugins with one command. The other two ways need Go and suit contributors.

Method Installs pacto version reports
Installer script pacto plus both official plugins the release you installed
go install pacto only dev, with commit and date unknown
From source pacto only version, commit and date from your checkout

To look first, open the live dashboard demo. It runs Pacto in your browser.

Via installer script

curl -fsSL https://raw.githubusercontent.com/TrianaLab/pacto/main/scripts/get-pacto.sh | bash

This puts three programs in /usr/local/bin: pacto, pacto-plugin-schema-infer and pacto-plugin-openapi-infer. The script checks each download's SHA-256 checksum first. If a plugin fails to install, the script warns and still installs pacto.

Pass --version for a specific release: bash -s -- --version v4.0.0. The CLI, the charts and the images each have their own version numbers. See Versions.

If the script cannot find a version (GitHub API rate limit)

The script asks the GitHub API for the latest version. Without a token GitHub allows 60 requests per hour per IP address, so on a shared network it can fail with Failed to fetch latest version. Set GH_TOKEN to any GitHub token and run it again:

curl -fsSL https://raw.githubusercontent.com/TrianaLab/pacto/main/scripts/get-pacto.sh \
  | GH_TOKEN="$(gh auth token)" bash

Installing without sudo

The installer calls sudo to write to /usr/local/bin. To install into your home directory with no sudo at all:

curl -fsSL https://raw.githubusercontent.com/TrianaLab/pacto/main/scripts/get-pacto.sh \
  | PACTO_INSTALL_DIR="$HOME/.local/bin" bash -s -- --no-sudo

$HOME/.local/bin must be on your PATH, and the directory must already exist.

Via Go

go install github.com/trianalab/pacto/v4/cmd/pacto@latest

Requires Go 1.27.4 or later. The binary is placed in $GOBIN (typically ~/go/bin).

go install builds report as dev

pacto version prints Pacto: dev and pacto update refuses to run. Use the installer script if you need version metadata.

From source

Requires Go 1.27.4 or later, make and git.

git clone https://github.com/TrianaLab/pacto.git
cd pacto
make build

make build installs into $GOBIN (typically ~/go/bin) and stamps the version, commit and build date.

Versions

Pacto uses three version numbers:

Version What it versions Current major
pactoVersion The contract format, set in each pacto.yaml "2.0", "2.1", "2.2", "2.3", "2.4" and "2.5"
Pacto core The pacto CLI and the Go library github.com/trianalab/pacto/v4 4.x
Kubernetes integration The operator, its Helm chart and delivery 6.x

The version selector at the top of these docs follows Pacto core.

A contract with pactoVersion: "2.1" needs Pacto core 4.1.0 or later and operator 6.1.0 or later. A contract with pactoVersion: "2.2" needs Pacto core 4.3.0 or later and operator 6.3.0 or later. A contract with pactoVersion: "2.3" needs Pacto core 4.4.0 or later and operator 6.4.0 or later. A contract with pactoVersion: "2.4" needs Pacto core 4.5.0 or later and operator 6.5.0 or later. A contract with pactoVersion: "2.5" needs Pacto core 4.6.0 or later and operator 6.6.0 or later. Older releases reject it. The integration's version compatibility table lists the current releases.

Verify the installation

pacto version

The first line should match the release you installed, or say dev if you used go install. If it names an older release, an earlier copy is ahead on your PATH: which pacto shows which one won.

Installing the official plugins

The two official plugins (pacto-plugin-schema-infer and pacto-plugin-openapi-infer) are separate binaries from the pacto-plugins repository.

Install method Plugins
Installer script Installed (best-effort)
go install Not installed
From source Not installed

Without them, pacto generate schema-infer fails with plugin "schema-infer" not found. To install by hand, download from pacto-plugins releases and put them on your PATH. See Plugins.

Update the CLI

pacto update              # latest release
pacto update v4.0.0       # a specific version

This verifies the new binary's SHA-256 before replacing the current one. A go install build cannot use it; re-run go install github.com/trianalab/pacto/v4/cmd/pacto@latest instead.

Uninstall

Pacto has no uninstaller. Remove the binaries, then the state they wrote:

# 1. The binaries (adjust the directory if you set PACTO_INSTALL_DIR, or use
#    ~/go/bin if you installed with `go install` or `make build`).
sudo rm -f /usr/local/bin/pacto \
           /usr/local/bin/pacto-plugin-schema-infer \
           /usr/local/bin/pacto-plugin-openapi-infer

# 2. Registry credentials and the update-check timestamp.
rm -rf ~/.config/pacto

# 3. The pulled-bundle cache.
rm -rf ~/.cache/pacto

The last two follow XDG_CONFIG_HOME and XDG_CACHE_HOME where you set them. Removing ~/.config/pacto deletes stored registry credentials; run pacto logout <registry> first if you would rather drop them one registry at a time.

Supply chain: signatures, provenance and checksums

Check what ships with each release artifact before you rely on a signature:

Artifact What ships with it
ghcr.io/trianalab/pacto/operator Cosign signature (keyless) and SLSA build provenance
ghcr.io/trianalab/pacto/charts/pacto-operator Cosign signature (keyless)
ghcr.io/trianalab/pacto/delivery Cosign signature (keyless) and SLSA build provenance
ghcr.io/trianalab/pacto/dashboard Cosign signature (keyless) and SLSA build provenance
ghcr.io/trianalab/pacto/external-catalog Cosign signature (keyless)
CLI binaries on the GitHub release checksums.txt (SHA-256), an SPDX SBOM and SLSA build provenance. No Cosign signature.
ghcr.io/trianalab/pacto/dashboard-contract Nothing. Unsigned.
The demo contract bundles (ghcr.io/trianalab/pacto/<service>) Nothing. Unsigned.

The release workflow signs the three images, the chart and the default external catalog with Cosign "keyless" signing: the signature is tied to the GitHub workflow that built the image, so you store no key. Verifying it proves who built it:

cosign verify \
  --certificate-identity-regexp '^https://github\.com/TrianaLab/pacto/\.github/workflows/release\.yml@' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  ghcr.io/trianalab/pacto/operator:<version>

A successful run prints the certificate subject and the workflow ref it was issued to. Any other output, including no signatures found, means do not deploy it.

Build provenance

The release workflow records SLSA build provenance as GitHub artifact attestations for the CLI binaries, checksums.txt and the three images. The provenance names the workflow, the run and the commit it built from. Verify a binary or an image with the GitHub CLI. First look up the commit the version's tag points at, then pass it to --source-digest. Use v<version> for the CLI and the dashboard, integrations/kubernetes/v<version> for the operator and delivery images:

sha="$(git ls-remote https://github.com/TrianaLab/pacto refs/tags/v<version> | cut -f1)"
gh attestation verify pacto_darwin_arm64 --repo TrianaLab/pacto \
  --cert-identity https://github.com/TrianaLab/pacto/.github/workflows/release.yml@refs/heads/main \
  --source-digest "${sha:?tag not found}" --deny-self-hosted-runners
k8s_sha="$(git ls-remote https://github.com/TrianaLab/pacto refs/tags/integrations/kubernetes/v<version> | cut -f1)"
gh attestation verify oci://ghcr.io/trianalab/pacto/operator:<version> --repo TrianaLab/pacto \
  --cert-identity https://github.com/TrianaLab/pacto/.github/workflows/release.yml@refs/heads/main \
  --source-digest "${k8s_sha:?tag not found}" --deny-self-hosted-runners

An empty --source-digest turns the commit check off without a warning. ${sha:?tag not found} stops the command when the tag lookup returned nothing. The identity pins the release workflow on main, and --source-digest pins the tag's commit.

The command exits with status 0 and prints ✓ Verification succeeded! when the provenance verifies. Any other exit status means do not run it. Scripts should check the exit status, or add --format json and read .[].verificationResult.statement.predicateType, which is https://slsa.dev/provenance/v1.

Core v4.5.0, Kubernetes v6.5.0 and earlier releases carry no attestation. The first attested release is the one whose core changelog or Kubernetes changelog entry announces SLSA build-provenance attestations.

To check that a download matches the release page, use the checksum:

shasum -a 256 -c checksums.txt --ignore-missing

pacto update performs the checksum check, and gh attestation verify proves who built the binary. For a release without an attestation, checksums.txt proves only that the download matches what the release published and says nothing about who built it, so build from source at the tag if that matters.


Next: Quickstart.