Skip to main content

Sequenzy CLI

The Sequenzy CLI lets you manage subscribers, send emails, and view analytics directly from your terminal. It also exposes read-only localization data for companies and templates.

Installation

# Using npx (no install needed)
npx sequenzy --help

# Or install globally
npm install -g @sequenzy/cli

Authentication

Login

sequenzy login
This opens your browser to authenticate. Once approved, you’re logged in.

Check login status

sequenzy whoami

Logout

sequenzy logout

Commands

Subscribers

# List subscribers
sequenzy subscribers list
sequenzy subscribers list --tag vip
sequenzy subscribers list --segment active-users

# Add a subscriber
sequenzy subscribers add user@example.com
sequenzy subscribers add user@example.com --tag premium --attr name=John

# Get subscriber details
sequenzy subscribers get user@example.com

# Remove a subscriber
sequenzy subscribers remove user@example.com
sequenzy subscribers remove user@example.com --hard  # permanent delete

Send Email

Send transactional emails to single recipients:
# Using a template
sequenzy send user@example.com --template welcome --var name=John

# Using raw HTML
sequenzy send user@example.com --subject "Hello" --html "<h1>Hi!</h1>"

# From a file
sequenzy send user@example.com --subject "Report" --html-file ./email.html

Statistics

# Overview stats
sequenzy stats
sequenzy stats --period 30d

# Campaign stats
sequenzy stats --campaign camp_abc123

# Sequence stats
sequenzy stats --sequence seq_xyz789

Campaigns

# List campaigns
sequenzy campaigns list
sequenzy campaigns list --status draft

# Get campaign details
sequenzy campaigns get camp_abc123

# Create a draft campaign
sequenzy campaigns create --name "Launch" --subject "Big News!" --template launch

# Send test email
sequenzy campaigns test camp_abc123 --to me@example.com
Campaigns can only be created as drafts via CLI. Schedule and send from the dashboard.

Sequences

# List sequences
sequenzy sequences list

# Get sequence details
sequenzy sequences get seq_abc123

# Enable/disable
sequenzy sequences enable seq_abc123
sequenzy sequences disable seq_abc123

Templates

# List templates
sequenzy templates list
sequenzy templates list --company comp_abc123
sequenzy templates list --json

# Get template
sequenzy templates get tmpl_abc123
sequenzy templates get tmpl_abc123 --company comp_abc123 --json
templates list includes localization sync status by locale. templates get includes the full localized variants and the effective company localization config.

Companies

sequenzy companies list
sequenzy companies get comp_abc123
sequenzy companies get comp_abc123 --json
companies get includes the effective email localization settings for that company.

Segments

# List saved segments
sequenzy segments list

# Preview how many subscribers are in a segment
sequenzy segments count seg_abc123

# Create a Stripe-product segment
sequenzy segments create --name "Bought Pro" --stripe-product prod_pro

# Create a threshold-based Stripe-product segment
sequenzy segments create --name "3+ Pro Payments" \
  --stripe-product prod_pro \
  --purchase-operator at-least \
  --payments 3

# Create a segment from raw filter JSON
sequenzy segments create --name "Custom Filter" \
  --filter-json '[{"field":"stripeProduct","operator":"is","value":"prod_pro"}]'
For Stripe product segments, use the Stripe product ID, not the product name. The CLI maps:
  • bought -> field: "stripeProduct", operator: "is", value: "prod_xxx"
  • didnt-buy -> field: "stripeProduct", operator: "is_not", value: "prod_xxx"
  • at-least -> field: "stripeProduct", operator: "at_least", value: "prod_xxx:3"
  • less-than -> field: "stripeProduct", operator: "less_than_count", value: "prod_xxx:3"
--filter-json accepts the same filter shape used by the API and MCP. If you omit filter id values, the CLI fills them in automatically. tags and lists are not wired into the CLI yet.

Account

sequenzy account
sequenzy account --json
sequenzy websites

AI Generation

# Generate email
sequenzy generate email "Welcome email for new SaaS trial users"
sequenzy generate email "Product launch announcement" --style branded --tone professional

# Generate sequence
sequenzy generate sequence "Onboarding for SaaS trial users"
sequenzy generate sequence "Re-engagement for inactive users" --count 3 --days 7

# Generate subject lines
sequenzy generate subjects "Black Friday sale" --count 5

Environment Variables

VariableDescriptionDefault
SEQUENZY_API_URLAPI server URLhttps://api.sequenzy.com
SEQUENZY_APP_URLApp URL for authhttps://sequenzy.com

Config Location

The CLI stores configuration in:
  • macOS/Linux: ~/.config/sequenzy/config.json
  • Windows: %APPDATA%\sequenzy\config.json

Scripting

The CLI is designed to work well in scripts:
#!/bin/bash

# Import subscribers from CSV
while IFS=, read -r email name plan; do
  sequenzy subscribers add "$email" --attr "name=$name" --attr "plan=$plan"
done < subscribers.csv

# Check if logged in
if ! sequenzy whoami > /dev/null 2>&1; then
  echo "Not logged in"
  exit 1
fi

Exit Codes

CodeMeaning
0Success
1Error

Troubleshooting

”Not logged in”

Run sequenzy login to authenticate.

”API error: 401”

Your session may have expired. Run sequenzy login again.

Browser doesn’t open

Manually visit the URL shown in the terminal to complete authentication.