Skip to main content

Sequenzy CLI

The Sequenzy CLI lets you manage subscribers, run campaigns, send emails, manage your team, triage inbox replies, operate outbound webhooks, and view analytics directly from your terminal. It also lets you inspect, supply, and AI-sync localized template variants.

Installation

Use the scoped package name for one-off runs: npx @sequenzy/cli ... or bunx @sequenzy/cli .... The unscoped sequenzy package is the TypeScript API library and does not expose a CLI binary.

Using the CLI with AI agents

If an AI agent will run the CLI for you, also install the Sequenzy skill. It gives your agent a versioned workflow guide for operating the CLI safely:
Learn more in the Skills documentation.

Authentication

Login

This prints a login URL and approval code in the terminal. Open the link in any browser, approve the session, and keep the terminal open until the CLI stores your API key. This flow also works in headless or agent-driven environments where the CLI cannot launch a browser for you.

Check login status

whoami checks local credential state only. To validate the credential that would actually reach Sequenzy—including a SEQUENZY_API_KEY environment override—and inspect its non-secret identity and permissions, run:

Logout

Commands

Destructive commands (campaigns delete, ab-tests delete, ab-tests delete-variant, lists delete, segments delete, tags delete, webhooks delete, and team cancel-invitation) ask for confirmation before running. Pass --yes (or -y) to skip the prompt. When stdin is not interactive - in scripts, CI, or agent-driven runs - --yes is required and the command fails without it.

Subscribers

Subscriber imports accept columns such as email, full/first/last name, external ID, phone, status, and tags. Additional CSV columns become typed custom attributes. Imports run asynchronously; a completed import may still contain row failures, so check import-status --json. Use --opt-in-mode confirmed only when the source CRM contains verified consent.

Lists

The CLI splits large files into API-safe batches automatically. CSV files can use an email, e-mail, email address, or mail header; if no email header exists, the first column is used. Use this command instead of looping over subscribers add; standard API rate limits are 100 requests per minute per API key and 20 requests per second burst. lists remove-subscribers accepts the same email inputs as add-subscribers (--email, --emails-json, or --emails-file) and only removes list memberships; the subscribers stay in your audience. Emails that do not match a subscriber are reported as not found. Deleting a list removes all of its memberships but keeps the subscribers.

Send Email

Send transactional emails to single recipients:
--template takes a transactional API slug and maps it to the API’s slug field. Direct --html and --html-file content maps to the API’s canonical body field and requires --subject. Template and direct-content flags cannot be combined.

Statistics

Campaign stats include a Clicked Links section with the campaign’s top destination URLs, click counts, and each link’s share of all link clicks; add --json to receive the complete top-level clickedLinks array.

Campaigns

Rejected campaign list and detail output include the reviewer feedback when it was provided. The same value is available as rejectionComment with --json.
Scheduling requires a future ISO timestamp and a verified sending domain.
With --repeat weekly or --repeat monthly, the campaign becomes a recurring template: each run is duplicated and sent automatically at the cadence, re-evaluating list or segment membership every time. Re-schedule without --repeat (or cancel the campaign) to stop the series. campaigns create accepts --prompt to generate the campaign email, including subject, preview text, and blocks. Use --preview-text or --preheader-text to set the inbox preview text yourself; with --prompt, that explicit value overrides the generated preview. campaigns create and campaigns update also accept raw HTML or Sequenzy block JSON via --blocks-json or --blocks-file. Use block input when you need editor-compatible content, conditional blocks, repeat blocks, or Poll and NPS survey blocks. Campaign stats render answer distributions and NPS scores automatically; add --json to receive the complete top-level polls array. campaigns cancel stops scheduled, paused, waiting-approval, and actively sending campaigns immediately. It skips the confirmation prompt on purpose so you can stop a bad send fast, and it cannot be undone. Only sending campaigns can be paused, and only paused campaigns can be resumed; pass --spread-over-hours (1-72) to spread the remaining delivery over a longer window. Sending, scheduled, and paused campaigns must be cancelled before they can be deleted. campaigns duplicate defaults to --mode campaign, which copies the campaign and its email. Use --mode ab_test to also copy the campaign’s A/B test with all variants, or --mode variant with --variant-id to copy a single variant’s content as the new campaign email. campaigns resend-to-non-openers creates a draft that targets the same audience as a sent campaign plus a “didn’t open this campaign” rule, so only people who haven’t opened it yet receive the resend. It’s available 6 hours after the campaign finishes sending (to give opens time to register), and the response includes an estimate of how many subscribers haven’t opened the original. The draft is not sent automatically - review it, then schedule or send it.

