@sesender/cli 1.0.1 → 1.0.3

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.
Files changed (2) hide show
  1. package/README.md +332 -26
  2. package/package.json +10 -2
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # @sesender/cli
2
2
 
3
- The official SESender command-line tool. Send SMS/emails, manage contacts, view analytics, and control campaigns directly from your terminal.
3
+ The official SESender command-line tool. Send SMS and emails, manage contacts, campaigns, providers, templates, webhooks, tracking domains, and more directly from your terminal.
4
+
5
+ Perfect for **developers**, **DevOps engineers**, and **power users** who want to automate messaging workflows, integrate with CI/CD pipelines, or manage their SESender account without opening a browser.
4
6
 
5
7
  ## Installation
6
8
 
@@ -14,11 +16,14 @@ npm install -g @sesender/cli
14
16
  # Configure your API key
15
17
  ses-cli config set --api-key YOUR_API_KEY --base-url https://sesender.com
16
18
 
19
+ # Verify connection
20
+ ses-cli account info
21
+
17
22
  # Send an SMS
18
- ses-cli sms send --to +1234567890 --body "Hello from SESender CLI!"
23
+ ses-cli sms send --to "+1234567890" --body "Hello from SESender CLI!"
19
24
 
20
25
  # Send an email
21
- ses-cli email send --to user@example.com --subject "Hello" --body "Welcome!"
26
+ ses-cli email send --to user@example.com --subject "Hello" --body "Welcome!" --from sender@yourdomain.com
22
27
 
23
28
  # View analytics
24
29
  ses-cli analytics
@@ -35,13 +40,11 @@ export SES_BASE_URL=https://sesender.com
35
40
 
36
41
  ### Get your API key
37
42
 
