feat: add --dry-run option for email and broadcast commands#184
feat: add --dry-run option for email and broadcast commands#184felipefreitag merged 5 commits intoresend:mainfrom
Conversation
…te payloads without API calls
There was a problem hiding this comment.
2 issues found across 6 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/commands/emails/send.ts">
<violation number="1" location="src/commands/emails/send.ts:78">
P2: Dry-run still performs API-related work before early return (requireClient and fetchVerifiedDomains), which can call the API and require credentials despite the “without calling the API” promise.</violation>
</file>
<file name="src/commands/broadcasts/create.ts">
<violation number="1" location="src/commands/broadcasts/create.ts:56">
P2: `--dry-run` is documented as making no API calls, but the command still performs API-backed lookups (domains/topic/segment pickers) before the dry-run check, so interactive dry runs can still hit the API.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
… interactive input without API calls
|
@Shubhdeep12 Thanks for adding this. |
|
|
||
| if (opts.dryRun) { | ||
| outputResult( | ||
| { dry_run: true, request: createPayload }, |
There was a problem hiding this comment.
All other keys are in camelCase, I think this one should be too
| if (opts.dryRun) { | ||
| outputResult( | ||
| { | ||
| dry_run: true, |
There was a problem hiding this comment.
All other keys are in camelCase, I think this one should be too
hey @felipefreitag I’d suggest keeping interactive |
felipefreitag
left a comment
There was a problem hiding this comment.
See discussion about interactive mode
emails sendandbroadcast createcommands as they are write-heavy.Summary by cubic
Adds a
--dry-runmode toemails sendandbroadcasts createto validate payloads and print the exact request JSON without calling the API. Output is{ "dryRun": true, "request": { ... } }and works interactively without network calls or an API key.resend emails send --dry-run: validates and prints{ "dryRun": true, "request": { ... } }; attachments summarized asfilenameandbyteLength; respects--json; skips verified-domain lookup in interactive mode.resend broadcasts create --dry-run: validates and prints the create payload (includessend/scheduledAtwhen set); respects--json; in interactive mode, prompts for segment/topic IDs instead of fetching lists.README.md,skills/resend-cli/SKILL.md); other write commands remain unchanged (no dry-run yet).Written for commit 1d1f5ff. Summary will update on new commits.