Skip to content

feat(cli): add hosting mail commands - #63

Merged
sanchpet merged 3 commits into
mainfrom
feat/cli-mail
Jul 13, 2026
Merged

feat(cli): add hosting mail commands#63
sanchpet merged 3 commits into
mainfrom
feat/cli-mail

Conversation

@sanchpet

Copy link
Copy Markdown
Owner

What

Adds sweb hosting mail …, surfacing the shared-hosting email service (SDK vh/mail, endpoint /vh/mail, 37 methods) under the existing hosting group. The command tree:

  • mail domains — list mail domains with per-domain settings (SPF/DKIM/sender-verify/autodiscover/collector)
  • mail quota — total size of all mailboxes
  • mail mailbox list|create|delete|password|comment|antispam|spf|purge|requisites
  • mail forwarding list|add|remove|delete-after
  • mail autoreply get|set
  • mail dkim enable|disable
  • mail whitelist list|add|remove and mail blacklist list|add|remove
  • mail delivery info|list|add|remove (the mailing list)
  • mail collector get|set|remove|confirm
  • mail domain spf|sender-verify|autodiscover (domain-wide toggles)

All 37 SDK methods are exposed. confirmMailsCollectorEmail is folded into the collector group as collector confirm (only reachable from the cross-domain collector set flow) rather than a top-level command.

Why

Mail is the owner's actively-used hosting product; it was reachable only via the SDK. This makes it a first-class CLI surface.

Design choices for UX over a mechanical 1-command-per-method mapping:

  • Methods grouped into a task-shaped tree (mailbox lifecycle, forwarding, lists, delivery, collector, domain toggles).
  • Reads render through the shared render helper — human table or -o json.
  • Mutating/destructive operations (create billable mailbox, delete/purge mailbox, remove forwarding/collector) guard behind the confirmed prompt with --yes.
  • Antispam filter levels and SPF/DKIM state are spoken in words (hard|medium|soft|off, on|off), not the API's raw ints.

Commands self-register via init() off the existing hosting group; no shared files change. mise run ci (lint + test + build) is green, with a test asserting the full mail subtree plus unit tests for the helpers.

sanchpet added 2 commits July 13, 2026 18:14
Surface the shared-hosting email service (SDK vh/mail, /vh/mail) under the
existing `hosting` parent group so the owner can drive their actively-used
mail product from the CLI: mail domains and per-domain settings, the mailbox
lifecycle, forwarding, autoreply, DKIM, per-mailbox white/black lists, the
mailing (delivery) list, and the domain mail collector.

The 37 SDK methods are grouped into a task-shaped command tree rather than one
command per method, and reads render through the shared `render` helper (table
or `-o json`) while mutating/destructive operations (delete mailbox, purge
mail, remove forwarding/collector, create billable mailbox) guard behind the
`confirmed` prompt with `--yes`. Filter levels and on/off flags are spoken in
words, not the API's raw ints. Commands self-register via `init()` off the
existing `hosting` group; no shared files change.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: sanchpet <petrov@sanch.pet>
@sanchpet sanchpet closed this Jul 13, 2026
@sanchpet sanchpet reopened this Jul 13, 2026
The flat cmd package already gained an identical findSub (from the db
commands); mail's copy collided once both landed. Reuse the shared one.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: sanchpet <petrov@sanch.pet>
@sanchpet
sanchpet merged commit adf2893 into main Jul 13, 2026
2 checks passed
@sanchpet
sanchpet deleted the feat/cli-mail branch July 13, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant