resend-cli 1.8.0 → 1.9.0-preview-automations.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": "1.8.0",
3
+ "version": "1.9.0-preview-automations.0",
4
4
  "description": "The official CLI for Resend",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "commander": "14.0.3",
33
33
  "esbuild": "0.27.4",
34
34
  "picocolors": "1.1.1",
35
- "resend": "6.10.0"
35
+ "resend": "6.10.0-preview-workflows.4"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@biomejs/biome": "2.4.8",
@@ -51,8 +51,6 @@
51
51
  "lint:fix": "biome check --write .",
52
52
  "typecheck": "tsc --noEmit",
53
53
  "test": "vitest run",
54
- "test:e2e": "vitest run --config vitest.config.e2e.ts",
55
- "sync-skill-version": "node scripts/sync-skill-version.mjs",
56
- "version": "pnpm run sync-skill-version && git add skills/resend-cli/SKILL.md"
54
+ "test:e2e": "vitest run --config vitest.config.e2e.ts"
57
55
  }
58
56
  }
@@ -3,14 +3,15 @@ name: resend-cli
3
3
  description: >
4
4
  Operate the Resend platform from the terminal — send emails (including React Email
5
5
  .tsx templates via --react-email), manage domains, contacts, broadcasts, templates,
6
- webhooks, API keys, and logs via the `resend` CLI. Use when the user wants to run
7
- Resend commands in the shell, scripts, or CI/CD pipelines, or send/preview React
8
- Email templates. Always load this skill before running `resend` commands — it
9
- contains the non-interactive flag contract and gotchas that prevent silent failures.
6
+ webhooks, API keys, logs, automations, and events via the `resend` CLI. Use when the
7
+ user wants to run Resend commands in the shell, scripts, or CI/CD pipelines, or
8
+ send/preview React Email templates. Always load this skill before running `resend`
9
+ commands — it contains the non-interactive flag contract and gotchas that prevent
10
+ silent failures.
10
11
  license: MIT
11
12
  metadata:
12
13
  author: resend
13
- version: "1.8.0"
14
+ version: "1.9.0"
14
15
  homepage: https://resend.com
15
16
  source: https://github.com/resend/resend-cli
16
17
  inputs:
@@ -21,6 +22,7 @@ references:
21
22
  - references/emails.md
22
23
  - references/domains.md
23
24
  - references/api-keys.md
25
+ - references/automations.md
24
26
  - references/broadcasts.md
25
27
  - references/contacts.md
26
28
  - references/contact-properties.md
@@ -36,6 +38,41 @@ references:
36
38
 
37
39
  # Resend CLI
38
40
 
41
+ ## Installation
42
+
43
+ Before running any `resend` commands, check whether the CLI is installed:
44
+
45
+ ```bash
46
+ resend --version
47
+ ```
48
+
49
+ If the command is not found, install it using one of the methods below:
50
+
51
+ **cURL (macOS / Linux):**
52
+ ```bash
53
+ curl -fsSL https://resend.com/install.sh | bash
54
+ ```
55
+
56
+ **Homebrew (macOS / Linux):**
57
+ ```bash
58
+ brew install resend/cli/resend
59
+ ```
60
+
61
+ **Node.js:**
62
+ ```bash
63
+ npm install -g resend-cli
64
+ ```
65
+
66
+ **PowerShell (Windows):**
67
+ ```powershell
68
+ irm https://resend.com/install.ps1 | iex
69
+ ```
70
+
71
+ After installing, verify:
72
+ ```bash
73
+ resend --version
74
+ ```
75
+
39
76
  ## Agent Protocol
40
77
 
41
78
  The CLI auto-detects non-TTY environments and outputs JSON — no `--json` flag needed.
