> ## Documentation Index
> Fetch the complete documentation index at: https://docs.privacyboost.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Quickstart

> Get started with Privacy Boost CLI in 5 minutes

# CLI Quickstart

Use the command-line tool for scripting, automation, and testing private transfers.

<Info>
  This quickstart gets you running in 5 minutes with minimal explanation. For detailed walkthroughs of each command, see the [CLI Getting Started guide](/sdk/cli/getting-started). For background on configuration and auth options, see [Setup](/sdk/concepts/app-setup).
</Info>

## Installation

### From Binary

Head to [https://github.com/sunnyside-io/privacy-boost-sdk/releases](https://github.com/sunnyside-io/privacy-boost-sdk/releases) to download the latest release for your platform.

```bash theme={null}
# macOS (Apple Silicon)
curl -L https://github.com/sunnyside-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/sunnyside-io/privacy-boost-sdk/releases/latest/download/privacy-boost-darwin-x64.tar.gz | tar xz
sudo mv privacy-boost /usr/local/bin/

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

# Linux (ARM64)
curl -L https://github.com/sunnyside-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`:

```toml theme={null}
# Network configuration
server_url = "https://optimism.sepolia.privacyboost.io"
weth_contract_address = "0x4200000000000000000000000000000000000006"
rpc_url = "https://sepolia.optimism.io"
timeout_secs = 30
```

```bash theme={null}
# 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

```bash theme={null}
# 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

```bash theme={null}
# Check shielded balance for a token
privacy-boost balance --token 0x...token-address

# Check all balances
privacy-boost balances
```

### 4. Deposit

`--amount` defaults to **wei** (smallest unit). Pass `--human` to interpret the value as a decimal token amount instead — the CLI parses it using the token's `decimals`.

```bash theme={null}
# Deposit tokens (amount in wei — 1 token at 18 decimals)
privacy-boost shield \
  --token 0x...token-address \
  --amount 1000000000000000000

# Same deposit, expressed as a human-readable amount
privacy-boost shield \
  --token 0x...token-address \
  --amount 1.0 \
  --human
```

### 5. Transfer

```bash theme={null}
# Send privately to another privacy address
privacy-boost send \
  --recipient 0x04...recipient-privacy-address \
  --token 0x...token-address \
  --amount 500000000000000000
```

### 6. Withdraw

```bash theme={null}
# Withdraw to a public address
privacy-boost unshield \
  --token 0x...token-address \
  --amount 250000000000000000 \
  --recipient 0x...recipient-address
```

### 7. View History

```bash theme={null}
# 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`:

```toml theme={null}
server_url = "https://optimism.sepolia.privacyboost.io"
weth_contract_address = "0x4200000000000000000000000000000000000006"
```

Or initialize with a preset:

```bash theme={null}
privacy-boost init --network op-sepolia
```

## Session Management

```bash theme={null}
# Sessions are saved automatically on login.
# List saved sessions:
privacy-boost sessions

# Logout and clear session:
privacy-boost logout
```

## Scripting Example

```bash theme={null}
#!/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 shield --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:

```bash theme={null}
# 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

| Variable                | Description              |
| ----------------------- | ------------------------ |
| `PRIVATE_KEY`           | Wallet private key       |
| `SERVER_URL`            | Privacy Boost server URL |
| `RPC_URL`               | RPC URL                  |
| `WETH_CONTRACT_ADDRESS` | WETH contract address    |

## Next Steps

<CardGroup cols={2}>
  <Card title="CLI Getting Started" href="/sdk/cli/getting-started">
    Detailed walkthrough of all commands and workflows
  </Card>

  <Card title="Setup Guide" href="/sdk/concepts/app-setup">
    App ID, configuration, and auth method selection
  </Card>

  <Card title="Commands Reference" href="/sdk/cli/guides/commands">
    Complete command documentation
  </Card>

  <Card title="Configuration" href="/sdk/concepts/configuration">
    Environment variables and network configuration
  </Card>
</CardGroup>
