resend-cli 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resend-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "The official CLI for Resend",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -31,13 +31,24 @@
|
|
|
31
31
|
"@commander-js/extra-typings": "14.0.0",
|
|
32
32
|
"commander": "14.0.3",
|
|
33
33
|
"esbuild": "0.28.0",
|
|
34
|
+
"esbuild-wasm": "0.28.0",
|
|
34
35
|
"picocolors": "1.1.1",
|
|
35
|
-
"resend": "6.
|
|
36
|
+
"resend": "6.12.0"
|
|
37
|
+
},
|
|
38
|
+
"pkg": {
|
|
39
|
+
"scripts": [
|
|
40
|
+
"node_modules/esbuild-wasm/bin/esbuild",
|
|
41
|
+
"node_modules/esbuild-wasm/wasm_exec.js",
|
|
42
|
+
"node_modules/esbuild-wasm/wasm_exec_node.js"
|
|
43
|
+
],
|
|
44
|
+
"assets": [
|
|
45
|
+
"node_modules/esbuild-wasm/esbuild.wasm"
|
|
46
|
+
]
|
|
36
47
|
},
|
|
37
48
|
"devDependencies": {
|
|
38
49
|
"@biomejs/biome": "2.4.11",
|
|
39
50
|
"@types/node": "24.12.2",
|
|
40
|
-
"@yao-pkg/pkg": "6.
|
|
51
|
+
"@yao-pkg/pkg": "6.15.0",
|
|
41
52
|
"tsx": "4.21.0",
|
|
42
53
|
"typescript": "5.9.3",
|
|
43
54
|
"vitest": "4.1.4"
|
|
@@ -46,7 +57,7 @@
|
|
|
46
57
|
"dev": "tsx src/cli.ts",
|
|
47
58
|
"dev:watch": "tsx --watch src/cli.ts",
|
|
48
59
|
"build": "node scripts/build.mjs",
|
|
49
|
-
"build:bin": "pnpm build && pkg dist/cli.cjs --compress Brotli --target node24 --output dist/resend",
|
|
60
|
+
"build:bin": "pnpm build && pkg dist/cli.cjs --config package.json --compress Brotli --target node24 --output dist/resend",
|
|
50
61
|
"lint": "biome check .",
|
|
51
62
|
"lint:fix": "biome check --write .",
|
|
52
63
|
"typecheck": "tsc --noEmit",
|
|
@@ -27,6 +27,7 @@ Create a new domain and receive DNS records to configure.
|
|
|
27
27
|
| `--name <domain>` | string | Yes (non-interactive) | Domain name (e.g., `example.com`) |
|
|
28
28
|
| `--region <region>` | string | No | `us-east-1` \| `eu-west-1` \| `sa-east-1` \| `ap-northeast-1` |
|
|
29
29
|
| `--tls <mode>` | string | No | `opportunistic` (default) \| `enforced` |
|
|
30
|
+
| `--tracking-subdomain <subdomain>` | string | No | Subdomain for click and open tracking (e.g., `track`) |
|
|
30
31
|
| `--sending` | boolean | No | Enable sending (default: enabled) |
|
|
31
32
|
| `--receiving` | boolean | No | Enable receiving (default: disabled) |
|
|
32
33
|
|
|
@@ -38,7 +39,7 @@ Create a new domain and receive DNS records to configure.
|
|
|
38
39
|
|
|
39
40
|
**Argument:** `<id>` — Domain ID
|
|
40
41
|
|
|
41
|
-
Returns full domain with `records[]`, `status` (`not_started`|`pending`|`verified`|`failed`|`temporary_failure`), `capabilities`, `region`.
|
|
42
|
+
Returns full domain with `records[]`, `status` (`not_started`|`pending`|`verified`|`failed`|`temporary_failure`), `capabilities`, `region`, `open_tracking`, `click_tracking`, `tracking_subdomain`. Records may include a `Tracking` CNAME record when a tracking subdomain is configured, and a `TrackingCAA` CAA record when the root domain has CAA records that require an additional entry for AWS certificate issuance.
|
|
42
43
|
|
|
43
44
|
---
|
|
44
45
|
|
|
@@ -63,6 +64,7 @@ Trigger async DNS verification.
|
|
|
63
64
|
| `--no-open-tracking` | boolean | Disable open tracking |
|
|
64
65
|
| `--click-tracking` | boolean | Enable click tracking |
|
|
65
66
|
| `--no-click-tracking` | boolean | Disable click tracking |
|
|
67
|
+
| `--tracking-subdomain <subdomain>` | string | Subdomain for click and open tracking (e.g., `track`) |
|
|
66
68
|
|
|
67
69
|
At least one option required.
|
|
68
70
|
|
|
@@ -20,7 +20,7 @@ All errors exit with code `1` and output JSON to **stderr**:
|
|
|
20
20
|
| Code | Cause | Resolution |
|
|
21
21
|
|------|-------|------------|
|
|
22
22
|
| `missing_body` | None of `--text`, `--html`, `--html-file`, or `--react-email` provided | Provide at least one body flag |
|
|
23
|
-
| `react_email_build_error` | Failed to bundle a React Email `.tsx` template with esbuild | Check the template compiles; ensure `react` and `@react-email/
|
|
23
|
+
| `react_email_build_error` | Failed to bundle a React Email `.tsx` template with esbuild | Check the template compiles; ensure `react` and one of `react-email` (6.0+), `@react-email/components` (5.x), or `@react-email/render` are installed in the project |
|
|
24
24
|
| `react_email_render_error` | Bundled template failed during `render()` | Check the component exports a default function and renders valid React Email markup |
|
|
25
25
|
| `file_read_error` | Could not read file from `--html-file` path | Check file path exists and is readable |
|
|
26
26
|
| `send_error` | Resend API rejected the send request | Check from address is on a verified domain; check recipient is valid |
|
|
@@ -27,31 +27,31 @@ resend doctor -q
|
|
|
27
27
|
```bash
|
|
28
28
|
# Basic text email
|
|
29
29
|
resend emails send \
|
|
30
|
-
--from "you@
|
|
30
|
+
--from "you@example.com" \
|
|
31
31
|
--to recipient@example.com \
|
|
32
32
|
--subject "Hello" \
|
|
33
33
|
--text "Body text"
|
|
34
34
|
|
|
35
35
|
# HTML email with attachments
|
|
36
36
|
resend emails send \
|
|
37
|
-
--from "Name <you@
|
|
37
|
+
--from "Name <you@example.com>" \
|
|
38
38
|
--to alice@example.com bob@example.com \
|
|
39
39
|
--subject "Report" \
|
|
40
40
|
--html-file ./email.html \
|
|
41
41
|
--attachment ./report.pdf \
|
|
42
42
|
--cc manager@example.com \
|
|
43
|
-
--reply-to support@
|
|
43
|
+
--reply-to support@example.com
|
|
44
44
|
|
|
45
45
|
# React Email template (.tsx) — bundles, renders to HTML, and sends
|
|
46
46
|
resend emails send \
|
|
47
|
-
--from "you@
|
|
47
|
+
--from "you@example.com" \
|
|
48
48
|
--to recipient@example.com \
|
|
49
49
|
--subject "Welcome" \
|
|
50
50
|
--react-email ./emails/welcome.tsx
|
|
51
51
|
|
|
52
52
|
# React Email with plain-text fallback
|
|
53
53
|
resend emails send \
|
|
54
|
-
--from "you@
|
|
54
|
+
--from "you@example.com" \
|
|
55
55
|
--to recipient@example.com \
|
|
56
56
|
--subject "Welcome" \
|
|
57
57
|
--react-email ./emails/welcome.tsx \
|
|
@@ -59,7 +59,7 @@ resend emails send \
|
|
|
59
59
|
|
|
60
60
|
# Scheduled email (ISO 8601 or natural language)
|
|
61
61
|
resend emails send \
|
|
62
|
-
--from "you@
|
|
62
|
+
--from "you@example.com" \
|
|
63
63
|
--to recipient@example.com \
|
|
64
64
|
--subject "Reminder" \
|
|
65
65
|
--text "Don't forget!" \
|
|
@@ -127,7 +127,7 @@ resend contacts create --email user@example.com --first-name Jane --segment-id <
|
|
|
127
127
|
|
|
128
128
|
# 3. Create and send broadcast
|
|
129
129
|
resend broadcasts create \
|
|
130
|
-
--from "news@
|
|
130
|
+
--from "news@example.com" \
|
|
131
131
|
--subject "Monthly Update" \
|
|
132
132
|
--segment-id <segment-id> \
|
|
133
133
|
--html "<h1>Hello {{{FIRST_NAME|there}}}</h1><p>News content...</p>" \
|
|
@@ -135,7 +135,7 @@ resend broadcasts create \
|
|
|
135
135
|
|
|
136
136
|
# Create broadcast from a React Email template
|
|
137
137
|
resend broadcasts create \
|
|
138
|
-
--from "news@
|
|
138
|
+
--from "news@example.com" \
|
|
139
139
|
--subject "Monthly Update" \
|
|
140
140
|
--segment-id <segment-id> \
|
|
141
141
|
--react-email ./emails/newsletter.tsx \
|
|
@@ -143,7 +143,7 @@ resend broadcasts create \
|
|
|
143
143
|
|
|
144
144
|
# Or create as draft first, then send later
|
|
145
145
|
resend broadcasts create \
|
|
146
|
-
--from "news@
|
|
146
|
+
--from "news@example.com" \
|
|
147
147
|
--subject "Monthly Update" \
|
|
148
148
|
--segment-id <segment-id> \
|
|
149
149
|
--html-file ./newsletter.html \
|
|
@@ -234,7 +234,7 @@ resend templates create \
|
|
|
234
234
|
--name "Welcome Email" \
|
|
235
235
|
--subject "Welcome, {{{NAME}}}!" \
|
|
236
236
|
--html "<h1>Welcome {{{NAME}}}</h1><p>Your plan: {{{PLAN}}}</p>" \
|
|
237
|
-
--from "welcome@
|
|
237
|
+
--from "welcome@example.com" \
|
|
238
238
|
--alias welcome-email \
|
|
239
239
|
--var NAME:string --var PLAN:string:free
|
|
240
240
|
|
|
@@ -362,8 +362,8 @@ jobs:
|
|
|
362
362
|
- name: Send deploy notification
|
|
363
363
|
run: |
|
|
364
364
|
resend emails send \
|
|
365
|
-
--from "deploy@
|
|
366
|
-
--to "team@
|
|
365
|
+
--from "deploy@example.com" \
|
|
366
|
+
--to "team@example.com" \
|
|
367
367
|
--subject "Deploy: ${{ github.repository }}@${{ github.sha }}" \
|
|
368
368
|
--text "Deployed by ${{ github.actor }} at $(date -u)"
|
|
369
369
|
```
|
|
@@ -372,8 +372,8 @@ jobs:
|
|
|
372
372
|
# Generic CI script
|
|
373
373
|
export RESEND_API_KEY=re_xxx
|
|
374
374
|
resend emails send -q \
|
|
375
|
-
--from "ci@
|
|
376
|
-
--to "team@
|
|
375
|
+
--from "ci@example.com" \
|
|
376
|
+
--to "team@example.com" \
|
|
377
377
|
--subject "Build complete" \
|
|
378
378
|
--text "Build ${BUILD_ID} passed all tests."
|
|
379
379
|
```
|
|
@@ -400,7 +400,7 @@ resend emails receiving attachment <email-id> <attachment-id>
|
|
|
400
400
|
|
|
401
401
|
# Forward received email
|
|
402
402
|
resend emails receiving forward <email-id> \
|
|
403
|
-
--from "forwarded@
|
|
403
|
+
--from "forwarded@example.com" \
|
|
404
404
|
--to colleague@example.com
|
|
405
405
|
|
|
406
406
|
# Watch for new inbound emails in real time
|