ONLINEDeliverability
Bento

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.



Learning Computer Streamline Icon: https://streamlinehq.com
Installation

Install the Bento CLI globally using npm or Bun:

Verify the installation:

bento --version

Learning Computer Streamline Icon: https://streamlinehq.com
Authentication

Before using the CLI, you need to authenticate with your Bento account.

1
Get Your API Credentials

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
2
Run the Login Command
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"
3
Verify Connection

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

Learning Computer Streamline Icon: https://streamlinehq.com
Command Reference

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

Learning Computer Streamline Icon: https://streamlinehq.com
Output Formats

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.


Learning Computer Streamline Icon: https://streamlinehq.com
Safety Features

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

Learning Computer Streamline Icon: https://streamlinehq.com
Scripting Examples

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

Learning Computer Streamline Icon: https://streamlinehq.com
Environment Variables

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.


Learning Computer Streamline Icon: https://streamlinehq.com
Troubleshooting

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 login again
  • Verify your API keys in the Bento dashboard
  • Check environment variables if using them

CSV import failing

Check your CSV format:

  • Must have an email column
  • Use UTF-8 encoding
  • No BOM (byte order mark) at the start
  • Try --dry-run first to see parsing results

Debug Mode

For detailed output, use the verbose flag:

Code

This shows the full API request and response for debugging.


Learning Computer Streamline Icon: https://streamlinehq.com
Quick Reference
CommandDescription
bento auth loginAuthenticate with Bento
bento auth statusCheck authentication status
bento auth logoutRemove 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 listList all tags
bento tags create <name>Create a new tag
bento fields listList custom fields
bento fields create <name>Create a custom field
bento events track --email <email> --event <name>Track an event
bento broadcasts listList broadcasts
bento broadcasts createCreate a broadcast draft
bento stats siteView account statistics

Global Flags

FlagDescription
--jsonOutput in JSON format
--quietSuppress non-error output
--verboseShow detailed debug info
--dry-runPreview without making changes
--confirmSkip confirmation prompts
--limit <n>Process only first N items

Learning Computer Streamline Icon: https://streamlinehq.com
Get Help