@@ -73,6 +110,8 @@ Auth resolves: `--api-key` flag > `RESEND_API_KEY` env > config file (`resend lo
73
110
  | `domains` | create, verify, update, delete, list |
74
111
  | `logs` | list, get, open |
75
112
  | `api-keys` | create, list, delete |
113
+ | `automations` | create, get, list, update, delete, open, runs |
114
+ | `events` | create, get, list, update, delete, send, open |
76
115
  | `broadcasts` | create, send, update, delete, list |
77
116
  | `contacts` | create, update, delete, segments, topics |
78
117
  | `contact-properties` | create, update, delete, list |
@@ -143,6 +182,7 @@ resend doctor -q
143
182
  - **Defining contact properties** → [references/contact-properties.md](references/contact-properties.md)
144
183
  - **Working with templates** → [references/templates.md](references/templates.md)
145
184
  - **Viewing API request logs** → [references/logs.md](references/logs.md)
185
+ - **Creating automations or sending events** → [references/automations.md](references/automations.md)
146
186
  - **Setting up webhooks or listening for events** → [references/webhooks.md](references/webhooks.md)
147
187
  - **Auth, profiles, or health checks** → [references/auth.md](references/auth.md)
148
188
  - **Multi-step recipes** (setup, CI/CD, broadcast workflow) → [references/workflows.md](references/workflows.md)
@@ -0,0 +1,166 @@
1
+ # automations & events
2
+
3
+ Detailed flag specifications for `resend automations` and `resend events` commands.
4
+
5
+ ---
6
+
7
+ ## automations list
8
+
9
+ | Flag | Type | Default | Description |
10
+ |------|------|---------|-------------|
11
+ | `--limit <n>` | number | 10 | Max results (1-100) |
12
+ | `--after <cursor>` | string | — | Forward pagination |
13
+ | `--before <cursor>` | string | — | Backward pagination |
14
+
15
+ ---
16
+
17
+ ## automations create
18
+
19
+ | Flag | Type | Required | Description |
20
+ |------|------|----------|-------------|
21
+ | `--name <name>` | string | Yes (unless in `--file`) | Automation name |
22
+ | `--status <status>` | string | No | Initial status: `enabled` or `disabled` |
23
+ | `--steps <json>` | string | Yes (unless `--file`) | Steps array as JSON string |
24
+ | `--edges <json>` | string | Yes (unless `--file`) | Edges array as JSON string |
25
+ | `--file <path>` | string | No | Path to JSON file with full payload (use `"-"` for stdin) |
26
+
27
+ When using `--file`, the JSON object should contain `{ name, status?, steps, edges }`. Flags override file values.
28
+
29
+ **Step types:** `trigger`, `delay`, `send_email`, `wait_for_event`, `condition`
30
+
31
+ **Edge types:** `default`, `condition_met`, `condition_not_met`, `timeout`, `event_received`
32
+
33
+ ---
34
+
35
+ ## automations get
36
+
37
+ ```
38
+ resend automations get <id>
39
+ ```
40
+
41
+ Returns the full automation object including steps and edges.
42
+
43
+ ---
44
+
45
+ ## automations update
46
+
47
+ | Flag | Type | Required | Description |
48
+ |------|------|----------|-------------|
49
+ | `--status <status>` | string | Yes | `enabled` or `disabled` |
50
+
51
+ ```
52
+ resend automations update <id> --status enabled
53
+ ```
54
+
55
+ ---
56
+
57
+ ## automations delete
58
+
59
+ | Flag | Type | Required | Description |
60
+ |------|------|----------|-------------|
61
+ | `--yes` | boolean | Yes (non-interactive) | Skip confirmation |
62
+
63
+ ---
64
+
65
+ ## automations open
66
+
67
+ ```
68
+ resend automations open [id]
69
+ ```
70
+
71
+ Opens the automations list or a specific automation's editor in the dashboard.
72
+
73
+ ---
74
+
75
+ ## automations runs
76
+
77
+ | Flag | Type | Default | Description |
78
+ |------|------|---------|-------------|
79
+ | `--limit <n>` | number | 10 | Max results (1-100) |
80
+ | `--after <cursor>` | string | — | Forward pagination |
81
+ | `--before <cursor>` | string | — | Backward pagination |
82
+
83
+ ```
84
+ resend automations runs <automation-id>
85
+ ```
86
+
87
+ **Run status values:** `running` | `completed` | `failed` | `cancelled`
88
+
89
+ ---
90
+
91
+ ## automations runs get
92
+
93
+ | Flag | Type | Required | Description |
94
+ |------|------|----------|-------------|
95
+ | `--automation-id <id>` | string | Yes | Automation ID |
96
+ | `--run-id <id>` | string | Yes | Run ID |
97
+
98
+ Returns the full run object including step-level execution details.
99
+
100
+ ---
101
+
102
+ ## events list
103
+
104
+ | Flag | Type | Default | Description |
105
+ |------|------|---------|-------------|
106
+ | `--limit <n>` | number | 10 | Max results (1-100) |
107
+ | `--after <cursor>` | string | — | Forward pagination |
108
+ | `--before <cursor>` | string | — | Backward pagination |
109
+
110
+ ---
111
+
112
+ ## events create
113
+
114
+ | Flag | Type | Required | Description |
115
+ |------|------|----------|-------------|
116
+ | `--name <name>` | string | Yes | Event name (e.g. `user.signed_up`) |
117
+ | `--schema <json>` | string | No | JSON object mapping field names to types (`string`, `number`, `boolean`, `date`) |
118
+
119
+ Event names cannot start with `resend:` (reserved).
120
+
121
+ ---
122
+
123
+ ## events get
124
+
125
+ ```
126
+ resend events get <id-or-name>
127
+ ```
128
+
129
+ Accepts either a UUID or the event name.
130
+
131
+ ---
132
+
133
+ ## events update
134
+
135
+ | Flag | Type | Required | Description |
136
+ |------|------|----------|-------------|
137
+ | `--schema <json>` | string | Yes | Updated schema JSON (pass `null` to clear) |
138
+
139
+ ---
140
+
141
+ ## events delete
142
+
143
+ | Flag | Type | Required | Description |
144
+ |------|------|----------|-------------|
145
+ | `--yes` | boolean | Yes (non-interactive) | Skip confirmation |
146
+
147
+ ---
148
+
149
+ ## events send
150
+
151
+ | Flag | Type | Required | Description |
152
+ |------|------|----------|-------------|
153
+ | `--event <name>` | string | Yes | Event name to trigger |
154
+ | `--contact-id <id>` | string | One of `--contact-id` or `--email` | Contact ID |
155
+ | `--email <address>` | string | One of `--contact-id` or `--email` | Contact email |
156
+ | `--payload <json>` | string | No | JSON payload matching the event schema |
157
+
158
+ ---
159
+
160
+ ## events open
161
+
162
+ ```
163
+ resend events open
164
+ ```
165
+
166
+ Opens the events management page in the dashboard.
@@ -292,7 +292,55 @@ resend contacts topics user@example.com
292
292
 
293
293
  ---
294
294
 
295
- ## 10. CI/CD Integration
295
+ ## 10. Automations & Events
296
+
297
+ ```bash
298
+ # 1. Create an event definition (the trigger signal)
299
+ resend events create --name "user.signed_up" --schema '{"plan":"string"}'
300
+
301
+ # 2. Create an automation triggered by that event
302
+ # Using a JSON file:
303
+ cat > workflow.json << 'EOF'
304
+ {
305
+ "name": "Welcome Flow",
306
+ "steps": [
307
+ { "ref": "t", "type": "trigger", "config": { "eventName": "user.signed_up" } },
308
+ { "ref": "d", "type": "delay", "config": { "seconds": 300 } },
309
+ { "ref": "e", "type": "send_email", "config": { "templateId": "<published-template-id>" } }
310
+ ],
311
+ "edges": [
312
+ { "from": "t", "to": "d", "edgeType": "default" },
313
+ { "from": "d", "to": "e", "edgeType": "default" }
314
+ ]
315
+ }
316
+ EOF
317
+
318
+ resend automations create --file workflow.json
319
+
320
+ # 3. Enable the automation
321
+ resend automations update <automation-id> --status enabled
322
+
323
+ # 4. Send an event to trigger it
324
+ resend events send --event "user.signed_up" --email user@example.com --payload '{"plan":"pro"}'
325
+
326
+ # 5. Check runs
327
+ resend automations runs <automation-id>
328
+ resend automations runs get --automation-id <id> --run-id <id>
329
+
330
+ # 6. View in dashboard
331
+ resend automations open <automation-id>
332
+
333
+ # Disable when done
334
+ resend automations update <automation-id> --status disabled
335
+
336
+ # Clean up
337
+ resend automations delete <automation-id> --yes
338
+ resend events delete <event-id> --yes
339
+ ```
340
+
341
+ ---
342
+
343
+ ## 11. CI/CD Integration
296
344
 
297
345
  ```yaml
298
346
  # GitHub Actions example
@@ -332,7 +380,7 @@ resend emails send -q \
332
380
 
333
381
  ---
334
382
 
335
- ## 11. Inbound Email Processing
383
+ ## 12. Inbound Email Processing
336
384
 
337
385
  ```bash
338
386
  # Enable receiving on domain (at creation or check existing)