feat(cli): add hosting mail commands - #63
Merged
Merged
Conversation
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
sweb hosting mail …, surfacing the shared-hosting email service (SDKvh/mail, endpoint/vh/mail, 37 methods) under the existinghostinggroup. The command tree:mail domains— list mail domains with per-domain settings (SPF/DKIM/sender-verify/autodiscover/collector)mail quota— total size of all mailboxesmail mailbox list|create|delete|password|comment|antispam|spf|purge|requisitesmail forwarding list|add|remove|delete-aftermail autoreply get|setmail dkim enable|disablemail whitelist list|add|removeandmail blacklist list|add|removemail delivery info|list|add|remove(the mailing list)mail collector get|set|remove|confirmmail domain spf|sender-verify|autodiscover(domain-wide toggles)All 37 SDK methods are exposed.
confirmMailsCollectorEmailis folded into the collector group ascollector confirm(only reachable from the cross-domaincollector setflow) 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:
renderhelper — human table or-o json.confirmedprompt with--yes.hard|medium|soft|off,on|off), not the API's raw ints.Commands self-register via
init()off the existinghostinggroup; 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.