peer-cli

Configuration

Config precedence, persistent files, wallet resolution, and what auth each command family expects.

Precedence Order

Configuration is resolved in this order:

  1. Explicit CLI flags
  2. Environment variables
  3. Stored config in ~/.peer/config.json
  4. Built-in defaults

That precedence matters because an agent can run under a shell with stale env vars and still appear “configured”.

Persistent Files

FilePurpose
~/.peer/config.jsonPersistent configuration for RPC, env, formatting, API URLs, and optional secrets
~/.peer/checkout-sessions.jsonLocal cache used by checkout list/show flows

Common Global Flags

FlagMeaning
--envRuntime environment
--formatjson or table
--rpc-urlOverride Base RPC
--api-keyCurator API key for SDK-backed authenticated routes
--indexer-keyIndexer API key
--market-api-keyPeerlytics API key
--pay-api-keyPay API key
--base-api-url / --market-base-url / --pay-base-urlService endpoint overrides
--private-key / --wallet-pathSigner resolution
--yesExecute writes without staying in preview
--debugVerbose debug logs

Auth Model By Surface

SurfaceTypical auth requirement
quote, market, pv, indexer, oracle supports-inline, oracle validate-feeds, balance, config show/platforms/currencies, mcpNo signer required
payee, authenticated indexer or checkout reads, some SDK-backed readsMay require API keys
deposit, intent, vault, delegate, undelegate, transfer, checkout create/cancelRequires signer for execution

Wallet Resolution

The wallet helper resolves account material only when a command requires it.

Implications:

  • A command can succeed without a wallet if it is read-only.
  • A signer-required command fails with AUTH_REQUIRED when no account can be resolved.
  • Read-only MCP can run without live signing material.

Stored Config Commands

The CLI exposes config helpers instead of forcing direct file edits:

peer config show
peer config set --key env --value staging
peer config platforms
peer config currencies

Use these for scripted bootstrapping when you want the environment to persist across sessions.

Agent Recommendations

  • Prefer flags for ephemeral runs and one-off corrections.
  • Prefer stored config for workstation-style agents that run repeatedly.
  • Prefer environment variables for secret injection in CI or server environments.
  • Never assume a missing API key means a command is unsupported; it may only mean the selected route needs credentials.

On this page