Bento CLI
Manage your Bento email marketing directly from the terminal.
The Bento CLI is a command-line interface that lets you interact with your Bento account without leaving the terminal. Search subscribers, import contacts from CSV files, manage tags, track events, and create broadcasts—all from the command line.
Perfect for automation scripts, CI/CD pipelines, or anyone who prefers working in the terminal.
Before you begin, make sure you have:
- A Bento account with API access
- Your Bento API credentials (Publishable Key, Secret Key, Site UUID)
- Node.js 18 or later installed on your machine
Install the Bento CLI globally using npm or Bun:
Verify the installation:
bento --version
Before using the CLI, you need to authenticate with your Bento account.
Log into your Bento account and go to Team Settings to find your API keys.
You'll need:
- Publishable Key:
pk_live_abc123... - Secret Key:
sk_live_xyz789... - Site UUID: Your unique site identifier
bento auth login
You'll be prompted to enter your credentials. They'll be stored securely for future use.
For scripting or CI/CD, you can pass credentials directly:
bento auth login \
--publishable-key "pk_live_..." \
--secret-key "sk_live_..." \
--site-uuid "your-site-uuid"
Test your authentication by listing your tags:
bento tags list
If you see your tags, you're all set!
Other Auth Commands
# Check authentication status
bento auth status
# Log out and remove stored credentials
bento auth logout
Subscribers
Manage your subscriber list from the command line.
Search Subscribers
bento subscribers search "john@example.com"
bento subscribers search "john"
Import from CSV
Import subscribers in bulk from a CSV file:
# Preview what will be imported (dry run)
bento subscribers import ./contacts.csv --dry-run
# Import with confirmation
bento subscribers import ./contacts.csv --confirm
# Limit to first N rows
bento subscribers import ./contacts.csv --limit 100 --confirm
CSV Format:
email,first_name,last_name,company
john@example.com,John,Doe,Acme Corp
jane@example.com,Jane,Smith,Widget Co
Manage Tags on Subscribers
# Add tags to a subscriber
bento subscribers tag john@example.com --add "VIP,newsletter"
# Remove tags from a subscriber
bento subscribers tag john@example.com --remove "trial"
Subscribe/Unsubscribe
bento subscribers subscribe john@example.com
bento subscribers unsubscribe john@example.com
Tags
View and create tags for organizing your subscribers.
List All Tags
bento tags list
Create a Tag
bento tags create "webinar-attendees"
bento tags create "vip-customers"
Custom Fields
Manage custom fields for storing additional subscriber data.
List Custom Fields
bento fields list
Create a Custom Field
bento fields create "company_name"
bento fields create "plan_type"
Events
Track custom events to trigger automations and record subscriber activity.
Track an Event
bento events track --email "user@example.com" --event "completed_onboarding"
# With additional details
bento events track \
--email "user@example.com" \
--event "completed_onboarding" \
--details '{"plan": "pro", "trial_days": 14}'
Broadcasts
Create and manage email broadcasts.
List Broadcasts
bento broadcasts list
Create a Broadcast Draft
bento broadcasts create \
--subject "Big Announcement!" \
--html ./email.html \
--tag "newsletter"
Statistics
Get an overview of your Bento account.
bento stats site
The CLI supports multiple output formats for integration with other tools.
Default (Human-Readable)
bento subscribers search "john"
Outputs a formatted table with colors.
JSON Output
bento subscribers search "john" --json
Perfect for piping to jq or processing in scripts:
bento subscribers search "john" --json | jq '.email'
Quiet Mode
bento subscribers import ./contacts.csv --confirm --quiet
Only outputs errors—useful for scripts and cron jobs.
The CLI includes built-in safety features for bulk operations:
Dry Run
Preview what will happen without making changes:
bento subscribers import ./contacts.csv --dry-run
Limit
Process only the first N items:
bento subscribers import ./contacts.csv --limit 10 --confirm
Confirmation
Bulk operations require explicit confirmation:
# This will prompt for confirmation
bento subscribers import ./contacts.csv
# Skip the prompt (for scripting)
bento subscribers import ./contacts.csv --confirm
Import Subscribers from Multiple CSVs
#!/bin/bash
for file in ./imports/*.csv; do
echo "Importing $file..."
bento subscribers import "$file" --confirm --quiet
done
echo "Done!"
Daily Stats Report
#!/bin/bash
# Add to crontab for daily reports
bento stats site --json > "/var/log/bento/stats-$(date +%Y-%m-%d).json"
Tag New Signups
#!/bin/bash
# Tag a new signup from your app
bento subscribers tag "$EMAIL" --add "new-signup,trial"
bento events track --email "$EMAIL" --event "signed_up" --details "{\"source\": \"$SOURCE\"}"
CI/CD Integration
# GitHub Actions example
- name: Import new subscribers
env:
BENTO_PUBLISHABLE_KEY: ${{ secrets.BENTO_PUBLISHABLE_KEY }}
BENTO_SECRET_KEY: ${{ secrets.BENTO_SECRET_KEY }}
BENTO_SITE_UUID: ${{ secrets.BENTO_SITE_UUID }}
run: |
npm install -g @bentonow/bento-cli
bento subscribers import ./new-subscribers.csv --confirm
Instead of using bento auth login, you can set environment variables:
export BENTO_PUBLISHABLE_KEY="pk_live_..."
export BENTO_SECRET_KEY="sk_live_..."
export BENTO_SITE_UUID="your-site-uuid"
Add these to your ~/.zshrc or ~/.bashrc for persistence, or use them in CI/CD pipelines.
Frequently Asked Questions
Find answers to common questions or contact our support team
Command not found: bento
The CLI isn't in your PATH.
- Try reinstalling:
npm install -g @bentonow/bento-cli - Check your npm global bin path:
npm bin -g - Ensure your PATH includes the npm global bin directory
Authentication failed
Your credentials are incorrect or expired.
- Run
bento auth loginagain - Verify your API keys in the Bento dashboard
- Check environment variables if using them
CSV import failing
Check your CSV format:
- Must have an
emailcolumn - Use UTF-8 encoding
- No BOM (byte order mark) at the start
- Try
--dry-runfirst to see parsing results
Debug Mode
For detailed output, use the verbose flag:
This shows the full API request and response for debugging.
| Command | Description |
|---|---|
bento auth login | Authenticate with Bento |
bento auth status | Check authentication status |
bento auth logout | Remove stored credentials |
bento subscribers search <query> | Search for subscribers |
bento subscribers import <file> | Import from CSV |
bento subscribers tag <email> --add <tags> | Add tags to subscriber |
bento tags list | List all tags |
bento tags create <name> | Create a new tag |
bento fields list | List custom fields |
bento fields create <name> | Create a custom field |
bento events track --email <email> --event <name> | Track an event |
bento broadcasts list | List broadcasts |
bento broadcasts create | Create a broadcast draft |
bento stats site | View account statistics |
Global Flags
| Flag | Description |
|---|---|
--json | Output in JSON format |
--quiet | Suppress non-error output |
--verbose | Show detailed debug info |
--dry-run | Preview without making changes |
--confirm | Skip confirmation prompts |
--limit <n> | Process only first N items |
- GitHub Repository: github.com/bentonow/bento-cli
- Issues & Feature Requests: github.com/bentonow/bento-cli/issues
- Discord: Join the community
- Email Support: support@bentonow.com
- Bento MCP Server - AI-powered email marketing with Claude, Cursor, and more
- Node.js SDK - Integrate Bento into your Node.js applications
- API Reference - Full API documentation
