Skip to main content

CLI Quickstart

Use the command-line tool for scripting, automation, and testing private transfers.
This quickstart gets you running in 5 minutes with minimal explanation. For detailed walkthroughs of each command, see the CLI Getting Started guide. For background on configuration and auth options, see Setup.

Installation

From Binary

Head to https://github.com/testinprod-io/privacy-boost-sdk/releases to download the latest release for your platform.
# macOS (Apple Silicon)
curl -L https://github.com/testinprod-io/privacy-boost-sdk/releases/latest/download/privacy-boost-darwin-arm64.tar.gz | tar xz
sudo mv privacy-boost /usr/local/bin/

# macOS (Intel)
curl -L https://github.com/testinprod-io/privacy-boost-sdk/releases/latest/download/privacy-boost-darwin-amd64.tar.gz | tar xz
sudo mv privacy-boost /usr/local/bin/

# Linux (x86_64)
curl -L https://github.com/testinprod-io/privacy-boost-sdk/releases/latest/download/privacy-boost-linux-amd64.tar.gz | tar xz
sudo mv privacy-boost /usr/local/bin/

# Linux (ARM64)
curl -L https://github.com/testinprod-io/privacy-boost-sdk/releases/latest/download/privacy-boost-linux-arm64.tar.gz | tar xz
sudo mv privacy-boost /usr/local/bin/

Quick Example

1. Login with Private Key

Create a configuration file at ~/.privacy-boost/config.toml:
# Network configuration
indexer_url = "https://test-api.privacy-boost.sunnyside.io/indexer"
weth_contract = "0x4200000000000000000000000000000000000006"
rpc_url = "https://eth.llamarpc.com"
timeout_secs = 30
# Set your private key (do not use in production scripts!)
export PRIVATE_KEY="0x..."

# Login (connects wallet, derives privacy keys, authenticates)
privacy-boost login

2. Check Status

# View connection status and privacy address
privacy-boost status
Output:
Status
  Connected:     Yes
  Authenticated: Yes
  Wallet Address:  0x1234...5678
  Privacy Address: 0x9abc...def0

3. Check Balance

# Check shielded balance for a token
privacy-boost balance --token 0x...token-address

# Check all balances
privacy-boost balances

4. Deposit

# Deposit tokens (amount in wei)
privacy-boost deposit \
  --token 0x...token-address \
  --amount 1000000000000000000

# Deposit with human-readable amount
privacy-boost deposit \
  --token 0x...token-address \
  --amount 1.0 \
  --human

5. Transfer

# Send privately to another privacy address
privacy-boost send \
  --recipient 0x04...recipient-privacy-address \
  --token 0x...token-address \
  --amount 500000000000000000

6. Withdraw

# Withdraw to a public address
privacy-boost withdraw \
  --token 0x...token-address \
  --amount 250000000000000000 \
  --recipient 0x...recipient-address

7. View History

# View recent transactions
privacy-boost history

# Filter by type
privacy-boost history --tx-type shield
privacy-boost history --tx-type transact
privacy-boost history --tx-type unshield

Configuration File

Create ~/.privacy-boost/config.toml:
indexer_url = "https://test-api.privacy-boost.sunnyside.io/indexer"
weth_contract = "0x4200000000000000000000000000000000000006"
Or initialize with a preset:
privacy-boost init --network op-sepolia

Session Management

# Sessions are saved automatically on login.
# List saved sessions:
privacy-boost sessions

# Logout and clear session:
privacy-boost logout

Scripting Example

#!/bin/bash
set -e

# Login (uses PRIVATE_KEY env var automatically)
privacy-boost login --network op-sepolia

# Deposit if balance is low
BALANCE=$(privacy-boost balance --token "$TOKEN" --output json | jq -r '.shielded_balance')
if [ "$BALANCE" -lt "1000000000000000000" ]; then
    privacy-boost deposit --token "$TOKEN" --amount 10000000000000000000
fi

# Daily transfer
privacy-boost send \
  --recipient "$RECIPIENT" \
  --token "$TOKEN" \
  --amount 100000000000000000

echo "Daily transfer complete!"

JSON Output

Use --output json (or -o json) for machine-readable output:
# Get balance as JSON
privacy-boost balance --token 0x... --output json

# Parse with jq
privacy-boost balance --token 0x... -o json | jq '.shielded_balance'

Environment Variables

VariableDescription
PRIVATE_KEYWallet private key
INDEXER_URLIndexer URL
RPC_URLRPC URL
WETH_CONTRACTWETH contract address

Next Steps

CLI Getting Started

Detailed walkthrough of all commands and workflows

Setup Guide

App ID, configuration, and auth method selection

Commands Reference

Complete command documentation

Configuration

Environment variables and network configuration