Add CLI for sending emails and listing templates#1
Merged
Conversation
Wraps the existing sendEmail, sendEmailToMailingList, and listEmailTemplates helpers in a Commander-based CLI, exposed via the new 'schemavaults-send-email' bin entry. The CLI is bundled with esbuild so it runs cleanly under Node ESM (the SchemaVaults dependency chain currently emits extension-less relative imports that only resolve under bun). Also enables tsc-alias resolveFullPaths so the library's own dist emits proper .js extensions on relative imports for Node ESM consumers.
- list-email-templates: add a CLI usage section (bunx schemavaults-send-email list-templates) and recommend it as the simplest path for one-off catalog discovery; keep the /tmp/ Bun script as a fallback for richer queries. - send-email-to-mailing-list: add a CLI usage section covering text/html, template, mailing-list-override, file-based body, and --body-file flows; rework the Claude-Code-post-workflow-notification section to recommend the CLI as the primary path for simple end-of-task emails (one shell command, no scratch script) and keep the /tmp/ Bun script as a fallback for bodies too elaborate for shell quoting. - send-one-off-email: new skill covering single-recipient and small-fanout sends -- a use case the existing skill set didn't address. The CLI's `send` subcommand makes this trivial; the helper is documented for application-code embedding. Frontmatter descriptions updated so the skills' triggers reflect the CLI as a first-class entry point.
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.
Summary
This PR adds a command-line interface (CLI) to the
@schemavaults/send-emailpackage, enabling users to send emails and list templates directly from the shell without writing code. The CLI wraps the existingsendEmail(),sendEmailToMailingList(), andlistEmailTemplates()helpers.Key Changes
New CLI entry point (
src/cli.ts): A comprehensive command-line tool with three subcommands:send— Send an email to one or more individual recipientssend-to-mailing-list— Send an email to a mailing listlist-templates— List available email templates in JSON or table formatCLI features:
--api-keyand--environment(applied to all subcommands)--text-file,--html-file,--body-file) for large or complex content--to alice@example.com --to bob@example.com)Package configuration:
commanderdependency for CLI argument parsingbinentry inpackage.jsonto registerschemavaults-send-emailas an executablebuild:lib(TypeScript compilation) andbuild:cli(esbuild bundling with Node.js compatibility)Documentation:
.claude/skills/send-one-off-email/SKILL.mddocumenting the one-off email sending workflow.claude/skills/send-email-to-mailing-list/SKILL.mdto document the new CLI option and recommend it as the preferred path for ad-hoc sends.claude/skills/list-email-templates/SKILL.mdto document the new CLI option for template discoveryNotable Implementation Details
commanderfor robust argument parsing and automatic--helpgenerationbuildMessage()to handle both template and raw text/HTML modesoptsWithGlobals()https://claude.ai/code/session_01FYgbBN91L6CpSeRksx8ks3