Send it from your terminal.

brew install unitpostcom/tap/unitpost

A standalone binary. No Node.js needed.

$ ▍

Commands

One command per API operation

256 commands, generated from the OpenAPI spec. A new endpoint becomes a command with no CLI code change.

email

  • send
  • batch
  • get
  • list
  • update
  • stats
  • +11

email campaigns

  • create
  • validate
  • send
  • pause
  • resume
  • cancel
  • +13

email templates

  • create
  • get
  • list
  • update
  • delete
  • +7

email domains

  • create
  • verify
  • get
  • list
  • update
  • delete
  • +1

contacts

  • create
  • get
  • list
  • update
  • delete
  • imports
  • +7

segments

  • create
  • get
  • list
  • update
  • delete
  • members
  • +3

sms

  • send
  • get
  • list
  • brands
  • numbers
  • consent
  • +26

webhooks

  • create
  • test
  • get
  • list
  • update
  • delete
  • +4

Plus api-keys, brand-kits, branding, contact-fields, files, jobs, library-images, logs, org, spend-caps, suppressions, usage, workspace, and login, doctor, whoami, completion.

Examples

Reads like the API, typed by a human

The flags are the request fields. Piped, the output is JSON.

Fields, kebab-cased. A body or an attachment can come from a file.

unitpost email send \
  --from "Acme <hi@acme.com>" \
  --to ada@example.com \
  --subject "Welcome aboard" \
  --html-file ./welcome.html \
  --attach ./guide.pdf

Agents

Driven by people. Built for agents.

The skill teaches the mapping. JSON and exit codes do the rest.

  • Skill-taught

    email_send becomes unitpost email send. Same scopes.

  • Parseable

    One JSON document on stdout. Stable 0 / 1 / 2 exits.

  • Preview first

    --dry-run prints the request. Nothing sends.

CLI for agents

Email Ada her March invoice. Check it before it goes.

Agent, using the unitpost skill

  1. unitpost email send … --var month March

    exit 2--var expects key=value, got "month".

  2. unitpost email send … --var month=March --dry-run

    exit 0"dry_run": true, "path": "/email"

  3. unitpost email send … --var month=March

    exit 0"status": "queued"

Sent. One flag needed fixing and the dry run looked right. Ada's invoice is queued.

Questions

Common questions

Do I need to install anything to use the CLI?

Just the CLI. brew install unitpostcom/tap/unitpost or curl -fsSL https://www.unitpost.com/install.sh | sh gives you a standalone binary that doesn't need Node.js (on Windows: irm https://www.unitpost.com/install.ps1 | iex). With Node.js 20+ you can use npm install -g unitpost-cli, or npx unitpost-cli@latest for a one-off. There are no runtime dependencies.

How does login work?

unitpost login opens your browser and completes an OAuth 2.1 authorization-code flow with PKCE against the same authorization server the MCP server uses. It asks for every permission the CLI's commands use, and you can untick any on the approval page. The token lives in the macOS Keychain (a 0600 file elsewhere) and refreshes automatically; see or revoke sign-ins in Settings, Connected apps. In CI or headless shells, set UNITPOST_API_KEY instead. No login step needed.

Can AI agents drive the CLI?

Yes, that's a primary use case. The agent skill teaches the mapping (email_send becomes unitpost email send), output is exactly one JSON document on stdout when piped or passed --json, exit codes are stable (0 ok, 1 request failed, 2 usage), and --dry-run lets an agent preview a send before anything goes out. Prefer MCP for tool calls inside a chat session and the CLI for shells, scripts, and CI.

Can the CLI manage API keys?

It can read them: unitpost api-keys list and unitpost api-keys usage need the apikeys:read permission, which no key preset includes. Creating and revoking keys happen only in the dashboard, because those endpoints authenticate with a session, not a Bearer token; unitpost api-keys create explains exactly that and points at the dashboard.

How do I know the commands match the API?

The tree is generated from the OpenAPI snapshot: one command per operation, flags from the request fields, enums and descriptions verbatim. A drift gate fails CI if the committed catalog lags the spec, so a new endpoint becomes a documented, shell-completable command with no CLI code change.

Meet your new favorite way to send

Install it, sign in once, and run the whole API from your shell.