zend.shzend.sh
CLI
The `zend` CLI gives you the full platform from the command line — create campaigns, bulk-import leads, scale winning experiments, and pipe JSON anywhere. Install: npm i -g @zend-sh/cli.
# Install once
npm i -g @zend-sh/cli
# Create a campaign
zend campaigns create --name "Q1 Outreach"
# Import leads
zend leads import --file leads.csv --campaign-id $CAMPAIGN_ID
# Scale a winning experiment
zend scale --experiment "Q1 Outreach" --daily-target 500 \
--leads leads.csv --ramp-days 14
# Analytics — team-wide overview
zend analytics overview --json | jq '.data'Install
Install the binary globally, set your API key once — via the --api-key flag or ZEND_API_KEY env var — and point at any environment with --base-url or ZEND_BASE_URL. The --debug flag shows every request and retry.
npm i -g @zend-sh/cli
# Authenticate — flag > env > stored config
export ZEND_API_KEY=zk_live_...
# Verify — list campaigns
zend campaigns listCampaigns
Create, start, pause, and resume campaigns. Manage email steps, A/B variants, and assign mailboxes with rotation strategies — all from the terminal.
# Create a campaign
zend campaigns create --name "Q1 Outreach" --timezone "America/New_York"
# Add an email step
zend campaigns steps add $CAMPAIGN_ID \
--type email \
--subject "Quick question, {{first_name}}"
# Assign mailboxes with health-weighted rotation
zend campaigns accounts assign $CAMPAIGN_ID \
--account-ids $ACCT1 $ACCT2 $ACCT3 \
--rotation health_weighted
# Start sending
zend campaigns start $CAMPAIGN_IDLeads & scale
Import leads from a CSV file with a single command. When an experiment wins, scale it into a full ramped campaign with zend scale — specify daily target, ramp days, and your lead list. Use --dry-run to preview the plan first, --yes to skip the confirmation prompt in scripts.
# Import leads from CSV — returns imported / skipped counts
zend leads import --file leads.csv --campaign-id $CAMPAIGN_ID
# Scale a winning experiment into a ramped campaign
zend scale \
--experiment "Q1 Winner" \
--daily-target 500 \
--leads leads.csv \
--ramp-days 14
# Preview without creating anything
zend scale --experiment "Q1 Winner" --daily-target 500 --leads leads.csv --dry-run
# Non-interactive (CI-safe)
zend scale --experiment "Q1 Winner" --daily-target 500 --leads leads.csv --yesScripting
Every command supports --json so you can pipe output into jq, scripts, or any downstream tool. Combine with --yes for fully non-interactive automation in CI pipelines.
# Pipe campaign IDs into another command
zend campaigns list --json | jq '.[].id'
# Team-wide analytics summary as JSON
zend analytics overview --json | jq '.data'
# Export leads to file
zend leads export --campaign-id $CAMPAIGN_ID --output replied.csv
# Non-interactive scale in CI
zend scale --experiment "Winner" --daily-target 200 --leads batch.csv --yes --jsonPass --api-key <key> on any command, or set ZEND_API_KEY in your environment. The CLI resolves credentials in order: flag > env > stored config (via zend config set). Use --base-url or ZEND_BASE_URL to point at a custom environment.
Yes. --yes skips all confirmation prompts so commands run without user input. --json emits machine-readable output for piping into jq or other tools. Both flags are safe to combine: zend scale ... --yes --json.
The full command surface — campaigns, leads, scale, analytics, accounts, domains, experiments, placement, health, and more. Anything the zend REST API exposes is available via the CLI. Install with npm i -g @zend-sh/cli and run zend --help for the full list.
zend scale takes a winning experiment (by name or UUID), a CSV of lead UUIDs, a daily send target, and an optional ramp-days parameter (default 7). It calls the scale API endpoint which creates a new campaign with a ramp plan — starting below the target and stepping up each day. Pass --dry-run to preview the plan without creating anything.