Skip to main content
The Snack Money CLI can be installed in multiple ways. Choose the method that works best for your workflow. The simplest way to use the CLI is with npx - no installation required:
npx snackmoney --help
This automatically downloads and runs the latest version. Perfect for:
  • One-time usage
  • Quick testing
  • CI/CD pipelines
  • Avoiding global installs

Example Usage

# Send a payment
npx snackmoney send x/username 0.01

# View help
npx snackmoney --help

# Check version
npx snackmoney --version

npm Global Installation

Install globally with npm to use the snackmoney command directly:
npm install -g snackmoney
After installation, you can run commands without npx:
snackmoney send x/username 0.01
snackmoney batch-send ./payments.json
snackmoney --help

Updating

Keep the CLI up to date:
npm update -g snackmoney

Uninstalling

Remove the global installation:
npm uninstall -g snackmoney

Homebrew (macOS/Linux)

Install via Homebrew for system-level package management:
# Add the Snack Money tap
brew tap snack-money/tap

# Install the CLI
brew install snackmoney
After installation:
snackmoney --help

Updating

brew update
brew upgrade snackmoney

Uninstalling

brew uninstall snackmoney
brew untap snack-money/tap

Prerequisites

Regardless of installation method, you need:

1. Node.js

  • Version: Node.js 20 or higher
  • Check version: node --version
  • Install: nodejs.org or use nvm

2. Private Key

You need a private key for the blockchain network you want to use: For Base (EVM):
export EVM_PRIVATE_KEY="0x..."
For Solana (SVM):
export SVM_PRIVATE_KEY="your_base58_private_key"
Important Security Notes:
  • Never commit private keys to version control
  • Use environment variables or .env files
  • Keep your keys secure and backed up
  • Only fund with amounts you’re willing to use

3. USDC Balance

Ensure your wallet has sufficient USDC on the network you’re using:
  • Base: USDC on Base mainnet
  • Solana: USDC on Solana mainnet
You can check your balance at:

Environment Setup

Create a .env file in your project directory:
# For Base network
EVM_PRIVATE_KEY=0x1234567890abcdef...

# For Solana network
SVM_PRIVATE_KEY=5Jx7Ry8...

# Optional: AI features (Anthropic or OpenAI)
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
The CLI will automatically load variables from .env files in the current directory.

Verifying Installation

Test your installation:
# Check version
npx snackmoney --version

# View help
npx snackmoney --help

# List available commands
npx snackmoney
Expected output:
Commands:
  send                  Send USDC to a single user
  batch-send            Send USDC to multiple users
  ai-agent              AI-powered payment agent

Options:
  --version             Show version number
  --help                Show help

Troubleshooting

”command not found: snackmoney”

If using global installation, ensure npm global bin is in your PATH:
# Check npm global bin location
npm bin -g

# Add to PATH (add to ~/.bashrc or ~/.zshrc)
export PATH="$(npm bin -g):$PATH"

Permission Errors (macOS/Linux)

If you encounter permission errors with global npm install:
# Option 1: Use npx instead (recommended)
npx snackmoney

# Option 2: Fix npm permissions
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

Node Version Issues

If you have an older Node.js version:
# Using nvm (recommended)
nvm install 20
nvm use 20

# Verify
node --version

Next Steps

Now that you have the CLI installed:
  1. Quick Start - Send your first payment
  2. Commands - Learn all available commands
  3. View on GitHub - Source code and examples