38
- 1. Log in to your SESender dashboard
39
- 2. Go to **Settings > API Keys**
43
+ 1. Log in to your SESender dashboard at [sesender.com](https://sesender.com)
44
+ 2. Go to **Settings API Keys**
40
45
  3. Create a new API key with the permissions you need
41
46
 
42
- ## Commands
43
-
44
- ### Config
47
+ ### Config Commands
45
48
 
46
49
  ```bash
47
50
  ses-cli config set --api-key KEY --base-url URL # Save configuration
@@ -49,44 +52,322 @@ ses-cli config show # Show current config
49
52
  ses-cli config clear # Remove saved config
50
53
  ```
51
54
 
55
+ ---
56
+
57
+ ## Commands
58
+
52
59
  ### SMS
53
60
 
61
+ Send single or bulk SMS messages with provider selection, scheduling, and history.
62
+
54
63
  ```bash
55
- ses-cli sms send --to PHONE --body MESSAGE [--from SENDER_ID]
56
- ses-cli sms bulk --file contacts.csv --body MESSAGE [--from SENDER_ID]
57
- ses-cli sms history [--limit 20] [--page 1]
64
+ # Send a single SMS
65
+ ses-cli sms send --to "+1234567890" --body "Hello!" --from "MyBrand"
66
+
67
+ # Send with specific provider
68
+ ses-cli sms send --to "+1234567890" --body "VIP offer" --provider 5 --route PREMIUM
69
+
70
+ # Schedule an SMS for later
71
+ ses-cli sms send --to "+1234567890" --body "Reminder!" --schedule "2026-06-15T09:00:00Z"
72
+
73
+ # Bulk SMS from CSV file
74
+ ses-cli sms bulk --file contacts.csv --body "Hi {{First}}, your code is {{Custom1}}" --from "MyBrand"
75
+
76
+ # View SMS history
77
+ ses-cli sms history --limit 20 --status delivered
58
78
  ```
59
79
 
80
+ **Flags:**
81
+
82
+ | Flag | Description |
83
+ |------|-------------|
84
+ | `--to` | Recipient phone number (E.164 format) |
85
+ | `--body` | Message text (supports `{{dynamic}}` fields) |
86
+ | `--from` | Sender ID / caller ID |
87
+ | `--provider` | Provider ID to use (from `providers list`) |
88
+ | `--route` | Route name (e.g., DEFAULT, PREMIUM) |
89
+ | `--schedule` | ISO 8601 datetime to schedule the send |
90
+ | `--file` | CSV file for bulk sending |
91
+
92
+ ---
93
+
60
94
  ### Email
61
95
 
96
+ Send single or bulk emails with HTML support, provider selection, click/open tracking, and scheduling.
97
+
98
+ ```bash
99
+ # Send a single email
100
+ ses-cli email send --to "user@example.com" --subject "Hello" --body "Welcome!" --from "sender@yourdomain.com"
101
+
102
+ # Send HTML email from file
103
+ ses-cli email send --to "user@example.com" --subject "Newsletter" --html-file ./template.html --from "news@yourdomain.com"
104
+
105
+ # With provider selection
106
+ ses-cli email send --to "user@example.com" --subject "Test" --body "Hello" --provider mailgun
107
+
108
+ # With click and open tracking
109
+ ses-cli email send --to "user@example.com" --subject "Promo" --html-file promo.html --track-clicks --track-opens
110
+
111
+ # Bulk email from CSV
112
+ ses-cli email bulk --file contacts.csv --subject "Hi {{First}}" --html-file ./template.html --from "sender@yourdomain.com"
113
+
114
+ # View email history
115
+ ses-cli email history --limit 20 --status delivered
116
+ ```
117
+
118
+ **Flags:**
119
+
120
+ | Flag | Description |
121
+ |------|-------------|
122
+ | `--to` | Recipient email address |
123
+ | `--subject` | Email subject line |
124
+ | `--body` | Plain text body |
125
+ | `--html` | Inline HTML body |
126
+ | `--html-file` | Path to HTML file for email body |
127
+ | `--from` | Sender email address |
128
+ | `--provider` | Provider name (e.g., sendgrid, mailgun) |
129
+ | `--track-clicks` | Enable click tracking |
130
+ | `--track-opens` | Enable open tracking |
131
+ | `--schedule` | ISO 8601 datetime to schedule the send |
132
+ | `--file` | CSV file for bulk sending |
133
+
134
+ ---
135
+
136
+ ### Providers
137
+
138
+ List your configured SMS and email providers. Use the provider ID with `--provider` when sending.
139
+
140
+ ```bash
141
+ # List all providers
142
+ ses-cli providers list
143
+
144
+ # Filter by type
145
+ ses-cli providers list --type sms
146
+ ses-cli providers list --type email
147
+
148
+ # JSON output for scripting
149
+ ses-cli providers list --json
150
+ ```
151
+
152
+ **Example Output:**
153
+
154
+ ```
155
+ ┌────┬─────────────────────┬───────┬────────────┬────────┐
156
+ │ ID │ Name │ Type │ Provider │ Active │
157
+ ├────┼─────────────────────┼───────┼────────────┼────────┤
158
+ │ 1 │ Main SMS Route │ sms │ TextBack │ ✓ │
159
+ │ 2 │ Backup SMS │ sms │ SMSEdge │ ✓ │
160
+ │ 3 │ Email Primary │ email │ SendGrid │ ✓ │
161
+ │ 4 │ Email Backup │ email │ Mailjet │ ✓ │
162
+ └────┴─────────────────────┴───────┴────────────┴────────┘
163
+ ```
164
+
165
+ ---
166
+
167
+ ### Campaigns
168
+
169
+ List, view, pause, resume, and cancel campaigns.
170
+
62
171
  ```bash
63
- ses-cli email send --to EMAIL --subject SUBJECT --body TEXT [--html file.html] [--from SENDER]
64
- ses-cli email bulk --file contacts.csv --subject SUBJECT --body TEXT [--html file.html]
65
- ses-cli email history [--limit 20] [--page 1]
172
+ # List campaigns
173
+ ses-cli campaigns list
174
+ ses-cli campaigns list --status sending --type email
175
+ ses-cli campaigns list --limit 50
176
+
177
+ # View campaign statistics
178
+ ses-cli campaigns stats --id c-abc123
179
+ ses-cli campaigns stats --id mv-campaign-456 --json
180
+
181
+ # Pause a running campaign
182
+ ses-cli campaigns pause --id c-abc123
183
+
184
+ # Resume a paused campaign
185
+ ses-cli campaigns resume --id c-abc123
186
+
187
+ # Cancel a campaign
188
+ ses-cli campaigns cancel --id c-abc123
66
189
  ```
67
190
 
191
+ ---
192
+
68
193
  ### Contacts
69
194
 
195
+ Manage contacts and contact groups: list, import, export, and delete.
196
+
70
197
  ```bash
71
- ses-cli contacts list [--limit 20] [--page 1] [--group GROUP_NAME]
72
- ses-cli contacts import --file contacts.csv [--group GROUP_NAME]
198
+ # List contacts
199
+ ses-cli contacts list --limit 50
200
+ ses-cli contacts list --search "gmail" --group "VIP"
201
+
202
+ # Import contacts from CSV
203
+ ses-cli contacts import --file contacts.csv --group "New Leads"
204
+
205
+ # Export contacts to CSV
206
+ ses-cli contacts export --group "VIP" --output vip-contacts.csv
207
+
208
+ # List contact groups
73
209
  ses-cli contacts groups
210
+
211
+ # Delete a contact
212
+ ses-cli contacts delete --id 12345
74
213
  ```
75
214
 
76
- ### Campaigns & Analytics
215
+ ---
216
+
217
+ ### Templates
218
+
219
+ List and view your saved message templates.
77
220
 
78
221
  ```bash
79
- ses-cli campaigns list [--limit 20]
80
- ses-cli analytics [--json]
222
+ # List all templates
223
+ ses-cli templates list
224
+
225
+ # Filter by type
226
+ ses-cli templates list --type email
227
+ ses-cli templates list --type sms
228
+
229
+ # View a specific template
230
+ ses-cli templates get --id 42
81
231
  ```
82
232
 
233
+ ---
234
+
235
+ ### Webhooks
236
+
237
+ Manage webhook endpoints for real-time event notifications.
238
+
239
+ ```bash
240
+ # List webhooks
241
+ ses-cli webhooks list
242
+
243
+ # Create a webhook
244
+ ses-cli webhooks create --url https://myapp.com/webhook --events "email.delivered,email.bounced"
245
+
246
+ # Test a webhook (sends test payload)
247
+ ses-cli webhooks test --id wh-123
248
+
249
+ # Delete a webhook
250
+ ses-cli webhooks delete --id wh-123
251
+ ```
252
+
253
+ **Available Events:**
254
+
255
+ | Event | Description |
256
+ |-------|-------------|
257
+ | `email.sent` | Email was sent to the provider |
258
+ | `email.delivered` | Email was delivered to recipient |
259
+ | `email.bounced` | Email bounced (hard or soft) |
260
+ | `email.complained` | Recipient marked email as spam |
261
+ | `email.opened` | Email was opened by recipient |
262
+ | `sms.sent` | SMS was sent to the provider |
263
+ | `sms.delivered` | SMS was delivered to recipient |
264
+ | `sms.failed` | SMS delivery failed |
265
+ | `link.clicked` | Tracked link was clicked |
266
+
267
+ ---
268
+
269
+ ### Tracking Domains
270
+
271
+ View your tracking domains and their click/open statistics.
272
+
273
+ ```bash
274
+ # List tracking domains
275
+ ses-cli tracking list
276
+
277
+ # View tracking statistics
278
+ ses-cli tracking stats
279
+ ses-cli tracking stats --period 7d
280
+ ses-cli tracking stats --domain track.mydomain.com --period 30d
281
+ ```
282
+
283
+ **Flags:**
284
+
285
+ | Flag | Description |
286
+ |------|-------------|
287
+ | `--domain` | Filter stats by specific domain |
288
+ | `--period` | Time period: 7d, 30d, 90d (default: 7d) |
289
+
290
+ ---
291
+
292
+ ### Scheduling
293
+
294
+ View and manage scheduled messages.
295
+
296
+ ```bash
297
+ # List all scheduled messages
298
+ ses-cli schedule list
299
+
300
+ # Filter by status
301
+ ses-cli schedule list --status pending
302
+
303
+ # Cancel a scheduled message before it sends
304
+ ses-cli schedule cancel --id sch-123
305
+ ```
306
+
307
+ ---
308
+
83
309
  ### Validation
84
310
 
311
+ Validate phone numbers and email addresses.
312
+
85
313
  ```bash
86
- ses-cli validate phone --phone +1234567890
87
- ses-cli validate email --email user@example.com
314
+ # Validate a phone number
315
+ ses-cli validate phone +1234567890
316
+
317
+ # Validate an email address
318
+ ses-cli validate email user@example.com
319
+
320
+ # Bulk validation from file
321
+ ses-cli validate bulk --file emails.csv --type email
322
+ ses-cli validate bulk --file phones.csv --type phone
88
323
  ```
89
324
 
325
+ ---
326
+
327
+ ### Seed Check
328
+
329
+ Check email lists against seed words and the SES risky email database.
330
+
331
+ ```bash
332
+ # Check emails (comma-separated)
333
+ ses-cli seed-check --emails "user@test.com,info@trap.com" --words "trap,seed,monitor"
334
+
335
+ # Check emails from CSV file
336
+ ses-cli seed-check --file emails.csv --words "trap,seed"
337
+
338
+ # Check your seed credit balance
339
+ ses-cli seed-balance
340
+ ```
341
+
342
+ ---
343
+
344
+ ### Analytics
345
+
346
+ View your sending analytics overview.
347
+
348
+ ```bash
349
+ # View analytics
350
+ ses-cli analytics
351
+ ses-cli analytics --period 30d
352
+ ses-cli analytics --json
353
+ ```
354
+
355
+ ---
356
+
357
+ ### Account
358
+
359
+ View account information and rate limits.
360
+
361
+ ```bash
362
+ # Account information
363
+ ses-cli account info
364
+
365
+ # Check API rate limits
366
+ ses-cli account rate
367
+ ```
368
+
369
+ ---
370
+
90
371
  ## Global Options
91
372
 
92
373
  | Flag | Description |
@@ -95,6 +376,8 @@ ses-cli validate email --email user@example.com
95
376
  | `--help` | Show help message |
96
377
  | `--version` | Show version number |
97
378
 
379
+ ---
380
+
98
381
  ## CSV Format
99
382
 
100
383
  ### For SMS bulk:
@@ -113,11 +396,15 @@ user2@example.com
113
396
 
114
397
  ### For Contact import:
115
398
  ```csv
116
- name,phone,email
117
- John Doe,+1234567890,john@example.com
118
- Jane Smith,+0987654321,jane@example.com
399
+ name,phone,email,amount,brand
400
+ John Doe,+1234567890,john@example.com,500,MyCompany
401
+ Jane Smith,+0987654321,jane@example.com,300,MyCompany
119
402
  ```
120
403
 
404
+ Dynamic fields from CSV columns are available as `{{First}}`, `{{Last}}`, `{{Amount}}`, `{{Brand}}`, `{{Custom1}}`, `{{Custom2}}`, `{{Custom3}}` in message bodies.
405
+
406
+ ---
407
+
121
408
  ## Scripting Examples
122
409
 
123
410
  ```bash
@@ -131,16 +418,35 @@ fi
131
418
 
132
419
  # Export analytics to file
133
420
  ses-cli analytics --json > analytics_$(date +%Y%m%d).json
421
+
422
+ # List all active providers and pipe to jq
423
+ ses-cli providers list --json | jq '.[] | select(.active == true)'
424
+
425
+ # Monitor campaign progress
426
+ watch -n 5 'ses-cli campaigns stats --id c-abc123 --json'
427
+
428
+ # Automated seed check from CI/CD
429
+ ses-cli seed-check --file new-subscribers.csv --words "trap,seed,abuse" --json > seed-results.json
134
430
  ```
135
431
 
432
+ ---
433
+
136
434
  ## Rate Limits
137
435
 
138
- The CLI respects the same rate limits as your API key. Check your current limits:
436
+ The CLI respects the same rate limits as your API key. Check your current usage:
139
437
 
140
438
  ```bash
141
- ses-cli analytics --json | grep rateLimit
439
+ ses-cli account rate
142
440
  ```
143
441
 
442
+ ---
443
+
444
+ ## Links
445
+
446
+ - **Dashboard:** [sesender.com](https://sesender.com)
447
+ - **API Docs:** [sesender.com/api-docs](https://sesender.com/api-docs)
448
+ - **Support:** support@sesender.com
449
+
144
450
  ## License
145
451
 
146
452
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sesender/cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "SESender CLI - Send SMS/emails, manage contacts, and view analytics from your terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,7 +11,15 @@
11
11
  "src/",
12
12
  "README.md"
13
13
  ],
14
- "keywords": ["sesender", "sms", "email", "marketing", "cli", "bulk-sms", "bulk-email"],
14
+ "keywords": [
15
+ "sesender",
16
+ "sms",
17
+ "email",
18
+ "marketing",
19
+ "cli",
20
+ "bulk-sms",
21
+ "bulk-email"
22
+ ],
15
23
  "author": "SESender Team",
16
24
  "license": "MIT",
17
25
  "repository": {