peer-cli

Install and Runtime

Runtime prerequisites, local entrypoints, and the difference between source execution and the built artifact.

Runtime Baseline

peer-cli now assumes:

  • Node >=22
  • npm-compatible install flow
  • Base-compatible RPC connectivity for on-chain reads/writes
  • Optional external API keys depending on command family

Local Entrypoints

There are two practical ways to run the CLI locally.

Source mode

Use this while developing the CLI itself:

npm install
npm run build
npm run test:coverage
npm run dev -- --help

Equivalent direct source execution:

npx tsx src/cli.ts --help

Built artifact mode

Use this when validating the package behavior that a real install will expose:

npm run build
node dist/cli.cjs --help
node dist/cli.cjs quote --from USD --amount 100

The built artifact matters because packaging issues can appear there even when source execution works.

Environment Classes

peer-cli accepts three runtime environments:

  • production
  • preproduction
  • staging

Use --env <value> or the corresponding stored/env config.

Auth and Signing Inputs

Some command families only need network access. Others need a signer.

Signer resolution can come from:

  • --private-key
  • PEER_PRIVATE_KEY
  • --wallet-path
  • stored walletPath

Use --private-key only when unavoidable. It is visible in process listings.

Docs App Runtime

The docs app lives in peer-cli/docs and is separate from the CLI package.

Useful local commands:

npm --prefix docs install
npm --prefix docs run dev -- --hostname 127.0.0.1 --port 3007
npm --prefix docs run build
npm --prefix docs run types:check
npm --prefix docs run lint

When changing peer-cli itself:

npm run lint
npm run typecheck
npm run test:coverage
npm run build
node dist/cli.cjs --help

When changing the docs app:

npm --prefix docs run lint
npm --prefix docs run types:check
npm --prefix docs run build

On this page