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+.
Package install
Section titled “Package install”Published as @q3labs/pact-cli.
One package, no platform sub-dependencies — same install on every host.
pnpm add -g @q3labs/pact-clinpm install -g @q3labs/pact-clibun add -g @q3labs/pact-cliAfter install, pact --version should print 0.3.0.
Required environment
Section titled “Required environment”Before any on-chain command (balance, approve, revoke,
pact pay <tool>, pact <url>) will touch the protocol, set the
closed-beta gate:
export PACT_MAINNET_ENABLED=1A 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.
What gets created on first run
Section titled “What gets created on first run”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 cacheProject 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.
Verifying the install
Section titled “Verifying the install”pact --version # 0.3.0pact --helpTo exercise an on-chain path without spending USDC, run
pact balance --json (allowlisted wallet required).
What’s next
Section titled “What’s next”- Quickstart — drop-in
pay curl→pact pay curl, Market host-swap, and agent integration. - Commands — every subcommand with
--jsonenvelope examples. - Troubleshooting — common failure modes.