BerryPay CLI
Nano (XNO) cryptocurrency wallet CLI designed for AI agents and automated payment processing.
Features
- No passwords - Designed for automation, no interactive prompts
- Environment variables - Configure via
BERRYPAY_SEED for AI agents
- JSON output - All commands output JSON for easy parsing
- Payment processor - Ephemeral addresses, auto-sweep to main wallet
- Webhooks - Get notified when payments complete
- Auto-receive - Pending funds received automatically
- Real-time - WebSocket-based payment confirmations
- Persistent - Charges survive restarts
Installation
npm install -g berrypay
Quick Start
berrypay init
export BERRYPAY_SEED=your64charhexseed
berrypay address
berrypay balance
berrypay send nano_1abc... 0.1 --yes
berrypay receive
Environment Variables
BERRYPAY_SEED
BERRYPAY_RPC_URL
BERRYPAY_WS_URL
Payment Processor
Accept payments with auto-generated ephemeral addresses:
berrypay charge create 0.5 --webhook http://localhost:3000/callback
berrypay charge create 0.5 \
--webhook http://localhost:3000/callback \
--metadata '{"orderId": "123"}'
berrypay charge create 0.5 --qr --output /tmp/payment.png
berrypay charge status chg_abc123
berrypay charge list
berrypay charge listener
berrypay charge stop
Flow
1. charge create 1.0 → Ephemeral address generated, listener auto-starts
2. Customer pays → WebSocket detects payment
3. Auto-receive → Pending blocks received
4. Auto-sweep → Funds sent to main wallet (index 0)
5. Webhook called → Your server notified with charge details
6. Auto-stop → Listener stops when no active charges
Webhook Payload
{
"event": "charge.completed",
"charge": {
"id": "chg_abc123",
"address": "nano_3ephemeral...",
"amountNano": "0.5",
"sweepTxHash": "ABC123...",
"metadata": {"orderId": "123"}
},
"timestamp": "2026-01-30T12:00:00.000Z"
}
All Commands
berrypay init
berrypay import <seed>
berrypay address [--qr]
berrypay balance [--json]
berrypay send <addr> <amt> [-y]
berrypay receive
berrypay watch
berrypay export
berrypay delete [-y]
berrypay config
berrypay charge create <amt>
berrypay charge status <id>
berrypay charge sweep <id>
berrypay charge list
berrypay charge listener
berrypay charge stop
berrypay charge cleanup
Programmatic Usage
import { BerryPayWallet, PaymentProcessor } from 'berrypay';
const wallet = new BerryPayWallet({ seed: process.env.BERRYPAY_SEED });
await wallet.send('nano_1...', BerryPayWallet.nanoToRaw('0.1'));
const processor = new PaymentProcessor({ wallet, autoSweep: true });
processor.on('charge:completed', (charge) => console.log('Paid!', charge.id));
processor.on('charge:swept', ({ hash }) => console.log('Swept:', hash));
await processor.start();
const charge = await processor.createCharge({
amountNano: '1.0',
webhookUrl: 'http://localhost:3000/callback',
metadata: { orderId: '123' }
});
AI Agent Skill Guide
See skills/berrypay/SKILLS.md for a comprehensive guide on using BerryPay CLI as an AI agent.
Storage
- Config:
~/.berrypay/config.json
- Charges:
~/.berrypay/charges.json
- Listener PID:
~/.berrypay/listener.pid
License
MIT