Email SDK
Reference

CLI

The complete email-sdk command manual — adapters, doctor, send, dry runs, credential flags, and exit codes.

The email-sdk CLI ships inside @opencoredev/email-sdk. Use it to list adapters, check credentials with doctor, validate a message with --dry-run, and run a real smoke send — no app code required.

Run it

One-off, without installing:

bunx --bun --package @opencoredev/email-sdk email-sdk adapters

Or install the package and use the local binary:

npm install @opencoredev/email-sdk
npx email-sdk adapters

Node 20+ or Bun 1.1+. The examples below use npx email-sdk; substitute the bunx form for no-install runs.

Commands

CommandAliasesWhat it does
help--help, -h, no commandPrint usage.
version--version, -vPrint the installed package name and version.
adaptersprovidersList every adapter with its required environment.
doctorCheck that one adapter's credentials are present.
sendValidate and send one message.

Any other command fails with Unknown command "x". and exit code 1.

Flag syntax

  • --flag value and --flag=value are equivalent; a flag without a value is treated as true.
  • --header, --tag, --metadata, and --attachment (alias --attach) are repeatable — pass them once per value.
  • Repeating any other flag keeps the last value.
  • --to, --cc, --bcc, and --reply-to accept comma-separated address lists.

help

npx email-sdk help

Prints usage, all send flags, and the adapter-specific option groups. Running email-sdk with no command does the same.

version

npx email-sdk version
# @opencoredev/email-sdk 0.6.1

npx email-sdk version --json
# { "name": "@opencoredev/email-sdk", "version": "0.6.1" }

Reads the metadata of the package actually installed on your machine — check it before comparing behavior against the docs.

adapters

npx email-sdk adapters

Prints one line per adapter: routing name, required environment variables, and a short note. --json prints the same data as a JSON array of { name, env, note } objects.

AdapterRequired environmentOptional environment
resendRESEND_API_KEY
postmarkPOSTMARK_SERVER_TOKENPOSTMARK_MESSAGE_STREAM
sendgridSENDGRID_API_KEY
cloudflareCLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_IDCLOUDFLARE_BASE_URL
unosendUNOSEND_API_KEYUNOSEND_BASE_URL
iterableITERABLE_API_KEY, ITERABLE_CAMPAIGN_IDITERABLE_BASE_URL, ITERABLE_SEND_AT, ITERABLE_ALLOW_REPEAT_MARKETING_SENDS
sesAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGIONAWS_SESSION_TOKEN, AWS_SES_CONFIGURATION_SET, AWS_SES_BASE_URL
mailgunMAILGUN_API_KEY, MAILGUN_DOMAINMAILGUN_BASE_URL
mailersendMAILERSEND_API_KEY
brevoBREVO_API_KEY
mailchimpMAILCHIMP_API_KEY
sparkpostSPARKPOST_API_KEY
loopsLOOPS_API_KEY, LOOPS_TRANSACTIONAL_ID
sequenzySEQUENZY_API_KEYSEQUENZY_BASE_URL
plunkPLUNK_API_KEY
mailtrapMAILTRAP_API_KEY
scalewaySCALEWAY_SECRET_KEY, SCALEWAY_PROJECT_IDSCALEWAY_REGION
zeptomailZEPTOMAIL_TOKEN
mailpaceMAILPACE_API_KEY
smtpSMTP_HOSTSMTP_PORT (default 587), SMTP_SECURE, SMTP_REQUIRE_TLS, SMTP_ALLOW_INSECURE_AUTH, SMTP_USER, SMTP_PASS

Adapter auto-detection

When doctor or send runs without --adapter, the CLI walks the table above in order and picks the first adapter whose required environment variables are all set. If none qualifies: