Skip to content

feat: open command for broadcasts and templates to open in browser#104

Merged
felipefreitag merged 7 commits intoresend:mainfrom
Shubhdeep12:feat/open-broadcasts-templates
Mar 20, 2026
Merged

feat: open command for broadcasts and templates to open in browser#104
felipefreitag merged 7 commits intoresend:mainfrom
Shubhdeep12:feat/open-broadcasts-templates

Conversation

@Shubhdeep12
Copy link
Contributor

@Shubhdeep12 Shubhdeep12 commented Mar 14, 2026

added command to open

  • templates list
  • a specific template
  • broadcasts list
  • specific broadcast

in the default browser. similar to resend open for emails.

related #103


Summary by cubic

Adds resend broadcasts open and resend templates open to open lists or specific items in the dashboard. Refactors open behavior into a shared util with consistent output; updates resend open and resend auth login.

  • New Features

    • resend broadcasts open [id] opens the broadcasts list or a specific broadcast.
    • resend templates open [id] opens the templates list or a specific template.
    • All open commands use openInBrowserOrLog and RESEND_URLS; respect --json/--quiet.
  • Bug Fixes

    • Corrected broadcast URL (removed /editor).
    • Quoted URL on Windows to prevent cmd.exe metacharacter issues.
    • Clarified templates open accepts only an ID.
    • Updated tests to mock openInBrowserOrLog to match the new behavior.

Written for commit 3efdeba. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 10 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/lib/browser.ts">

<violation number="1" location="src/lib/browser.ts:19">
P2: Windows URL opening uses `cmd.exe /c start` with an unescaped URL, allowing CMD metacharacters (e.g., `&`) to break execution or inject commands.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@Shubhdeep12
Copy link
Contributor Author

hey @felipefreitag any thoughts here?

felipefreitag and others added 3 commits March 20, 2026 13:43
… test mocks

- Remove /editor suffix from broadcast URL to match dashboard pattern
- Remove misleading "or alias" from template open argument description
- Remove alias test case that didn't test real alias resolution
- Mock openInBrowserOrLog instead of openInBrowser in all open tests
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

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/lib/browser.ts">

<violation number="1" location="src/lib/browser.ts:19">
P2: Windows `cmd.exe` invocation is vulnerable to argument injection because `url` is manually quoted while `windowsVerbatimArguments` is enabled.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@felipefreitag felipefreitag force-pushed the feat/open-broadcasts-templates branch from 5d3a2ef to 3efdeba Compare March 20, 2026 17:37
@felipefreitag felipefreitag merged commit b23d9e2 into resend:main Mar 20, 2026
7 checks passed
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.

2 participants