CLI Reference (rsnc)
The Resonance CLI provides terminal access to all 45 Reward Agent tools. Build scripts, automate workflows, or explore the network from the command line.
Install
npm install -g @resonance/cli
Authentication
Most commands work without authentication. For authenticated commands (processing rewards, user data, program management), log in first:
rsnc auth login --key-id <your-key-id> --secret <your-secret>
Credentials are stored in ~/.rsnc/config.json. To check status or log out:
rsnc auth status
rsnc auth logout
Getting API Keys
- Log in to partners.rsnc.network
- Go to Settings → API Keys
- Generate an agent API key
- Note your Key ID and Secret
Output Modes
| Mode | Flag | Description |
|---|---|---|
| Pretty | (default) | Colored, human-readable output |
| JSON | --json | Raw JSON for piping to jq or scripts |
| Table | (auto) | Auto-detected for array responses |
# Pretty output (default)
rsnc network info
# JSON output for scripting
rsnc network info --json
# Pipe to jq
rsnc brands --json | jq '.data.brands[].name'
Commands
rsnc auth — Authentication
rsnc auth login --key-id <id> --secret <secret> # Store credentials
rsnc auth logout # Remove credentials
rsnc auth status # Check auth status
rsnc network — Network Discovery
rsnc network info # Network configuration
rsnc network stats # Active brands, users, rewards
rsnc network brands [--category retail] [--limit 10] # List brands
rsnc network check <query> # Check if brand is on network
rsnc network rankings [--category retail] [--limit 10] # Brand rankings
Examples:
# List all retail brands
rsnc network brands --category retail
# Check if Nike is on the network
rsnc network check nike.com
rsnc brand — Brand Details
rsnc brand info <brandId> # Program details
rsnc brand perks <brandId> [--category discount] # Available perks
rsnc brand leaderboard <brandId> [--metric rsnc_earned] [--period monthly] [--limit 10]
Examples:
# View brand reward program
rsnc brand info 0xABC123
# See top earners this month
rsnc brand leaderboard 0xABC123 --metric rsnc_earned --period monthly
rsnc user — User Data (Auth Required)
rsnc user balance <userId> <brandId> # Check balance
rsnc user stats <userId> <brandId> # Full reward profile
rsnc user portfolio <userId> # Cross-brand portfolio
Examples:
# Check user balance at a brand
rsnc user balance [email protected] 0xABC123
# View cross-brand portfolio
rsnc user portfolio [email protected]
rsnc rewards — Process Rewards (Auth Required)
rsnc rewards track --brandId <id> --eventType purchase --userId <email> [--metadata '{}']
rsnc rewards bulk --file events.json
Examples:
# Record a purchase event
rsnc rewards track --brandId 0xABC --eventType purchase --userId [email protected]
# Bulk process from file
rsnc rewards bulk --file ./batch-events.json
rsnc perks — Browse & Redeem
rsnc perks browse [--category discount] [--maxPrice 5000] [--brandId 0xABC] [--limit 20]
rsnc perks redeem --perkId <id> --userId <email> --brandId <id> # Auth required
rsnc analytics — Performance Metrics
rsnc analytics network [--period 30d] # Network-wide analytics
rsnc analytics brand <brandId> [--period 30d] # Brand analytics
rsnc analytics events <brandId> [--period 30d] # Event performance
rsnc analytics perks <brandId> # Perk analytics
rsnc analytics health <brandId> # Program health score
Examples:
# Get brand health score
rsnc analytics health 0xABC123
# View network trends over 90 days
rsnc analytics network --period 90d
rsnc manage — Program Management (Auth + canManageProgram)
rsnc manage event-create --brandId <id> --eventType purchase --rewardAmount 10 [--cooldownHours 24]
rsnc manage event-update --brandId <id> --eventId <id> [--rewardAmount 15] [--enabled true]
rsnc manage perk-create --brandId <id> --name "10% Off" --description "..." --priceInPoints 500 --maxSupply 100
rsnc manage perk-update --brandId <id> --collectionId <id> [--priceInPoints 400] [--isActive true]
rsnc commerce — Purchase Routing & Deals
rsnc commerce route <intent> [--category retail] [--purchaseAmount 150] [--userId <email>]
rsnc commerce stack --brandId <id> --purchaseAmount 75 --userId <email> # Auth required
rsnc commerce deals <intent> [--category retail] [--userId <email>] [--budget 5000] [--limit 10]
rsnc commerce compare --brand-ids 0xAAA,0xBBB,0xCCC [--period 30d]
rsnc commerce compare-cashback --purchase-amount 100 [--brand-ids 0xAAA,0xBBB] [--category retail]
Examples:
# Find best brand for running shoes
rsnc commerce route "running shoes" --purchaseAmount 150
# Compare cashback across retail brands
rsnc commerce compare-cashback --purchase-amount 100 --category retail
# Stack deals at a specific brand
rsnc commerce stack --brandId 0xABC --purchaseAmount 75 --userId [email protected]
rsnc intel — Intelligence (User tools: Auth Required)
rsnc intel persona <userId> # Auth required
rsnc intel recommendations <userId> [--limit 5] # Auth required
rsnc intel perk-intel <brandId> # Public
rsnc intel perk-audience <brandId> <collectionId> # Public
rsnc intel brand-audience <brandId> # Public
Examples:
# Get user behavioral profile
rsnc intel persona [email protected]
# Get perk optimization insights
rsnc intel perk-intel 0xABC123
# See who's claiming a specific perk
rsnc intel perk-audience 0xABC123 42
rsnc onboard — Brand Onboarding (Auth + canOnboard)
rsnc onboard brand --brandAddress 0xDEF --businessName "Acme" --contactEmail [email protected] [--website https://acme.com]
rsnc onboard keys --action rotate --brandId 0xDEF
rsnc agent — Agent Rewards (Auth Required)
rsnc agent rewards # Check your agent earnings
rsnc agent claim --rewardType discovery --brandAddress 0xABC
rsnc netintel — Network Intelligence
rsnc netintel flows [--period 30d] # Cross-brand user flows
rsnc netintel trending [--period 7d] [--limit 10] # Trending categories
rsnc netintel suggest-events <brandId> # AI event suggestions
rsnc netintel suggest-perks <brandId> # AI perk suggestions
Examples:
# See trending categories
rsnc netintel trending --period 7d
# Get AI suggestions for a brand
rsnc netintel suggest-events 0xABC123
rsnc netintel suggest-perks 0xABC123
rsnc growth — Business Evaluation
rsnc growth estimate-roi --industry retail [--monthlyCustomers 5000] [--averageOrderValue 75]
rsnc growth request-info --businessName "Acme" --contactEmail [email protected] [--website https://acme.com]
rsnc converse — Natural Language Queries (Auth + Pro/Enterprise)
rsnc converse "Which brand gives the best cashback for coffee?"
rsnc converse "How healthy is my reward program?" --context '{"brandId":"0xABC"}'
See Converse for full documentation.
Scripting Examples
Monitor brand health daily
#!/bin/bash
BRAND="0xABC123"
HEALTH=$(rsnc analytics health $BRAND --json | jq '.data.score')
echo "Brand health: $HEALTH/100"
if [ "$HEALTH" -lt 50 ]; then
echo "WARNING: Brand health is low!"
fi
Batch process events from CSV
while IFS=, read -r email event_type; do
rsnc rewards track --brandId 0xABC --eventType "$event_type" --userId "$email"
done < events.csv
Compare all retail brands
BRANDS=$(rsnc network brands --category retail --json | jq -r '.data.brands[].brandId' | head -5 | paste -sd,)
rsnc commerce compare --brand-ids "$BRANDS"
Configuration
The CLI stores configuration in ~/.rsnc/config.json:
{
"endpoint": "https://agent.rsnc.network",
"keyId": "your-key-id",
"secret": "your-secret"
}
| Field | Default | Description |
|---|---|---|
endpoint | https://agent.rsnc.network | Agent base URL |
keyId | — | Agent API key ID |
secret | — | Agent API secret |