@poststack.dev/cli
v0.2.0
Published
Command-line interface for the PostStack Email API
Downloads
175
Readme
@poststack.dev/cli
Command-line interface for the PostStack Email API — a GDPR-compliant, EU-hosted email API up to 75% cheaper than Resend, SendGrid, and Postmark. Send transactional email, manage sending domains, rotate API keys, and inspect contacts from your shell or CI pipeline.
Install
npm install -g @poststack.dev/cli
# or use it without installing
npx @poststack.dev/cli helpConfigure
poststack configure
# Or non-interactively:
poststack configure --api-key sk_live_...This writes ~/.poststack/config.json with mode 0600. You can also set
POSTSTACK_API_KEY to override the file.
Examples
# Show the CLI version
poststack --version
# Send a transactional email
poststack emails send \
--to [email protected] \
--subject "Hello" \
--html "<p>Hi from PostStack!</p>" \
--from [email protected]
# List sending domains
poststack domains list
# Verify a domain after configuring DNS
poststack domains verify 12
# Create a contact
poststack contacts create --email [email protected] --name "Ada Lovelace"
# Paginate any list command
poststack emails list --page 2 --limit 100
# Per-command help
poststack broadcasts --helpJSON output
Pass --json anywhere on the command line and every command emits
machine-readable JSON instead of a human-readable table:
poststack contacts list --json | jq '.data[].email'
poststack domains list --json | jq '.domains[].name'
# Errors also emit JSON (to stderr) so scripts can branch on them:
poststack emails get bad-id --json
# {"error":"Email not found","statusCode":404,"code":"not_found"}Exit codes
| Code | Meaning |
| ---- | ------------------------------------------------ |
| 0 | success |
| 1 | user input or configuration error |
| 2 | API error (PostStackError returned by the SDK) |
Run poststack help for the full command list, or
poststack <command> --help for per-command details.
Distribution
Built with bun build to a single ESM file in dist/cli.js so it runs under
Node 20+ and Bun without bundler shenanigans.
bun run build
npm publish