{"_rev":"90-02d8abf611e44779007de7a31d320e28","time":{"created":"2026-09-15T22:15:19.318Z","modified":"2026-09-15T22:15:20.182Z","0.6.20":"2026-06-16T13:03:01.079Z","0.6.21":"2026-06-16T14:08:26.388Z","0.6.22":"2026-06-16T14:37:26.426Z","0.6.23":"2026-06-17T12:02:01.651Z","0.6.24":"2026-06-17T12:57:56.191Z","0.6.25":"2026-06-17T13:00:49.624Z","0.6.26":"2026-06-17T13:03:53.986Z","0.6.27":"2026-06-17T13:10:48.468Z","0.6.28":"2026-06-17T13:16:41.628Z","0.6.29":"2026-06-17T13:25:04.217Z","0.6.30":"2026-06-17T13:39:25.950Z","0.6.31":"2026-06-17T13:55:41.318Z","0.6.32":"2026-06-17T14:02:43.082Z","0.6.33":"2026-06-17T14:18:09.174Z","0.6.34":"2026-06-17T14:26:31.791Z","0.6.35":"2026-06-17T17:00:04.909Z","0.6.36":"2026-06-17T17:19:44.538Z","0.6.37":"2026-06-17T17:25:29.461Z","0.6.38":"2026-06-17T17:27:11.560Z","0.6.39":"2026-06-17T17:35:40.092Z","0.6.40":"2026-06-17T17:40:58.131Z","0.6.41":"2026-06-17T17:49:10.238Z","0.6.42":"2026-06-17T17:53:23.267Z","0.6.43":"2026-06-17T17:55:55.125Z","0.6.44":"2026-06-17T17:58:27.368Z","0.6.45":"2026-06-17T18:15:16.391Z","0.6.46":"2026-06-17T18:21:33.490Z","0.6.47":"2026-06-18T10:13:23.101Z","0.6.48":"2026-06-18T12:10:37.416Z","0.6.49":"2026-06-18T13:33:32.415Z","0.6.50":"2026-06-18T14:38:36.555Z","0.6.51":"2026-06-19T10:43:40.639Z","0.6.52":"2026-06-22T14:11:03.686Z","0.6.53":"2026-06-22T14:51:14.817Z","0.6.54":"2026-06-22T15:10:00.771Z","0.6.55":"2026-06-23T05:45:25.840Z","0.6.56":"2026-06-26T08:27:15.655Z","0.6.57":"2026-06-26T10:50:00.588Z","0.6.58":"2026-06-26T12:04:31.329Z","0.6.59":"2026-06-26T12:37:10.355Z","0.6.60":"2026-06-29T05:56:03.454Z","0.6.61":"2026-06-29T11:42:50.474Z","0.6.62":"2026-06-29T12:12:34.431Z","0.6.63":"2026-06-29T15:02:19.835Z","0.6.64":"2026-06-29T15:33:02.998Z","0.6.65":"2026-06-29T15:50:12.297Z","0.6.66":"2026-06-29T16:14:19.172Z","0.6.67":"2026-06-29T16:34:22.727Z","0.6.68":"2026-06-29T17:03:22.774Z","0.6.69":"2026-06-29T17:17:00.439Z","0.6.70":"2026-06-30T10:30:34.751Z","0.6.71":"2026-06-30T10:41:45.636Z","0.6.72":"2026-06-30T11:45:52.288Z","0.6.73":"2026-06-30T12:15:54.112Z","0.6.74":"2026-06-30T13:09:21.562Z","0.6.75":"2026-06-30T14:18:35.144Z","0.6.76":"2026-07-01T11:29:07.747Z","0.6.77":"2026-07-01T11:42:48.229Z","0.6.78":"2026-07-01T18:16:38.402Z","0.6.79":"2026-07-01T19:58:37.753Z","0.6.80":"2026-07-01T20:16:25.808Z","0.6.81":"2026-07-01T20:24:19.684Z","0.6.82":"2026-07-01T20:36:09.076Z","0.6.83":"2026-07-01T20:46:25.663Z","0.6.84":"2026-07-01T21:29:06.432Z","0.6.85":"2026-07-01T21:53:19.184Z","0.6.86":"2026-07-01T22:06:48.996Z","0.6.87":"2026-07-01T22:21:06.076Z","0.6.88":"2026-07-01T22:28:18.259Z","0.6.89":"2026-07-01T23:45:23.261Z","0.6.90":"2026-07-01T23:53:21.056Z","0.6.91":"2026-07-02T00:01:26.223Z","0.6.92":"2026-07-02T00:25:43.682Z","0.6.93":"2026-07-02T10:19:32.318Z","0.6.94":"2026-07-03T21:33:57.268Z","0.6.95":"2026-07-03T22:46:20.218Z","0.6.107":"2026-07-08T11:49:49.925Z","0.6.108":"2026-07-08T13:22:12.593Z","0.6.109":"2026-07-08T14:22:47.925Z","0.6.110":"2026-07-08T15:02:19.102Z","0.6.111":"2026-07-08T15:53:53.370Z","0.6.112":"2026-07-08T16:23:08.214Z","0.6.113":"2026-07-08T21:28:03.809Z","0.6.114":"2026-07-08T22:25:13.669Z","0.6.115":"2026-07-08T23:10:01.233Z","0.6.116":"2026-07-08T23:18:42.346Z","0.1.0":"2026-09-15T22:15:19.722Z"},"_id":"@hasna/mailery","name":"@hasna/mailery","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@hasna/mailery","version":"0.1.0","description":"Email identity for agents — the mailery.co CLI and MCP server. Signup, subscribe, buy a domain, and send/receive real email from the terminal.","license":"Apache-2.0","type":"module","author":{"name":"Andrei Hasna","email":"andrei@hasna.com"},"homepage":"https://mailery.co","repository":{"type":"git","url":"git+https://github.com/hasna/mailery.git","directory":"packages/cli"},"keywords":["mailery","email","agents","cli","mcp","smtp","domains"],"bin":{"mailery":"dist/index.js"},"exports":{"./sdk":{"types":"./dist/sdk.d.ts","import":"./dist/sdk.js","default":"./dist/sdk.js"},"./package.json":"./package.json"},"scripts":{"build":"rm -rf dist && bun run --cwd ../sdk build && bun build src/index.ts src/sdk.ts --outdir dist --target node --minify && cp ../sdk/dist/*.d.ts dist/ && mv dist/index.d.ts dist/sdk.d.ts && chmod +x dist/index.js","typecheck":"tsc --noEmit -p tsconfig.json","test":"bun test","prepublishOnly":"bun run build && bash ../../scripts/prepublish-allowlist.sh ."},"engines":{"bun":">=1.0.0","node":">=18"},"dependencies":{"commander":"13.1.0"},"devDependencies":{"@types/bun":"1.2.4","typescript":"5.7.3","@hasna/mailery-sdk-internal":"workspace:*"},"bugs":{"url":"mailto:support@mailery.co"},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public","provenance":true},"gitHead":"110f580078f1f6f4c3ead3fae69567ef735afd64","_id":"@hasna/mailery@0.1.0","_nodeVersion":"22.23.2","_npmVersion":"11.19.1","dist":{"integrity":"sha512-/fXuvaaTWhjJE0kGwK/UlpZdp0G59jwXY5OgEKswJUrpoClogjRVXPwGkHvvbHJmkXP6NAAcyVA1rFpXunZGUg==","shasum":"f0ce767a7d0a5d178f792e59b93317959276991a","tarball":"https://registry.npmjs.org/@hasna/mailery/-/mailery-0.1.0.tgz","fileCount":13,"unpackedSize":284250,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@hasna%2fmailery@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDVodEDZJiwAh1672bsLes1KWFhDnpq8GZ0QqEqSTKOZgIhAKKgWCLMFnBDEX2ZBqMEs3k2mIondH48GLzke7S1O91r"}]},"_npmUser":{"name":"andreihasna2","email":"andrei@hasna.com"},"directories":{},"maintainers":[{"name":"andreihasna2","email":"andrei@hasna.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mailery_0.1.0_1789510519592_0.9371621132341901"},"_hasShrinkwrap":false}},"maintainers":[{"name":"andreihasna2","email":"andrei@hasna.com"}],"description":"Email identity for agents — the mailery.co CLI and MCP server. Signup, subscribe, buy a domain, and send/receive real email from the terminal.","homepage":"https://mailery.co","keywords":["mailery","email","agents","cli","mcp","smtp","domains"],"repository":{"type":"git","url":"git+https://github.com/hasna/mailery.git","directory":"packages/cli"},"author":{"name":"Andrei Hasna","email":"andrei@hasna.com"},"bugs":{"url":"mailto:support@mailery.co"},"license":"Apache-2.0","readme":"# mailery\n\n**Email identity for agents.** One npm package — CLI, MCP server, and SDK — gives an agent\na managed, deliverable email identity: signup, subscribe, buy a domain, send, and\nreceive. Every command is a thin call to the mailery.co API; there is **no local\nserver, no self-host mode, ever**.\n\nTwo steps intentionally happen in a browser — everything else is terminal-only: a\none-time **email-verification** click (confirm it from the terminal with\n`mailery verify`) and the **Stripe Checkout** page for `subscribe`.\n\n**The Free plan is real and needs no subscription**: every verified account gets\n1 agent identity on a shared subdomain and **3,000 emails/mo** — signup →\nverify → `keys create` → `mailboxes create` → `send` all work in the first\nminutes, no card. Paid plans add **custom domains**, more mailboxes, per-domain\nDMARC reports & policy management, and higher limits. On the paid path, *your\nown domain* is not a first-60-seconds\nstep: the first `domains buy` is gated by an anti-fraud cooling-off (a settled\npayment on file **and** a ~7-day account age — see the heads-up below).\n\n- CLI **and** MCP server in one binary (`mailery` and `mailery mcp`).\n- Agent-first UX: non-interactive flags for everything, a `--json` envelope on\n  every command, meaningful exit codes, and errors that tell you the next command.\n- Public client package; every secret stays server-side.\n\n## Install the CLI and MCP executable\n\n```sh\nnpm i -g @hasna/mailery     # or: bun add -g @hasna/mailery\nmailery --help\n```\n\n## Install the SDK in a project\n\nGlobal installation only exposes the executable; it does not add an importable\nproject dependency. Install the same package locally before using the SDK\nsubpath:\n\n```sh\nnpm install @hasna/mailery\n```\n\n```ts\nimport { MaileryClient } from \"@hasna/mailery/sdk\";\n```\n\nRequires Node 18+ (or Bun). The hosted API is the default\n(`https://mailery.co`); tests can point at a different API origin with\n`MAILERY_BASE_URL`.\n\n## Quickstart — Free plan (signup → verify → key → shared mailbox → send)\n\nNo subscription, no card. The Free plan is 1 mailbox on the shared subdomain\n(`shared_domain` in `GET /api/v1`, e.g. `agents.mailery.co`),\n3,000 emails/mo, 0 custom domains.\n\n```sh\n# 1. create an account — session token is printed ONCE (store it securely)\nmailery signup --email you@example.com --password 'StrongPass!42' --json\n# Store the returned token:\nexport MAILERY_SESSION_TOKEN='sess_...'\n\n# 2. verify your email — signup emails a one-time link; open it once in a browser\n#    (it lands on a plain confirmation page). Confirm from the terminal any time with\n#    `mailery verify` (add --resend to re-issue the link). In production,\n#    verification is required before you can mint keys or subscribe.\n#\n#    AGENTS: skip the manual status check and use `--poll`. It waits (bounded)\n#    for that single human click, then prints a fresh session token:\nmailery verify --poll --json\n# -> {\"ok\":true,\"data\":{\"verified\":true,\"token\":\"sess_...\"}}\n# Store it: export MAILERY_SESSION_TOKEN='sess_...'\n# Defaults: --timeout 600s (max 1800), --interval 15s (keep >= 15s: the server\n# rate-limits polling at 5/min/IP).\n\n# 3. mint an API key — no subscribe needed; printed ONCE (store it securely)\nmailery keys create --scopes full --json\n# Store the returned key:\nexport MAILERY_API_KEY='ml_...'\n\n# 4. your free identity: one mailbox on the shared subdomain\nmailery mailboxes create yourbot@agents.mailery.co --json\n\n# 5. send (metered: 3,000/mo on the Free plan) and receive\nmailery send --from yourbot@agents.mailery.co --to human@example.com --subject \"hi\" --text \"sent by an agent\"\nmailery inbox --json\nmailery inbox --watch          # stream new messages as they arrive\nmailery read <message-id> --json\n```\n\n## Upgrade path — your own domain (subscribe → buy → send)\n\nCustom domains, more mailboxes, per-domain DMARC reports & policy management,\nand higher send limits are paid-tier features (`pro` / `scale`).\n\n```sh\n# 1. subscribe to a paid identity tier — plan is `pro` or `scale` (\"starter\" is\n#    NOT a plan). Prints a Stripe Checkout URL, opens the browser when\n#    interactive, then polls until the entitlement is active (--no-wait skips).\nmailery subscribe pro\n\n# 2. get a working, deliverable identity in ONE command:\n#    purchase -> zone -> mail DNS -> verification -> ready-to-send\nmailery billing add-funds 25 --yes --idempotency-key <stable-key>  # domains are paid from a prepaid wallet\nmailery domains search agent-mail.com --json      # check availability\nmailery domains buy agent-mail.com                # fetch and show the signed quote; no purchase\nmailery domains buy agent-mail.com --yes --max-price-cents <quoted-cents> --currency <quoted-currency> --idempotency-key <suggested-key>\n\n# 3. a mailbox on that domain, then send (--from an address, or --mailbox <id>)\nmailery mailboxes create bot@agent-mail.com --json\nmailery send --from bot@agent-mail.com --to human@example.com --subject \"hi\" --text \"sent by an agent\"\n```\n\nAlready own the domain? Connect it instead of buying — nothing is charged,\nand Mailery never touches your DNS unless you pass a consent flag:\n\n```sh\nmailery domains setup agent-mail.com --address bot --inbound --mx-migration-consent --json\n#   -> the DNS records to publish (TXT/CNAME for sending, MX for inbound); publish them at your DNS host\nmailery domains verify <id>                       # re-check until dns/outbound read \"ready\"\nmailery domains enable-outbound <id>              # then enable-inbound <id> for receiving\nmailery mailboxes create bot@agent-mail.com      # --address only PLANS the address; this creates it\n```\n\n`domains dns <id>` lists the records and which are verified; `domains disable <id>`\npauses a domain and the enable verbs lift that pause again (a restriction Mailery\nimposed returns `domain_restricted` instead). Re-running `domains setup` on a\ndomain that already sends re-plans it and pauses sending until `verify` and\n`enable-outbound` are run again. Every verb also takes `--json`.\n\n> **Heads-up on the first domain purchase.** `domains buy` starts a paid purchase, so\n> a tenant's FIRST purchase is gated by an anti-fraud cooling-off: it requires a\n> settled (captured) payment on file **and** an account older than\n> `MAILERY_DOMAIN_PURCHASE_MIN_ACCOUNT_AGE_DAYS` (default 7 days). Until both are\n> true the command returns `settled_funds_required` with a hint telling you what\n> to do (complete `subscribe`, then let the account age). This is not the \"first\n> 60 seconds\" step — it is the deliverable-identity step you reach once the\n> account is established. `domains buy` is otherwise entirely server-side and\n> **resumable**: if it is interrupted, re-run the same command and it continues\n> from where it left off.\n>\n> **Domains are paid from a prepaid wallet.** Add funds first\n> (`mailery billing add-funds 25 --yes --idempotency-key <key>`, minimum $10);\n> the exact quoted all-in price is debited before anything is registered. A\n> wallet that cannot cover the quote returns `wallet_insufficient_funds` with\n> the shortfall and registers nothing. Check it with `mailery billing wallet`.\n\n## Authentication model\n\n**Credentials are NEVER stored in config files.** All authentication happens through\nenvironment variables for security.\n\n1. `signup` / `login` (email + password) → a **session token**, printed ONCE.\n   Store it securely: `export MAILERY_SESSION_TOKEN='sess_...'` or use a secret manager.\n2. `keys create --scopes …` mints a scoped **API key**, printed ONCE.\n   Store it securely: `export MAILERY_API_KEY='ml_...'` or use a secret manager.\n3. `keys revoke --all` is the **break-glass** escape hatch: it revokes every API\n   key and works with password auth alone —\n   `mailery keys revoke --all --email you@example.com --password '…'` — even\n   when no usable key or session is in the environment.\n\nThe CLI does not persist config, credentials, base URLs, email context, cache,\nor mail data. It reads runtime state from environment variables only:\n`MAILERY_API_KEY`, `MAILERY_SESSION_TOKEN`, `MAILERY_BASE_URL`. Client\nconstruction and command startup do not inspect, create, modify, or delete\nlocal config files; any historical files are left untouched.\n\n## Commands\n\n| Command | What it does |\n|---|---|\n| `signup --email --password [--name] [--invite-code]` | Create an account; returns session token (shown once) |\n| `login --email --password` / `logout` | Session lifecycle (tokens in env, not stored) |\n| `verify [--resend] [--poll]` | Check email-verification status from the terminal (email link is a one-time browser step). `--poll` waits for that click (default 10 min, max 30; `--email`, `--timeout`, `--interval`) and prints a fresh session token — the machine-bootstrap loop: `signup` → `verify --poll` → `keys create` → `export MAILERY_SESSION_TOKEN=…`/`export MAILERY_API_KEY=…` |\n| `whoami` | Current identity, tenant, auth scopes |\n| `account export [--output <path>\\|-] [--page-size <n>]` | Write a JSON export of the whole account (profile, mailboxes, labels, domains, key metadata, subscriptions, credits, every message with bodies and attachment metadata) to a file, or to stdout with `-`; session token only, never billing-gated |\n| `account delete --password <pw> --confirm-email <email>` | Permanently delete the account and everything in it (irreversible); refuses unless the typed email matches the session identity, and while a subscription is still active |\n| `keys create --scopes <csv> [--name]` | Mint an API key (shown once; store securely) |\n| `keys list` / `keys revoke <id>` / `keys revoke --all` | Manage keys (revoke `--all` = break-glass) |\n| `subscribe <plan> [--no-wait]` | Stripe Checkout handoff, then poll entitlement |\n| `billing status` / `usage` | Credit balance, inbound allowance/count/status/reset, prepaid wallet, plans, subscriptions, ledger |\n| `billing wallet [--limit <n>]` | Prepaid wallet balance and recent wallet transactions (domains are charged to it) |\n| `billing add-funds <dollars> --yes --idempotency-key <key>` | Stripe Checkout handoff that adds funds to the wallet (minimum $10; presets 10/25/50/100) |\n| `domains search <q>` | Domain availability |\n| `domains buy <domain> [--yes --max-price-cents <cents> --currency <code>] --idempotency-key <key>` | Show a binding quote and suggested stable key first; purchase only with price- and currency-bound consent |\n| `domains list` / `domains status <domain>` | Inspect domains |\n| `domains add <domain> [--mailbox-id <id> --catch-all]` | Register a domain you already own as a lifecycle record; publishes nothing, changes no DNS |\n| `domains setup <domain> [--address <local-part> --inbound --mx-migration-consent --dns-delegation-consent]` | Connect a domain you own and get the DNS records to publish. The MX record and nameservers change only with the explicit consent flags; `--address` only plans the mailbox address (create it with `mailboxes create`); `--buy` purchases it first under the same quote/confirm consent as `domains buy` |\n| `domains dns <id>` | The DNS records Mailery needs for the domain and whether each one is verified yet |\n| `domains verify <id>` | Re-check DNS and the mail identity after publishing records; refreshes readiness and prints the next step |\n| `domains enable-inbound <id>` / `domains enable-outbound <id>` | Turn on receiving (provisions Mailery's inbound routing; the MX must be published) or sending once that axis is ready |\n| `domains disable <id> [--reason <text>]` | Pause inbound and outbound and withdraw inbound routing; the enable verbs lift the pause (a restriction Mailery imposed returns `domain_restricted`) |\n| `domains renew <id> --yes --idempotency-key <key> [--auto-renew on\\|off]` | Renew a Mailery-purchased domain, charged to the prepaid wallet |\n| `domains auto-renew <id> on\\|off` | Auto-renew opt-in; renews only when the wallet covers the quote, otherwise notifies. Charges nothing |\n| `mailboxes create <addr> [--provider]` / `mailboxes list` | Manage mailboxes |\n| `send (--from <addr> \\| --mailbox <id>) --to <csv> [--subject --text --html …]` | Send hosted mail (`--from` resolves an address to your mailbox; body via flags or stdin) |\n| `inbox [--watch]` / `read <id>` | Receive |\n| `attachments download <messageId> [attachmentId] [--output <path>]` | List a message's attachments (omit the id) or download one (`--output -` streams raw bytes to stdout; default writes to the attachment's filename in the current directory) |\n| `webhooks create <url> [--events <csv>] [--description]` | Register an HTTPS endpoint for signed events (secret shown once); webhooks-first, polling is the fallback |\n| `webhooks list` / `get <id>` / `update <id> [--url --events --status]` / `delete <id>` | Manage endpoints (`--status active` re-enables a breaker-tripped one) |\n| `suppressions list [--reason --email --limit --cursor]` | Addresses hosted send refuses (bounces and spam complaints) |\n| `suppressions remove <id> [--confirm]` | Clear one suppression; `--confirm` is required for a spam complaint |\n| `mailboxes delete <id> [--purge]` | Delete a mailbox; `--purge` also deletes the mail it holds |\n| `webhooks rotate-secret <id>` / `test <id>` / `deliveries <id> [--status]` / `redeliver <id> <deliveryId>` | Rotate the signing secret, queue a test, inspect delivery history, re-queue an event |\n| `feedback <message> [--kind --severity --url --tag]` | Product feedback |\n| `mcp` | Run the stdio MCP server |\n\n### Output & exit codes\n\nAdd `--json` to any command for a single machine-parseable envelope:\n\n```json\n{ \"ok\": true, \"data\": { /* result */ } }\n{ \"ok\": false, \"error\": { \"code\": \"billing_required\", \"message\": \"…\", \"status\": 402, \"hint\": \"…\" } }\n```\n\nExit codes: `0` success · `1` runtime/API error · `2` usage error.\n\n## MCP server\n\n```sh\nmailery mcp        # JSON-RPC 2.0 over stdio (newline-delimited)\n```\n\nRegister it with any MCP client:\n\n```json\n{ \"mcpServers\": { \"mailery\": { \"command\": \"mailery\", \"args\": [\"mcp\"],\n  \"env\": { \"MAILERY_API_KEY\": \"ml_…\" } } } }\n```\n\nTools: `send_email`, `list_inbox`, `read_message`, `update_message`,\n`list_changes`, `list_mailboxes`, `search_domains`, `get_domain_status`, `buy_domain`,\n`create_mailbox`, `generate_digest`, `list_digests`, `get_billing_status`,\n`create_webhook`, `list_webhooks`, `test_webhook`, `list_suppressions`,\n`submit_feedback`.\n\n## License\n\nApache-2.0. Install and use the public package as `@hasna/mailery`.\n","readmeFilename":"README.md"}