Docs
guides · agents · CLI

CLI

@drin00/cli is the drin command line — full parity with the dashboard. Send mail, manage domains, inboxes, contacts, templates and webhooks, read delivery metrics, and launch the MCP server for AI agents, all from your terminal. Zero third-party dependencies; Node 20+.

01 Install

Install it globally for a drin command, or run it ad hoc with npx — no install required:

Install
npm i -g @drin00/cli      # then: drin --help
# or run ad hoc:
npx @drin00/cli emails list

02 Authenticate

The CLI authenticates with a single API key. Set it once in your environment — create one in the dashboard under Settings → API Keys. If the key is account-wide rather than scoped to one project, also set DRIN_SENDER to a project externalId.

Environment
export DRIN_API_KEY=drin_your_key      # Settings → API Keys in the dashboard
export DRIN_SENDER=your-product        # only for account-wide keys
# optional: export DRIN_BASE_URL=https://api.drin.run

Every value can also be passed per-command with --api-key, --sender, and --base-url, which override the environment:

Per-command flags
drin emails list \
  --api-key drin_your_key \
  --sender your-product \
  --base-url https://api.drin.run

03 Send mail

The send command takes a verified --from address, one or more --to recipients, and a body (--text, --html, or a --template-id). It also accepts --data, --header, --tag, --attach, and --cc / --bcc.

drin send
# One recipient
drin send --from "Acme <hi@acme.com>" --to you@example.com \
  --subject "Hello" --text "It works"

# Several recipients (repeat --to, or comma-separate)
drin send --from hi@acme.com --to a@x.com --to b@y.com --html "<p>hi</p>"

# Merge variables + an attachment
drin send --from hi@acme.com --to you@example.com \
  --template-id tmpl_123 --data '{"name":"Ada"}' --attach invoice.pdf

04 Read mail & logs

The emails group lists and inspects messages in either direction. Pass --direction inbound to see received mail, and body / attachments to pull the full content.

Activity
drin emails list --direction inbound --limit 10
drin emails get <id>
drin emails body <id>
drin emails attachments <id>

05 Domains

drin domains
drin domains list --status verified
drin domains add mail.acme.com            # prints the DNS records to publish
drin domains verify <id>                  # re-check verification now
drin domains receiving <id> --enabled true  # turn on inbound (prints the MX)

06 Inbound & conversations

Create an inbox on a receiving domain, read its threads, reply in-thread, and simulate inbound mail to test the pipeline without DNS:

Inbox loop
drin inboxes create --address support --domain-id <id>
drin threads list --inbox-id <id>
drin emails reply <message-id> --text "On it — thanks!"
drin inbound simulate --to support@acme.com --from "C <c@x.com>" \
  --subject Hi --text yo

07 Everything else

Contacts, suppressions, templates, webhooks, API keys, metrics, and the cross-product account feed are all here too:

Account surface
drin contacts create --email a@x.com --first-name Ada
drin suppressions add someone@example.com
drin templates create --name Welcome --subject "Hi {{name}}" --html-file welcome.html
drin webhooks create --url https://acme.com/hook --event delivery --event bounce
drin apikeys create --name "CI deploy"
drin metrics --from 2026-05-01 --to 2026-05-31
drin account messages --limit 20          # every product in the account

08 JSON output

Add --json to any command to print the raw API response instead of a formatted table — exactly what a tool-using agent or a CI script wants:

--json
# Human-readable table (default)
drin domains list

# Raw API JSON — pipe it into jq, an agent, or a script
drin domains list --json | jq '.data[].name'
Discover any commandRun drin --help for the full command list, or drin <group> --help (e.g. drin domains --help) for the flags and subcommands of a single group.

09 Command reference

GroupSubcommands
send— (supports --data, --header, --tag, --attach, --template-id)
emailslist, get, body, attachments, reply, batch
domainslist, get, add, verify, delete, receiving
inboxeslist, create, get, delete
threadslist, get
contactslist, create, get, update, unsubscribe, resubscribe, delete
suppressionslist, add, remove
templateslist, get, create, update, delete, render, preview, gallery
webhookslist, get, create, update, delete
apikeyslist, create, revoke
inboundsimulate
integrationslist, get, install, update, uninstall
accountmessages (tenant-wide, every product)
metrics
mcpruns @drin00/mcp over stdio with your resolved env

10 Launch the MCP server

The CLI bundles the MCP server. drin mcp launches @drin00/mcp over stdio using the same resolved environment — point an AI client at it and your agent gets all 54 tools:

drin mcp
drin mcp
Give an agent the toolsThe MCP server exposes the whole API as 54 tools — one command, one key.