Landing Pages

landing-pages create, update, publish, and unpublish can accept full builder JSON with --content-json or --content-file. Built-in template keys include from-scratch, waitlist, lead-magnet, launch, demo-request, webinar, newsletter, product-hunt, pricing-offer, agency-lead-gen, and feature-announcement. Custom landing page domains need a CNAME record pointing to pages.sequenzydns.com; run update-domain-settings --verify after DNS propagates.

A/B Tests

Only draft A/B tests can be edited. Use get first to discover variant IDs, then update the target variant with a subject, preview text, HTML, or Sequenzy blocks. ab-tests create accepts either a campaign ID or --automation-node. Campaigns must be in draft or rejected status; an automation node must be an email step and is converted to a dashboard A/B-test node. Add --confirm-live-change when converting a node in an active sequence. Control variant A is created automatically from the current email; sequence variants receive independent email templates. Extra variants come from --variants-json or --variants-file (each entry takes subject, optional previewText, and optional blocks). Campaign tests use audience percentage and duration; sequence tests use --test-type and --winner-threshold. Variants can only be added or removed while the test is in draft status, variant A is the control and cannot be deleted, and running tests cannot be deleted. When a sequence test’s parent sequence is active, add-variant and delete-variant also require --confirm-live-change because they immediately change the live rotation.

Sequences

sequences enroll accepts subscriber IDs with --subscriber-ids, the same email inputs as lists add-subscribers (--email, --emails-json, or --emails-file), or both. Each API request is capped at 500 total targets across emails and subscriber IDs. Only active subscribers are enrolled: unknown emails are reported as not found, and inactive, unavailable, or already enrolled subscribers are skipped. Enrollment starts at the first step after the trigger unless you pass --target-node-id, and the sequence must be accepting entrants (enabled and not paused for enrollment). For sequences update, use sequences get first to find nodeId and emailId values. Metadata flags include --description, repeatable --label (or --clear-labels to remove every label), --user-cancellable/--not-user-cancellable, and sequence or per-step sender/reply identity. Trigger replacement uses --trigger plus its typed trigger flags and is atomic; on an active sequence it requires --confirm-live-change. --steps-file and --emails-file edit existing email steps by nodeId, emailId, or array order; items can set transactional mode and CC/BCC recipients. An email item can set emailPreset to minimal or branded for native Sequenzy blocks, including emails that contain supported custom HTML blocks, using the same format transformation as the dashboard. An email stored entirely as one standalone raw HTML block does not support emailPreset, and emailPreset cannot be combined with html or htmlContent. --insert-steps-file inserts new linear steps with an optional afterNodeId, including delay, tag/list, outbound webhook, condition, discount, subscriber-update, SMS, and logic_wait_for_event nodes with typed config. Use --branch-file for a new if/else node; each path can provide new steps, an existing targetNodeId, or both, while elseTargetNodeId wires the fallback. Do not combine branch insertion, linear insertion, or a graph edit in the same command. When the target sequence is active, structural edits such as --insert-steps-*, --branch-*, or --graph-edit-* require --confirm-structural-change after you confirm the live-flow impact. Content-only --steps-* and --emails-* edits do not require that flag.

Templates

templates list includes localization sync status by locale. templates get includes the full localized variants and the effective company localization config. templates localizations set requires one enabled non-primary locale, a subject, and exactly one HTML or blocks source. templates localizations sync works even when automatic on-save localization is disabled. When you pass blocks JSON, each block can include a conditions array for recipient-specific content. Use field: "variable" to branch on a value passed in the send’s variables or an automation event payload:
In a variable condition, the text before the colon in value is a merge-tag path (without {{ }}), including nested paths like order.total or event.plan, and the text after it is the comparison value. field can also be attribute (same name:value form) or email / firstName / lastName. Operators: is, is_not, contains, not_contains, gt, gte, lt, lte, is_empty, is_not_empty. For if/else, add a conditional-group block with ifBranch.children and elseBranch.children.

