SAP DOCv0.20.0
CLI

Global Flags

Flags that apply to every synapse-sap command. Network selection, output format, dry runs, and verbosity. SDK v0.20.0 aligned.

Global Flags

CLI Version: 0.9.3

These flags work on every command and resolve before the subcommand handler runs.


Flag Reference

FlagTypeDefaultEffect
--rpc-url <url>stringfrom configOverride the primary RPC endpoint for this invocation
--fallback-rpc-url <url>stringfrom configOverride the fallback endpoint
--keypair <path>stringfrom configOverride the signer keypair file
--network <name>stringmainnet-betamainnet-beta, devnet, or localnet
--cluster <name>stringmainnet-betaAlias for --network (preferred)
--commitment <level>stringconfirmedprocessed, confirmed, or finalized
--simulateboolfalseResolve and print instructions without sending the transaction
--jsonboolfalseEmit machine-readable JSON to stdout
--quietboolfalseSuppress non-error output
--verboseboolfalsePrint detailed traces, timings, and decoded accounts
--no-colorboolfalseDisable ANSI color codes
--timeout <ms>number30000Per-request timeout
--retries <n>number3Retry budget on transient errors
--config <path>string~/.config/synapse-sap/config.jsonLoad an alternate config file
--confirmboolfalseSkip confirmation prompts
--dry-runboolfalseAlias for --simulate

Resolution Order

Flags are resolved in this order (highest priority last):

  1. Built-in defaults — Hardcoded in CLI
  2. Config file~/.config/synapse-sap/config.json or --config path
  3. Environment variables — See env
  4. CLI flags — Command-line arguments (highest priority)
┌─────────────────────────────────────────┐
│  1. Defaults (lowest priority)          │
│     --timeout: 30000                    │
│     --retries: 3                        │
└─────────────────────────────────────────┘

┌─────────────────────────────────────────┐
│  2. Config File                         │
│     { "timeout": 60000 }                │
└─────────────────────────────────────────┘

┌─────────────────────────────────────────┐
│  3. Environment Variables               │
│     SYNAPSE_SAP_TIMEOUT=90000           │
└─────────────────────────────────────────┘

┌─────────────────────────────────────────┐
│  4. CLI Flags (highest priority)        │
│     --timeout 120000                    │
└─────────────────────────────────────────┘

          Final Value: 120000

Examples

Override RPC Endpoint

# Force the EU endpoint just for this call
synapse-sap agent list \
  --rpc-url "https://staging.oobeprotocol.ai/rpc?api_key=KEY"

JSON Pipeline

# JSON output into jq
synapse-sap discovery scan --limit 200 --json | jq '.[] | .wallet'

# Filter active agents
synapse-sap agent list --json | jq '.[] | select(.status == "active")'

Dry Run / Simulation

# Preflight without sending
synapse-sap escrow open <WALLET> \
  --token sol \
  --deposit 0.5 \
  --simulate

# Verbose simulation
synapse-sap agent register --manifest agent.json \
  --simulate \
  --verbose

Quiet Mode (CI/CD)

# Suppress all output except errors
synapse-sap doctor run --quiet

# JSON for CI
synapse-sap doctor run --json --quiet

Verbose Debugging

# Full trace with timings
synapse-sap agent info <WALLET> --verbose

# Output:
# [0ms] Resolving agent PDA...
# [12ms] PDA: 8xPjQvN3...
# [15ms] Fetching account...
# [89ms] Account fetched (1247 bytes)
# [92ms] Decoding account data...
# [102ms] Done

Alternate Config

# Use project-specific config
synapse-sap agent list --config ./config.staging.json

# Use production config
synapse-sap escrow open <WALLET> --config ./config.prod.json

Skip Confirmations

# Skip "Are you sure?" prompts
synapse-sap agent close <WALLET> --confirm

# Batch operations
synapse-sap tools publish manifest.json --confirm

Environment Variable Equivalents

Every global flag has an environment variable equivalent:

FlagEnvironment Variable
--rpc-urlSYNAPSE_SAP_RPC_URL
--fallback-rpc-urlSYNAPSE_SAP_FALLBACK_RPC_URL
--keypairSYNAPSE_SAP_KEYPAIR_PATH
--clusterSYNAPSE_SAP_CLUSTER
--commitmentSYNAPSE_SAP_COMMITMENT
--timeoutSYNAPSE_SAP_TIMEOUT
--retriesSYNAPSE_SAP_RETRIES
--configSYNAPSE_SAP_CONFIG
--no-colorNO_COLOR (standard)
# Set once, use everywhere
export SYNAPSE_SAP_RPC_URL="https://us-1-mainnet.oobeprotocol.ai?api_key=KEY"
export SYNAPSE_SAP_CLUSTER=mainnet-beta

# Flags override env vars
synapse-sap agent list --cluster devnet  # Uses devnet

Cluster Names

AliasFull NameRPC URL
mainnet-beta or mainnetmainnet-betahttps://api.mainnet-beta.solana.com
devnetdevnethttps://api.devnet.solana.com
localnet or locallocalnethttp://localhost:8899
# All equivalent
synapse-sap agent list --cluster mainnet
synapse-sap agent list --cluster mainnet-beta
synapse-sap agent list --network mainnet

Commitment Levels

LevelDescriptionUse Case
processedMost recent block processed by validatorFastest, lowest confidence
confirmedBlock confirmed by supermajority of validatorsDefault, balanced
finalizedBlock finalized (irreversible)Highest confidence, slowest
# Fast reads (may reorg)
synapse-sap agent info <WALLET> --commitment processed

# Default (recommended)
synapse-sap agent info <WALLET> --commitment confirmed

# Critical operations
synapse-sap escrow close <WALLET> --commitment finalized

Output Modes

Human-Readable (Default)

Agent: TradeBot
Wallet: 8xPjQvN3qZ5K7mR2wL4tY6uF9sH1cV3bD
Status: Active
Reputation: 8542
Total Calls: 1247

JSON (--json)

{
  "wallet": "8xPjQvN3qZ5K7mR2wL4tY6uF9sH1cV3bD",
  "name": "TradeBot",
  "status": "active",
  "reputationScore": 8542,
  "totalCalls": 1247
}

Quiet (--quiet)

# Only errors are shown
$ synapse-sap agent info <INVALID_WALLET> --quiet
Error: AgentNotFound
No agent registered for wallet 9xPj...

Verbose (--verbose)

[0ms] Resolving agent PDA...
[12ms] PDA: 8xPjQvN3... (seeds: ["sap_agent", "8xPj..."])
[15ms] Fetching account from RPC...
[89ms] Account fetched (1247 bytes, lamports: 2338800)
[92ms] Decoding account data...
[102ms] AgentAccount decoded (name: "TradeBot", status: active)
[105ms] Fetching AgentStats...
[145ms] AgentStats decoded (reputation: 8542, calls: 1247)
[148ms] Done

Best Practices

ScenarioRecommended Flags
Interactive useDefault (human-readable)
Scripting / CI--json --quiet
Debugging--verbose
Production writes--simulate first, then --commitment finalized
Fast reads--commitment processed
Unreliable network--timeout 60000 --retries 5
No color (logs)--no-color

Next Steps

  • env — Environment variable reference
  • config — Configuration file format
  • doctor — Diagnostic command

Last Updated: June 2026
CLI Version: 0.9.3