feat: add emails metrics command

Merged
DI
2mo ago
+350-1

Adds resend emails metrics for account-level email metrics โ€” period/domain/email/broadcast dimensions, domain_id/email_id/broadcast_id filters (broadcast and email mutually exclusive), all granularities.

Mirrors https://github.com/resend/resend-node/pull/1079.


Summary by cubic

Adds resend emails metrics to fetch account-level email metrics. Previously there was no metrics command; now users can query totals and optional breakdowns, with JSON in non-interactive mode and readable tables in interactive mode. Upgrades resend to 6.22.0 to enable emails.metrics.

  • Wires the metrics subcommand into emails, updates help/examples, and documents it in skills/resend-cli/SKILL.md and skills/resend-cli/references/emails.md.
  • Supports dimensions: period, domain, email, broadcast; validates --granularity via choices: hourly/daily/weekly/monthly.
  • Supports filters: --domain-id, --email-id, --broadcast-id; enforces email vs. broadcast mutual exclusivity by option presence (explicitly empty values count) and returns invalid_options without calling the SDK.