Companies

companies get includes product info, brand colors, AI writing context, and the effective email localization settings for that company. companies update edits the product info that AI uses for generated emails, including primaryColor, companyContext, toneVoice, value props, testimonials, and related brand fields. --email-theme-json / --email-theme-file edit the company’s default email theme (presetId, colors, typography, layout); updates are partial, and passing null resets the theme to the platform default.

Segments

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"
For purchased-product segments (--commerce-product), use provider:productId where the provider is shopify, woocommerce, or api and the product ID is the one your orders carry in their line items. Product IDs are provider-scoped (Shopify product 42 and WooCommerce product 42 are different products); a bare ID without a provider prefix matches the ID on any provider. The CLI maps:
  • bought -> field: "commerceProduct", operator: "is", value: "shopify:42"
  • didnt-buy -> field: "commerceProduct", operator: "is_not", value: "shopify:42"
  • at-least -> field: "commerceProduct", operator: "at_least", value: "shopify:42:2" (use --orders)
  • less-than -> field: "commerceProduct", operator: "less_than_count", value: "shopify:42:2" (use --orders)
For trial timing, pass --filter-json directly:
  • {"field":"stripeTrialProduct","operator":"is","value":"prod_xxx:is_canceled"}
  • {"field":"stripeTrialProduct","operator":"gte","value":"prod_xxx:start_at:7 days ago"}
  • {"field":"stripeTrialProduct","operator":"is","value":"prod_xxx:end_at:2026-05-26"}
Engagement filters (emailSent, emailOpened, emailClicked, emailBounced, emailComplained) accept a rolling time window (7d, 30d, 90d, 180d, all), a specific sent campaign (campaign:<campaign_id>), or - with the at_least / less_than_count operators - a count with a time window (count:timeRange, like 10:30d or 10:all). For example, {"field":"emailClicked","operator":"at_least","value":"10:all"} matches subscribers who clicked 10 or more times ever. Combine two campaign-specific filters with the default --match all to express rules like “bounced campaign A but not campaign B”. Look up campaign IDs with sequenzy campaigns list. --filter-json accepts the same filter shape used by the API and MCP. Pass a JSON array for legacy flat filters, or an object with a nested root group for v2 nested logic. If you omit filter or group id values, the CLI fills them in automatically. Event filters use field: "event" with values like saas.purchase:30d, saas.purchase:all, or saas.purchase:5:30d for count-based operators. Segment filters use field: "segment" with the saved segment ID as the value. By default, segments create matches all filters with AND logic. Pass --match any to save the segment with OR logic instead. segments count returns the number of active subscribers who currently match the segment. In the dashboard you may also see a broader matched-contact count, but campaigns only send to active subscribers. segments update accepts the same filter shapes as segments create via --filters-json or --filters-file (a flat array or an object with a nested root group). Provided filters replace the segment’s existing rules, and missing filter IDs are filled in automatically. lists import is an alias for lists add-subscribers.

Audience Syncs

Push segments to Meta custom audiences for Facebook and Instagram retargeting. Requires the Meta Ads integration to be connected in the dashboard (Settings → Integrations).
--template accepts ready-made segment IDs like zero-ltv, no-purchase-1y, recent-buyers, high-spenders-ecom, non-buyers, and engaged; the segment is created automatically on first use. Audiences are add-only: subscribers who leave the segment stay in the Meta audience.

Tags

Tag names are normalized to lowercase with hyphens, so VIP Customer becomes vip-customer. Colors include values like gray (the default), red, green, blue, and purple. System tags cannot be updated or deleted, and tags used by sequences cannot be deleted until those sequences stop referencing them. Deleting a tag removes it from every subscriber.

Shopify

Sync Rules

Sync rules map events to automatic tag changes. update replaces the full rule set - fetch with get --json, edit, then send it back. Send an empty array to disable rules. --reset is an explicit opt-in to the legacy SaaS/ecommerce platform preset, not a neutral reset. Rules can carry conditions: required or excluded subscriber tags, and a product match for commerce events that tags buyers by product tag, collection, product type, or vendor. See Sync Rules for the full model.

Team

