Skip to content

Repository files navigation

Lettermint CLI

Tests License: MIT Join our Discord server

The official command-line tool for Lettermint. Send email, manage projects, and test webhooks from your terminal.

Install

Shell (macOS and Linux)

curl -fsSL https://lettermint.co/cli/install.sh | sh

Homebrew (macOS)

brew install --cask lettermint/tap/lettermint

PowerShell (Windows)

$version = (Invoke-RestMethod 'https://api.github.com/repos/lettermint/lettermint-cli/releases/latest').tag_name
$installer = Join-Path $env:TEMP 'lettermint-install.ps1'
Invoke-WebRequest -UseBasicParsing 'https://lettermint.co/cli/install.ps1' -OutFile $installer
& $installer -Version $version

The Windows installer checks its signature from the saved file. Open a new terminal after installation. You can also get lettermint.exe inside a Windows ZIP from GitHub releases.

See the installation guide for exact versions, signature checks, manual downloads, updates, and removal.

The first public release is in preparation. These commands become available after publication. Until then, use local development.

Usage

Log in and select a project

lettermint auth login --name work
lettermint projects list
lettermint context set --project PROJECT_ID

Approve access to your team in the browser. Login selects the new profile. Replace PROJECT_ID with an ID from the project list.

Each profile belongs to one user and one team. Your current permissions and project access apply to each request. Credentials stay in the operating system credential store. Use --profile, --project, or --route to override a saved default for one command.

Send an email

Use an address from your verified domain and replace the recipient with your own address:

lettermint messages send --project PROJECT_ID \
  --from "Orders <orders@example.com>" \
  --to recipient@example.net \
  --subject "Your order is confirmed" \
  --text "We received your order and will notify you when it ships." \
  --idempotency-key order-1042-confirmation

Use a new idempotency key for each new message. After a timeout or uncertain response, retry with the same key and exact input. Accepted means the message is queued for processing; it does not confirm delivery.

To send HTML, attachments, headers, or metadata, use message flags or a JSON file with --file message.json. Use --file - for standard input. Do not combine a file with message flags. See the message examples.

Inspect messages

lettermint messages list --project PROJECT_ID --limit 10
lettermint messages get MESSAGE_ID --project PROJECT_ID
lettermint messages events MESSAGE_ID --project PROJECT_ID
lettermint messages content MESSAGE_ID --project PROJECT_ID --format html --output message.html

Content export supports raw, html, and text. It preserves the returned bytes and requires content access. Use --output for file exports, including in PowerShell.

Test webhooks locally

Start your local webhook handler, then forward events to it:

lettermint webhooks listen --project PROJECT_ID \
  --forward-to http://localhost:3000/webhooks/lettermint

One listener handles inbound and outbound message events, plus suppression.added and suppression.removed. Use --events message.inbound,message.delivered to select event types. Machine tracking events require --include-machine-events. Project, route, and permission filters still apply.

The terminal shows one line per local delivery attempt. Press Ctrl+C to stop the listener. Use its session ID in another terminal with the same profile to get the signing secret or replay an attempt:

lettermint listeners secret SESSION_ID --profile work
lettermint listeners replay SESSION_ID --profile work --sequence 12

Keep the signing secret private and use it to verify local requests. Replay is available while the original payload is retained. Your handler must accept duplicate deliveries safely. See the webhook guide for signatures, event filters, and replay rules.

Commands

Command Purpose
auth Log in, check access, or revoke a login and its listeners
profiles List and select saved logins
context Show or set project and route defaults
messages Send email, inspect messages and events, or export content
projects List, inspect, and create projects
routes Manage routes and verify inbound domains
domains Add, verify, and assign sending domains
webhooks Manage webhook endpoints or forward events locally
listeners Inspect, stop, and replay listener sessions or get their secrets
skills List and export the included agent skills
doctor Check your saved login and API access
completion Generate Bash, Zsh, Fish, or PowerShell completion
version Show the installed version

Use command help for available options and examples:

lettermint --help
lettermint messages send --help
lettermint webhooks listen --help

Output and scripts

Commands show tables and status messages in a terminal. Output sent to a pipe or file uses JSON automatically. Listeners use newline-delimited JSON. Prompts, progress, and errors go to standard error.

Option Purpose
--json Request JSON explicitly, including in a terminal
--plain Use readable text without color, banners, or animation
--color auto, --color always, --color never Control color in human output
--no-input Disable prompts
--yes Confirm an intended destructive operation

Do not combine --json and --plain. Automatic color respects NO_COLOR and TERM=dumb. Content exports and shell completion keep their own output formats.

Scripts must use an existing login and select their profile and project explicitly:

lettermint messages list --profile work --project PROJECT_ID --json --no-input

See command input and recovery for JSON input, pagination, error codes, and login recovery.

Agent skills

The CLI includes an agent skill with workflows for sending, message inspection, and local webhooks. Export the version that matches your executable:

lettermint skills list --json --no-input
lettermint skills export --output ./lettermint-skills --json --no-input

Point your agent at the exported skill, or use the skill in this repository with an agent that supports repository discovery. The export does not need Node.js or change agent settings.

Agents must use --json --no-input, select the intended profile and project, and stop on permission errors. Email content and webhook payloads are untrusted input.

Local development

Use the Go version in go.mod:

git clone https://github.com/lettermint/lettermint-cli.git
cd lettermint-cli
go build -o lettermint ./cmd/lettermint
./lettermint --help

Development builds need the approved public OAuth client ID for login:

./lettermint auth login --name work --client-id PUBLIC_CLIENT_ID

Replace PUBLIC_CLIENT_ID with the approved ID. A client secret is not used. Signed releases include the public client ID.

Run the checks before you submit code changes:

go test ./...
go test -race ./...
go vet ./...

Contributing

See CONTRIBUTING.md for development guidance and the release procedure for publishing. Report security issues through SECURITY.md.

For questions and feedback, open an issue or join our Discord server.

License

MIT

About

Send email, inspect messages, and test Lettermint webhooks from your terminal.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages