Skip to content

Install

pact is the command-line entry point to Pact Network. Most users start with pact pay — a drop-in replacement for solana-foundation/pay (pay.sh) that adds on-chain refunds on SLA failure. pact <url> also wraps a few curated providers directly for users who don’t speak x402 / MPP.

Single Node.js bundle (~340 kB compressed). Requires Node 18+.

Published as @q3labs/pact-cli. One package, no platform sub-dependencies — same install on every host.

Terminal window
pnpm add -g @q3labs/pact-cli

After install, pact --version should print 0.3.0.

Before any on-chain command (balance, approve, revoke, pact pay <tool>, pact <url>) will touch the protocol, set the closed-beta gate:

Terminal window
export PACT_MAINNET_ENABLED=1

A deliberate speed-bump: without the gate, every on-chain command short-circuits to a client_error envelope before any wallet or RPC side effect. Stops a first-invocation accident on the production program.

First run of a gateway-flow command (pact <url>) provisions per-project state at:

~/.config/pact/<project>/
├── wallet.json # keypair, mode 0600 — gateway flow only
├── policy.yaml # auto-approve caps
└── endpoints-cache.json # discovery cache

Project name resolves from --project$PACT_PROJECT → git repo name → cwd basename. If none produce a name, you get needs_project_name (exit 40); pass --project <name> to recover.

Terminal window
pact --version # 0.3.0
pact --help

To exercise an on-chain path without spending USDC, run pact balance --json (allowlisted wallet required).

  • Quickstart — drop-in pay curlpact pay curl, Market host-swap, and agent integration.
  • Commands — every subcommand with --json envelope examples.
  • Troubleshooting — common failure modes.