resend-cli 2.1.0 → 2.2.1-rc-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/README.md +9 -9
- package/dist/cli.cjs +138 -139
- package/package.json +33 -14
- package/skills/resend-cli/SKILL.md +1 -1
- package/skills/resend-cli/references/error-codes.md +1 -1
- package/skills/resend-cli/references/workflows.md +15 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resend-cli",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1-rc-0",
|
|
4
4
|
"description": "The official CLI for Resend",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">=20"
|
|
20
20
|
},
|
|
21
|
+
"packageManager": "pnpm@10.33.0",
|
|
21
22
|
"files": [
|
|
22
23
|
"dist/cli.cjs",
|
|
23
24
|
"skills/"
|
|
@@ -26,31 +27,49 @@
|
|
|
26
27
|
"bin": {
|
|
27
28
|
"resend": "./dist/cli.cjs"
|
|
28
29
|
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"dev": "tsx src/cli.ts",
|
|
32
|
+
"dev:watch": "tsx --watch src/cli.ts",
|
|
33
|
+
"build": "node scripts/build.mjs",
|
|
34
|
+
"build:bin": "pnpm build && pkg dist/cli.cjs --config package.json --compress Brotli --target node24 --output dist/resend",
|
|
35
|
+
"lint": "biome check .",
|
|
36
|
+
"lint:fix": "biome check --write .",
|
|
37
|
+
"typecheck": "tsc --noEmit",
|
|
38
|
+
"test": "vitest run",
|
|
39
|
+
"test:e2e": "vitest run --config vitest.config.e2e.ts",
|
|
40
|
+
"prepack": "pnpm install && pnpm build && node scripts/verify-bundle.mjs"
|
|
41
|
+
},
|
|
29
42
|
"dependencies": {
|
|
30
43
|
"@clack/prompts": "1.2.0",
|
|
31
44
|
"@commander-js/extra-typings": "14.0.0",
|
|
32
45
|
"commander": "14.0.3",
|
|
33
46
|
"esbuild": "0.28.0",
|
|
47
|
+
"esbuild-wasm": "0.28.0",
|
|
34
48
|
"picocolors": "1.1.1",
|
|
35
49
|
"resend": "6.12.0"
|
|
36
50
|
},
|
|
51
|
+
"pkg": {
|
|
52
|
+
"scripts": [
|
|
53
|
+
"node_modules/esbuild-wasm/bin/esbuild",
|
|
54
|
+
"node_modules/esbuild-wasm/wasm_exec.js",
|
|
55
|
+
"node_modules/esbuild-wasm/wasm_exec_node.js"
|
|
56
|
+
],
|
|
57
|
+
"assets": [
|
|
58
|
+
"node_modules/esbuild-wasm/esbuild.wasm"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"pnpm": {
|
|
62
|
+
"onlyBuiltDependencies": [
|
|
63
|
+
"esbuild",
|
|
64
|
+
"@biomejs/biome"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
37
67
|
"devDependencies": {
|
|
38
68
|
"@biomejs/biome": "2.4.11",
|
|
39
69
|
"@types/node": "24.12.2",
|
|
40
|
-
"@yao-pkg/pkg": "6.
|
|
70
|
+
"@yao-pkg/pkg": "6.15.0",
|
|
41
71
|
"tsx": "4.21.0",
|
|
42
72
|
"typescript": "5.9.3",
|
|
43
73
|
"vitest": "4.1.4"
|
|
44
|
-
},
|
|
45
|
-
"scripts": {
|
|
46
|
-
"dev": "tsx src/cli.ts",
|
|
47
|
-
"dev:watch": "tsx --watch src/cli.ts",
|
|
48
|
-
"build": "node scripts/build.mjs",
|
|
49
|
-
"build:bin": "pnpm build && pkg dist/cli.cjs --compress Brotli --target node24 --output dist/resend",
|
|
50
|
-
"lint": "biome check .",
|
|
51
|
-
"lint:fix": "biome check --write .",
|
|
52
|
-
"typecheck": "tsc --noEmit",
|
|
53
|
-
"test": "vitest run",
|
|
54
|
-
"test:e2e": "vitest run --config vitest.config.e2e.ts"
|
|
55
74
|
}
|
|
56
|
-
}
|
|
75
|
+
}
|
|
@@ -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 one of
|
|
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
|