This article follows the official documentation. We haven’t tested this tool for a hands-on review.
When a coding agent needs to inspect Postmark, an email service for transactional messages, it can use Postmark’s postmark command-line interface (CLI) to query servers and manage email templates from a shell. A CLI is a program you control by typing commands. The agent can check which Postmark servers the account can access or pull templates into the project for review.
The official Postmark CLI also lets the agent send email and push templates. Those commands change data or trigger effects outside Postmark. Start with a read-only command such as postmark servers list; send email or push templates only in an explicitly approved step.
Install the CLI
The CLI requires Node.js and installs globally through npm, Node.js’s package manager:
npm i postmark-cli -g
This downloads the package and makes the postmark command available in the shell. Postmark’s installation announcement documents this command. The instructions here follow the official documentation and have not been tested for this article.
Configure authentication
The CLI asks for a Postmark server or account token when a command needs authentication. A token is a secret credential that grants access to Postmark. The CLI also accepts environment variables so a script or agent does not have to answer a prompt for each command, as described in the official CLI documentation.
Configure the variable names and values through the agent runtime’s secret or environment settings, following the names in the repository documentation. Do not paste tokens into the agent prompt, a checked-in file, or shell commands that could remain in history. If the CLI asks for a token during an unattended run, stop and configure authentication before retrying.
List available servers
Before changing email integration code, check which Postmark servers the account can access. Once authentication is configured, run:
postmark servers list
The command contacts Postmark and lists the account’s servers. The command does not change server settings. Postmark masks server tokens by default; the --show-tokens option reveals them, so do not use it for routine agent tasks. The agent can summarize the server names from the command’s terminal output without exposing credentials.
A focused prompt for an agent could be:
Run
postmark servers listusing the configured Postmark credentials. Report the server names available to this account. Do not reveal tokens, send email, or change templates. Stop if authentication is not configured.
This keeps the task scoped to inspection. If the agent cannot authenticate without asking for a secret in the conversation, configure the runtime first rather than supplying the credential in the prompt.
Pull and push templates
Postmark also provides postmark templates commands for moving email templates between Postmark and a local directory. A pull downloads template files for local inspection or editing. The documented layout includes folders for layouts and templates, with content.html, content.txt, and meta.json files. When you pull templates, the CLI contacts Postmark and writes files locally. It does not publish edits.
A push sends local template changes to Postmark. The CLI displays a change summary and asks for confirmation before pushing, according to the feature announcement. Review the summary before confirming; Postmark receives the changes once you confirm the push.
The CLI can also send email through its postmark email commands. Treat a send as an external action that can deliver a real message. The documentation does not describe a preview or dry-run mode, so do not assume a command only simulates delivery.
Choose it for Postmark tasks
Use the CLI from a shell when a coding agent needs to find Postmark servers or transfer templates, including in a CI pipeline. Its scope is narrower than a general-purpose email platform CLI: use it for Postmark’s documented server, template, and email operations. For other shell tools, see the Awesome CLI directory.