Existing Sequenzy users are added to the team immediately; everyone else receives an email invitation. Inviting and cancelling invitations requires owner or admin access, restricted members can open direct campaign links only, and --billing-access can only be granted by the company owner. Use team list to find invitation IDs.

Inbox

The inbox collects subscriber replies to campaigns, sequences, and transactional email. Provide a reply body with --text and/or --html-file. Outbound replies are emailed to the subscriber and reopen closed conversations; messages sent with --note are internal-only and never reach the subscriber.

Webhooks

Webhook payloads are signed. webhooks create prints the signing secret once at creation time; it cannot be retrieved later, so store it immediately to verify webhook signatures. Valid --event values cover email.*, subscriber.*, and sequence.* event types; omit --event to subscribe to the default event set. On webhooks update, --event replaces the existing event list, and changing the URL or re-enabling with --enable resets the failure circuit breaker. Use webhooks deliveries to find delivery IDs before running webhooks replay.

Products

attach-file --file (and upsert --file) uploads the file to Sequenzy storage (PDF, ePub, ZIP, images, audio, video, or text, up to 100MB) and attaches it in one step. attach-file and detach-file accept the product ID from products list or, for Commerce API products, your own productId (e.g. sequenzy products attach-file my-ebook --file ./ebook.pdf). After attaching, purchases of the product enrich the saas.purchase event with download.url and download.name, so purchase sequences can deliver the file with {{event.download.url}}. See Digital Product Delivery. upsert writes to the platform-agnostic Commerce API catalog: products are keyed by your own productId, and the same IDs are matched against order line items for purchase sequences and product filters.

Account

sequenzy account makes a live request with the active credential and prints the key name, ID, non-secret prefix, type, effective preset, full-access state, scope receipt, missing marketing read scopes, and API Keys settings URL. Compare the name and prefix with Settings after replacing a key. Only scopes: null means all current and future permissions; an explicit selection of every current scope is reported as a fixed custom selection. This command requires account:read; if that scope is missing, open API Keys settings from the dashboard directly.

API Keys

Supported presets: full_access, read_only, agent_safe, ai_drafting, data_ingest_safe, data_ingest_automations, transactional_sender, marketing_sender. Pass --scopes with a comma-separated list to override the preset with custom permissions. The creation output includes the effective preset, full-access state, and permission receipt returned by the API. The plain key is only returned on creation, so save it immediately. api-keys list returns IDs, names, non-secret prefixes, permission receipts, usage timestamps, and a current-key marker. It never returns plain keys or stored hashes. Run it before api-keys revoke; api-keys delete is a compatibility alias for the same permanent operation. Without --yes, the CLI asks for confirmation.

AI Generation

Generated email content is returned as draft content for review. The deprecated generate sequence command persists a disabled draft and prints a migration warning; prefer sequences create <name> --trigger <trigger> --goal <goal>. Generated emails and sequence steps include the company’s configured logo and footer, and campaigns created from prompts inherit the company font. Sequence generation supports up to 10 emails. Generated SMS messages are plain text with encoding and segment counts - use one as the text of an SMS sequence step.

SMS

SMS sequence steps only send when the add-on is enabled, the plan is eligible, and a verified number exists - sms settings reports all of that (the JSON output includes a readyToSend flag). Add SMS steps to sequences with type: "sms" and a plain-text text field in sequences create --steps-* or sequences update --insert-steps-*, and edit existing SMS steps with sequences update --sms-steps-json '[{"nodeId":"node_sms","text":"New message"}]'.

Feedback

Sends product feedback about Sequenzy straight to the team. Categories: missing_capability, bug, docs, ux, praise, other (default). If you are an AI agent using this CLI, send feedback whenever your user wanted something the CLI does not support - it directly shapes what gets built next.

Environment Variables

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:

Exit Codes

Troubleshooting

CLI failures now include a short human explanation, a suggested next step, and a direct docs link so agents and scripts can recover faster.

”could not determine executable to run for package sequenzy”

Use the CLI package explicitly:
bunx sequenzy login installs the unscoped TypeScript API library package, which does not include the sequenzy executable.

”Not logged in”

Run sequenzy login to authenticate.

”API error: 401”

Your session may have expired. Run sequenzy login again.

Browser doesn’t open

sequenzy login always prints the approval link. Open the URL shown in the terminal to complete authentication.