Postmark CLI

raw JSON →
1.6.19 verified Sat Apr 25 auth: no javascript

Postmark CLI (v1.6.19) is a command-line tool for managing transactional email templates, sending emails, and fetching server information via the Postmark API. Released under MIT, it is maintained by ActiveCampaign with regular updates. Key differentiators include local template preview with hot reloading, smart push that only uploads modified templates, and support for layouts. The CLI integrates easily into CI/CD pipelines and offers interactive prompts via Inquirer. It requires Node.js 14+.

error Error: Cannot find module 'postmark'
cause Missing peer dependency postmark when installing locally without --save.
fix
Install globally: npm i -g postmark-cli
error postmark: command not found
cause Global installation not in PATH or not installed globally.
fix
Run npx postmark or reinstall globally: npm i -g postmark-cli
error Error: Template push failed: Unauthorized
cause Invalid or missing Server-Token.
fix
Ensure you provide a valid server token via --server-token or environment variable POSTMARK_SERVER_TOKEN.
deprecated Inquirer prompts may change in future versions; interactive mode not fully scriptable.
fix Use --non-interactive flag or pipe stdin for automation.
gotcha Template push only pushes modified or new templates by default (since v1.5.8); use --all to force push.
fix Add --all argument to push all templates regardless of modification state.
breaking Node.js 10 and below no longer supported; requires Node 14+.
fix Upgrade Node.js to version 14 or later.
npm install postmark-cli
yarn add postmark-cli
pnpm add postmark-cli

Shows global installation and basic email sending and template management commands.

# Install globally
npm i -g postmark-cli

# Send a basic email
postmark email send \
  --server-token 'SERVER_TOKEN' \
  --from 'sender@example.com' \
  --to 'recipient@example.com' \
  --subject 'Hello from Postmark CLI' \
  --text-body 'This is a test email.'

# Pull all templates into a directory
postmark templates pull ./templates \
  --server-token 'SERVER_TOKEN'

# Push modified templates only
postmark templates push ./templates \
  --server-token 'SERVER_TOKEN'