@mailmodo/cli 0.0.59-beta.pr61.111 → 0.0.59

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 (3) hide show
  1. package/README.md +69 -771
  2. package/oclif.manifest.json +47 -47
  3. package/package.json +4 -16
package/README.md CHANGED
@@ -1,827 +1,125 @@
1
- # @mailmodo/cli
2
-
3
- [![npm version](https://img.shields.io/npm/v/@mailmodo/cli.svg)](https://www.npmjs.com/package/@mailmodo/cli)
4
- [![npm downloads](https://img.shields.io/npm/dm/@mailmodo/cli.svg)](https://www.npmjs.com/package/@mailmodo/cli)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
- [![Node.js >= 18](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/)
7
-
8
- **Email lifecycle automation for the AI-native builder generation.**
9
-
10
- `@mailmodo/cli` is a command-line tool that analyzes your product, generates a full onboarding and lifecycle email sequence using AI, and deploys it — all from your terminal. It manages everything from domain setup and HTML template generation to live deployment, performance monitoring, and contact management.
11
-
12
- ---
13
-
14
- ## Table of Contents
15
-
16
- - [Installation](#installation)
17
- - [Quick Start](#quick-start)
18
- - [Commands Reference](#commands-reference)
19
- - [login](#login)
20
- - [logout](#logout)
21
- - [init](#init)
22
- - [emails](#emails)
23
- - [edit](#edit)
24
- - [preview](#preview)
25
- - [deploy](#deploy)
26
- - [deployments](#deployments)
27
- - [sdk](#sdk)
28
- - [domain](#domain)
29
- - [settings](#settings)
30
- - [status](#status)
31
- - [logs](#logs)
32
- - [contacts](#contacts)
33
- - [billing](#billing)
34
- - [report](#report)
35
- - [SDK / App Integration](#sdk--app-integration)
36
- - [Configuration](#configuration)
37
- - [AI Agent Support](#ai-agent-support)
38
- - [Contributing](#contributing)
39
-
40
- ---
41
-
42
- ## Installation
43
-
44
- ```bash
45
- npm install -g @mailmodo/cli
46
- ```
47
-
48
- Requires **Node.js >= 18**.
49
-
50
- Verify the installation:
51
-
52
- ```bash
53
- mailmodo --version
54
- mailmodo --help
55
- ```
56
-
57
- ---
58
-
59
- ## Quick Start
60
-
61
- The primary workflow from zero to deployed email sequence:
62
-
63
- **1. Authenticate**
64
-
65
- ```bash
66
- mailmodo login
67
- ```
68
-
69
- You will be prompted to enter your Mailmodo API key. Get one at [app.mailmodo.dev](https://app.mailmodo.dev).
70
-
71
- **2. Analyze your product and generate emails**
72
-
73
- ```bash
74
- mailmodo init --url https://yourapp.com
75
- ```
76
-
77
- The CLI scrapes your product URL, detects your business model, and generates a full email sequence with HTML templates. A `mailmodo.yaml` config file and a `mailmodo/` directory of HTML templates are created in your current working directory.
78
-
79
- **3. Preview an email**
80
-
81
- ```bash
82
- mailmodo preview welcome
83
- ```
84
-
85
- Opens a local preview server in your browser. Use `--send me@example.com` to send yourself a test.
86
-
87
- **4. Set up your sending domain**
88
-
89
- ```bash
90
- mailmodo domain
91
- ```
92
-
93
- Follow the prompts to register your domain and sender details. The CLI displays the DNS records you need to add. Verify once propagated:
94
-
95
- ```bash
96
- mailmodo domain --verify
97
- ```
98
-
99
- **5. Deploy**
1
+ # mailmodo-cli
100
2
 
101
- ```bash
102
- mailmodo deploy
103
- ```
104
-
105
- Validates your configuration, deploys all email sequences, and prints the `track()` and `identify()` SDK snippets to wire into your app.
106
-
107
- **6. Monitor**
108
-
109
- ```bash
110
- mailmodo status # quota usage and per-email metrics
111
- mailmodo logs # delivery event log
112
- ```
113
-
114
- ---
115
-
116
- ## Commands Reference
117
-
118
- All commands support two universal flags:
119
-
120
- | Flag | Alias | Description |
121
- | -------- | ----- | -------------------------------------------------------------- |
122
- | `--json` | | Output as machine-readable JSON instead of formatted text |
123
- | `--yes` | `-y` | Skip all confirmation prompts (non-interactive / scripted use) |
124
-
125
- ---
126
-
127
- ### login
128
-
129
- Authenticate with Mailmodo using your API key.
130
-
131
- ```bash
132
- mailmodo login
133
- ```
3
+ Email lifecycle automation for the AI-native builder generation.
134
4
 
135
- Validates your API key against the Mailmodo API, saves credentials to `~/.mailmodo/config`, and performs a silent cloud backup of any existing `mailmodo.yaml`. If credentials are already saved, displays current account status.
5
+ ## Prerequisites
136
6
 
137
- **Environment variable shortcut (for CI/CD):**
7
+ - **Node.js** v24.14.1
138
8
 
139
- ```bash
140
- # Linux / macOS
141
- MAILMODO_API_KEY=your_key mailmodo login
9
+ ## Setup
142
10
 
143
- # Windows PowerShell
144
- $env:MAILMODO_API_KEY="your_key"; mailmodo login
145
-
146
- # Windows CMD
147
- set MAILMODO_API_KEY=your_key && mailmodo login
148
- ```
149
-
150
- **JSON output shape:**
151
-
152
- ```json
153
- {
154
- "status": "logged_in",
155
- "email": "you@example.com",
156
- "plan": "free",
157
- "totalFreeRemaining": 500,
158
- "paidEmailsRemaining": 0,
159
- "yamlRestored": false
160
- }
161
- ```
162
-
163
- ---
164
-
165
- ### logout
166
-
167
- Remove saved credentials from this machine.
168
-
169
- ```bash
170
- mailmodo logout
171
- ```
172
-
173
- Deletes `~/.mailmodo/config`. Does not affect the server-side account.
174
-
175
- **JSON output shape:**
176
-
177
- ```json
178
- { "status": "logged_out" }
179
- ```
180
-
181
- ---
182
-
183
- ### init
184
-
185
- Analyze your product and generate a full email sequence.
186
-
187
- ```bash
188
- mailmodo init
189
- mailmodo init --url https://yourapp.com
190
- mailmodo init --url https://yourapp.com --yes
191
- ```
192
-
193
- | Flag | Type | Description |
194
- | ------- | ------ | ---------------------------------------------------------- |
195
- | `--url` | string | Product URL to analyze (prompted interactively if omitted) |
196
-
197
- What `init` does:
198
-
199
- 1. Calls the Mailmodo AI to analyze your product URL and detect business model, target user, SaaS model, and brand details.
200
- 2. Generates email copy and HTML templates for a complete lifecycle sequence (welcome, onboarding, trial expiry, etc.).
201
- 3. Writes `mailmodo.yaml` to the current directory.
202
- 4. Creates a `mailmodo/` directory containing one `.html` file per email.
203
- 5. Silently backs up the config and templates to the cloud.
204
-
205
- **JSON output shape:**
206
-
207
- ```json
208
- {
209
- "brand": { "name": "...", "color": "...", "url": "..." },
210
- "emailConfigs": [...],
211
- "emailStyle": "branded",
212
- "monthlyCap": 5
213
- }
214
- ```
215
-
216
- ---
217
-
218
- ### emails
219
-
220
- List and inspect your configured email sequences.
221
-
222
- ```bash
223
- mailmodo emails
224
- mailmodo emails --json
225
- ```
226
-
227
- Reads `mailmodo.yaml` locally and displays a table of all configured emails: ID, trigger event, delay, and subject. In interactive mode, you can select any email to view its full details or open the template in your editor.
228
-
229
- **JSON output shape:**
230
-
231
- ```json
232
- {
233
- "emails": [
234
- {
235
- "id": "welcome",
236
- "trigger": "user.signup",
237
- "delay": 0,
238
- "subject": "Welcome to MyApp"
239
- }
240
- ],
241
- "total": 4
242
- }
243
- ```
244
-
245
- ---
246
-
247
- ### edit
248
-
249
- Edit an email using AI-assisted natural language changes.
250
-
251
- ```bash
252
- mailmodo edit <id>
253
- mailmodo edit welcome
254
- mailmodo edit welcome --change "make the subject more urgent"
255
- mailmodo edit welcome --change "rewrite the body focusing on onboarding" --yes
256
- ```
257
-
258
- | Argument | Description |
259
- | -------- | ------------------------------------ |
260
- | `id` | Email template ID to edit (required) |
261
-
262
- | Flag | Type | Description |
263
- | ---------- | ------ | ---------------------------------------------------------------------------------- |
264
- | `--change` | string | Natural language description of what to change (prompted interactively if omitted) |
265
-
266
- The CLI sends the current template and your change description to the Mailmodo AI, previews the diff (changed vs. unchanged fields), and lets you accept, retry, or skip.
267
-
268
- **JSON output shape:**
269
-
270
- Returns the updated email object with a `diff` property showing which fields changed and which were preserved.
271
-
272
- ---
273
-
274
- ### preview
275
-
276
- Preview an email in the browser, as plain text, or send a test.
277
-
278
- ```bash
279
- mailmodo preview
280
- mailmodo preview <id>
281
- mailmodo preview welcome --text
282
- mailmodo preview welcome --send me@example.com
283
- ```
284
-
285
- | Argument | Description |
286
- | -------- | ---------------------------------------------------------------------------- |
287
- | `id` | Email template ID (optional; defaults to the first email in `mailmodo.yaml`) |
288
-
289
- | Flag | Type | Description |
290
- | -------- | ------- | ---------------------------------------------------------------- |
291
- | `--text` | boolean | Print a plain-text rendering of the email (useful for AI agents) |
292
- | `--send` | string | Send a test email to the specified address |
293
-
294
- In browser mode (default), a local server starts at `http://localhost:3421` and opens your browser.
295
-
296
- ---
297
-
298
- ### deploy
299
-
300
- Deploy, pause, or resume an email sequence.
301
-
302
- ```bash
303
- # Deploy all configured sequences
304
- mailmodo deploy
305
- mailmodo deploy --yes
306
-
307
- # Pause a live sequence
308
- mailmodo deploy --pause <sequenceId>
309
-
310
- # Resume a paused sequence
311
- mailmodo deploy --resume <sequenceId>
312
- mailmodo deploy --resume <sequenceId> --json
313
- ```
314
-
315
- | Flag | Type | Description |
316
- | ---------- | ------ | ------------------------------------------------------------------------- |
317
- | `--pause` | string | Pause a deployed sequence by ID (stops all scheduled and triggered sends) |
318
- | `--resume` | string | Resume a paused sequence by ID |
319
-
320
- `--pause` and `--resume` are mutually exclusive.
321
-
322
- **Deploy flow:**
323
-
324
- 1. Checks domain verification status; runs domain setup if needed.
325
- 2. Validates your email sequence configuration.
326
- 3. Shows a pre-deploy summary: domain, sender, email count, and a diff of changes since the last deploy.
327
- 4. Prompts for confirmation (skipped with `--yes`).
328
- 5. Deploys and prints the `@mailmodo/sdk` code snippets to add to your app.
329
-
330
- **Deploy JSON output shape:**
331
-
332
- ```json
333
- {
334
- "deployed": true,
335
- "emailsLive": 4,
336
- "sequenceId": "seq_abc123",
337
- "diff": { "added": [], "changed": [], "removed": [] },
338
- "sdkSnippet": "..."
339
- }
340
- ```
341
-
342
- **Pause/Resume JSON output shape:**
343
-
344
- ```json
345
- {
346
- "sequenceId": "seq_abc123",
347
- "status": "paused",
348
- "alreadyInStatus": false
349
- }
350
- ```
351
-
352
- ---
353
-
354
- ### deployments
355
-
356
- List every deployed sequence on this account.
357
-
358
- ```bash
359
- mailmodo deployments
360
- mailmodo deployments --json
361
- ```
362
-
363
- Displays a table with product name, status (`active` / `paused`), email count, sequence ID, and last-updated date. The sequence IDs shown here are the values to pass to `deploy --pause` and `deploy --resume`.
364
-
365
- **JSON output shape:**
366
-
367
- ```json
368
- {
369
- "sequences": [
370
- {
371
- "sequenceId": "seq_abc123",
372
- "product": "MyApp",
373
- "status": "active",
374
- "emailCount": 4,
375
- "updatedAt": "2025-06-01T10:00:00Z"
376
- }
377
- ],
378
- "total": 1
379
- }
380
- ```
381
-
382
- ---
383
-
384
- ### sdk
385
-
386
- Show SDK `track()` and `identify()` reference for your deployed sequences.
387
-
388
- ```bash
389
- mailmodo sdk
390
- mailmodo sdk --sequence-id seq_abc123
391
- mailmodo sdk --json
392
- ```
393
-
394
- | Flag | Type | Description |
395
- | --------------- | ------ | ------------------------------------------------------------------------- |
396
- | `--sequence-id` | string | Limit output to a specific sequence by ID (default: all active sequences) |
397
-
398
- Displays the install command, import line, and copy-ready `track()` / `identify()` function calls for each active sequence. See [SDK / App Integration](#sdk--app-integration) for details on using these in your app.
399
-
400
- ---
401
-
402
- ### domain
403
-
404
- Set up and verify your sending domain.
405
-
406
- ```bash
407
- # Interactive setup (register domain and get DNS records)
408
- mailmodo domain
409
-
410
- # Verify DNS records after adding them
411
- mailmodo domain --verify
412
-
413
- # Show domain health metrics
414
- mailmodo domain --status
415
- ```
416
-
417
- | Flag | Type | Description |
418
- | ---------- | ------- | ----------------------------------------------------------------------- |
419
- | `--verify` | boolean | Check SPF, DKIM, and DMARC record status |
420
- | `--status` | boolean | Display domain health metrics (bounce rate, spam rate, verified status) |
421
-
422
- During setup, you are prompted for: domain, sender email (must be `@<domain>`), from name, reply-to address, and physical business address (required by CAN-SPAM). The CLI outputs the exact DNS records to add to your registrar.
423
-
424
- > **Note:** DNS changes take 5–30 minutes to propagate before verification will pass.
425
-
426
- ---
427
-
428
- ### settings
429
-
430
- View and update project settings.
431
-
432
- ```bash
433
- mailmodo settings
434
- mailmodo settings --set brand_color=#0F3460
435
- mailmodo settings --json
436
- ```
437
-
438
- | Flag | Type | Description |
439
- | ------- | ------ | --------------------------------------------- |
440
- | `--set` | string | Set a single setting using `key=value` syntax |
441
-
442
- In interactive mode (no flags), displays all settings grouped by category and prompts to edit each one. With `--set`, updates the specified key directly without prompting.
443
-
444
- **Settable keys:**
445
-
446
- | Category | Keys |
447
- | ---------------- | ------------------------------------------------------------------------------- |
448
- | Project Info | `name`, `url`, `description`, `type`, `targetUser`, `saasModel`, `pricingModel` |
449
- | Branding | `brand_color`, `email_style` (`plain` \| `branded`), `logo_url`, `logo_file` |
450
- | Domain / Sending | `domain`, `from_email`, `from_name`, `reply_to`, `address` |
451
- | Billing | `monthly_cap` (paid tier only), `webhook_url` |
452
-
453
- ---
454
-
455
- ### status
456
-
457
- View email performance metrics and quota usage.
458
-
459
- ```bash
460
- mailmodo status
461
- mailmodo status --json
462
- ```
463
-
464
- Displays per-email metrics (sent, open rate, click rate, conversion rate), total monthly sends, and current quota status (free emails remaining or paid blocks consumed).
465
-
466
- **JSON output shape:**
467
-
468
- ```json
469
- {
470
- "emails": [
471
- {
472
- "id": "welcome",
473
- "sent": 120,
474
- "openRate": 0.42,
475
- "clickRate": 0.15,
476
- "conversionRate": 0.08
477
- }
478
- ],
479
- "monthlySent": 480,
480
- "quota": { "free": 20, "paidBlocksUsed": 0 }
481
- }
482
- ```
483
-
484
- ---
485
-
486
- ### logs
487
-
488
- View email send logs and delivery events.
489
-
490
- ```bash
491
- mailmodo logs
492
- mailmodo logs --email sarah@example.com
493
- mailmodo logs --failed
494
- mailmodo logs --limit 100 --page 2
495
- mailmodo logs --json
496
- ```
497
-
498
- | Flag | Type | Default | Description |
499
- | ---------- | ------- | ------- | -------------------------------------- |
500
- | `--email` | string | | Filter events by contact email address |
501
- | `--failed` | boolean | false | Show only failed or bounced events |
502
- | `--limit` | integer | 50 | Entries per page (max 200) |
503
- | `--page` | integer | 1 | Page number for pagination |
504
-
505
- **JSON output shape:**
506
-
507
- ```json
508
- {
509
- "entries": [
510
- {
511
- "timestamp": "2025-06-01T10:00:00Z",
512
- "emailId": "welcome",
513
- "status": "delivered",
514
- "contact": "sarah@example.com",
515
- "reason": null
516
- }
517
- ],
518
- "total": 480,
519
- "page": 1,
520
- "limit": 50
521
- }
11
+ ```sh
12
+ git clone https://github.com/Mailmodo/mailmodo-cli.git
13
+ cd mailmodo-cli
14
+ npm install
522
15
  ```
523
16
 
524
- ---
525
-
526
- ### contacts
527
-
528
- Manage contacts — search, export, or delete.
529
-
530
- ```bash
531
- # Show summary counts
532
- mailmodo contacts
533
-
534
- # Search for a specific contact
535
- mailmodo contacts --search sarah@example.com
17
+ ## Development
536
18
 
537
- # Export all contacts as GDPR-compliant CSV
538
- mailmodo contacts --export
19
+ ### Run in dev mode (without building)
539
20
 
540
- # Hard-delete a contact (GDPR right to erasure)
541
- mailmodo contacts --delete sarah@example.com
21
+ ```sh
22
+ node ./bin/run.js <command>
542
23
  ```
543
24
 
544
- | Flag | Type | Description |
545
- | ---------- | ------- | --------------------------------------- |
546
- | `--search` | string | Look up a contact by email address |
547
- | `--export` | boolean | Download all contacts to `contacts.csv` |
548
- | `--delete` | string | Permanently delete a contact by email |
549
-
550
- Without any flags, displays total, active, unsubscribed, and bounced contact counts.
551
-
552
- ---
553
-
554
- ### billing
555
-
556
- View billing status, purchase email blocks, set a monthly cap, or add a payment method.
557
-
558
- ```bash
559
- # View current billing status
560
- mailmodo billing
561
- mailmodo billing --status
562
-
563
- # Open Stripe checkout to add or update a payment method
564
- mailmodo billing --checkout
25
+ Example:
565
26
 
566
- # Purchase email blocks immediately
567
- mailmodo billing --purchase 3
568
-
569
- # Set a monthly sending cap (paid tier)
570
- mailmodo billing --cap 5
571
-
572
- # Set cap with auto-refill when quota runs low
573
- mailmodo billing --cap 5 --auto-charge-block-count 2
27
+ ```sh
28
+ node ./bin/run.js signup
574
29
  ```
575
30
 
576
- | Flag | Type | Description |
577
- | --------------------------- | ------- | ------------------------------------------------------------------- |
578
- | `--status` | boolean | Show billing status only (tier, cap, spending) |
579
- | `--checkout` | boolean | Open Stripe checkout to add or update a payment method |
580
- | `--purchase` | integer | Manually purchase the specified number of email blocks |
581
- | `--cap` | integer | Set monthly sending cap in blocks |
582
- | `--auto-charge-block-count` | integer | Blocks to auto-purchase when quota runs low (use alongside `--cap`) |
583
-
584
- Each block = 1,000 emails. `--monthly-cap` and `--auto-charge-block-count` require a saved payment method.
585
-
586
- ---
587
-
588
- ### report
589
-
590
- Fetch a detailed analytics report with flexible filtering and grouping.
591
-
592
- ```bash
593
- # Quick report for the last 7 days
594
- mailmodo report --preset last7d
31
+ ### Build the project
595
32
 
596
- # Group by email template
597
- mailmodo report --preset last30d --group-by emailId
598
-
599
- # Custom date range, raw event entries
600
- mailmodo report --from 2025-05-01 --to 2025-06-01 --output entries
601
-
602
- # Filter to a specific sequence and event type
603
- mailmodo report --preset last30d --sequence seq_abc123 --event opened
604
-
605
- # Paginate through entries
606
- mailmodo report --preset last7d --output entries --page 2 --limit 100
607
-
608
- mailmodo report --preset last7d --json
33
+ ```sh
34
+ npm run build
609
35
  ```
610
36
 
611
- | Flag | Type | Default | Description |
612
- | ------------ | -------- | --------- | ------------------------------------------------------------------------------------------------------------------------------- |
613
- | `--preset` | string | | Relative time range: `today`, `yesterday`, `last7d`, `last30d`, `last90d`, `thisMonth`, `lastMonth` |
614
- | `--from` | string | | Start of range inclusive (YYYY-MM-DD). Exclusive with `--preset` |
615
- | `--to` | string | | End of range exclusive (YYYY-MM-DD). Exclusive with `--preset` |
616
- | `--group-by` | string | `none` | Group results by: `none`, `emailId`, `sequenceId`, `day`, `hour`, `contact`, `status` |
617
- | `--output` | string | `summary` | Output shape: `summary`, `entries`, `timeseries` |
618
- | `--email-id` | string[] | | Filter by one or more email template IDs (repeatable) |
619
- | `--contact` | string[] | | Filter by one or more contact emails (repeatable) |
620
- | `--sequence` | string[] | | Filter by one or more sequence IDs (repeatable) |
621
- | `--event` | string[] | | Filter by event type: `sent`, `delivered`, `opened`, `clicked`, `bounced`, `complained`, `skipped`, `unsubscribed` (repeatable) |
622
- | `--limit` | integer | 50 | Entries per page, max 200 (applies to `entries` output only) |
623
- | `--page` | integer | 1 | Page number (applies to `entries` output only) |
624
-
625
- `--preset` and `--from`/`--to` are mutually exclusive.
626
-
627
- ---
37
+ ### Run after build
628
38
 
629
- ## SDK / App Integration
630
-
631
- After deploying a sequence, the CLI prints the exact code to add to your application. You can always retrieve it with:
632
-
633
- ```bash
634
- npm install @mailmodo/sdk
635
- ```
636
-
637
- ```javascript
638
- import { track, identify } from '@mailmodo/sdk';
39
+ ```sh
40
+ ./bin/run.js <command>
639
41
  ```
640
42
 
641
- ### `track(event, properties)`
43
+ ### Link globally for local testing
642
44
 
643
- Called when a lifecycle event happens in your app. This triggers the email configured for that event.
45
+ This registers the `mailmodo` binary on your system so you can use it from anywhere:
644
46
 
645
- ```javascript
646
- // Example: trigger the "welcome" email on sign-up
647
- track('myApp$user.signup', {
648
- contactEmailId: user.email,
649
- first_name: user.firstName,
650
- onboarding_url: `https://app.example.com/onboard/${user.id}`,
651
- });
47
+ ```sh
48
+ npm link
652
49
  ```
653
50
 
654
- ### `identify(email, properties)`
655
-
656
- Updates contact properties used by conditional send logic.
51
+ Then run commands directly:
657
52
 
658
- ```javascript
659
- // Example: update onboarding status to conditionally suppress follow-up emails
660
- identify(user.email, {
661
- onboarding_not_completed: user.onboardingStep < 3,
662
- });
53
+ ```sh
54
+ mailmodo signup
663
55
  ```
664
56
 
665
- The `mailmodo sdk` command (or the post-deploy output) shows the exact event names and properties for each sequence in your account.
666
-
667
- ---
57
+ To unlink:
668
58
 
669
- ## Configuration
670
-
671
- ### Credentials — `~/.mailmodo/config`
672
-
673
- Stores your API key and account metadata. Written by `mailmodo login`, deleted by `mailmodo logout`. Never commit this file.
674
-
675
- ```json
676
- {
677
- "apiKey": "mk_...",
678
- "email": "you@example.com",
679
- "totalFreeRemaining": 500
680
- }
59
+ ```sh
60
+ npm unlink -g @mailmodo/cli
681
61
  ```
682
62
 
683
- **Environment variable override:** Set `MAILMODO_API_KEY` to bypass the config file entirely — useful in CI/CD pipelines and Docker containers.
684
-
685
- ### Project Config — `mailmodo.yaml`
686
-
687
- Created by `mailmodo init` in your current working directory. This is the source of truth for your email sequence. Commit it to version control.
688
-
689
- ```yaml
690
- project:
691
- name: MyApp
692
- url: https://myapp.com
693
- description: Project management for remote teams
694
- type: b2b_saas
695
- targetUser: engineering managers
696
- saasModel: subscription
697
- pricingModel: per_seat
698
-
699
- domain: myapp.com
700
- fromEmail: hello@myapp.com
701
- fromName: MyApp
702
- replyTo: support@myapp.com
703
- address: 123 Main St, San Francisco, CA 94105, US
704
-
705
- emailStyle: branded # branded | plain
706
- brandColor: '#1A56DB'
707
- logoUrl: https://cdn.myapp.com/logo.png
708
-
709
- monthlyCap: 5 # paid tier — blocks per month (1 block = 1,000 emails)
710
- webhookUrl: https://myapp.com/webhooks/mailmodo
711
-
712
- emails:
713
- - id: welcome
714
- trigger: user.signup
715
- delay: 0
716
- subject: 'Welcome to MyApp, {{first_name}}!'
717
- template: welcome.html
718
- style: branded
719
- previewText: 'Your account is ready.'
720
- goal: Drive user to complete the first key action
721
- ctaText: Get Started
722
-
723
- - id: day3-nudge
724
- trigger: user.signup
725
- delay: '3d'
726
- subject: 'Quick tip for getting started'
727
- template: day3-nudge.html
728
- condition: 'onboarding_not_completed == true'
729
- ```
63
+ ## Commands
730
64
 
731
- ### HTML Templates — `mailmodo/`
65
+ ### `mailmodo signup`
732
66
 
733
- Each email in `mailmodo.yaml` maps to an HTML file in the `mailmodo/` directory:
67
+ Sign up for Mailmodo. Prompts for an email address interactively.
734
68
 
69
+ ```sh
70
+ mailmodo signup
735
71
  ```
736
- mailmodo/
737
- welcome.html
738
- day3-nudge.html
739
- trial-expiry.html
740
- ```
741
-
742
- Templates are generated by `mailmodo init` and editable directly or via `mailmodo edit`. They are automatically synced to the Mailmodo cloud as a backup on every modifying command and restored automatically if the local file is missing.
743
-
744
- ---
745
72
 
746
- ## AI Agent Support
73
+ ### `mailmodo help [COMMAND]`
747
74
 
748
- All commands support two flags designed for headless and automated environments:
75
+ Display help for any command.
749
76
 
750
- | Flag | Description |
751
- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
752
- | `--json` | All output is valid JSON on stdout. Spinners and progress text go to stderr, keeping stdout clean for piping and parsing. |
753
- | `--yes` / `-y` | Skips all interactive confirmation prompts. The CLI proceeds with the inferred defaults, making it safe to run in scripts and CI pipelines. |
754
-
755
- ### API key via environment variable
756
-
757
- Set `MAILMODO_API_KEY` to authenticate without a config file:
758
-
759
- ```bash
760
- MAILMODO_API_KEY=mk_... mailmodo deploy --yes --json
77
+ ```sh
78
+ mailmodo help
79
+ mailmodo help signup
761
80
  ```
762
81
 
763
- ### Example: fully non-interactive deploy in CI
82
+ ## Scripts
764
83
 
765
- ```bash
766
- MAILMODO_API_KEY=$MAILMODO_API_KEY \
767
- mailmodo deploy --yes --json | jq '.sequenceId'
768
- ```
84
+ | Script | Description |
85
+ | --------------- | ------------------------------------ |
86
+ | `npm run build` | Clean `dist/` and compile TypeScript |
87
+ | `npm run lint` | Run ESLint |
88
+ | `npm test` | Run tests with Mocha |
769
89
 
770
- ### Example: AI agent loop
90
+ ## CI/CD & Release Automation
771
91
 
772
- ```bash
773
- # Generate emails, skip all prompts, get structured output
774
- mailmodo init --url https://yourapp.com --yes --json
92
+ ### Beta releases (on PR)
775
93
 
776
- # Edit with a specific instruction, no confirmation
777
- mailmodo edit welcome --change "add a P.S. with the link to our docs" --yes --json
94
+ Every time a pull request targeting `main` is opened or updated, a **beta version** is automatically published to npm. A comment is posted on the PR with install instructions:
778
95
 
779
- # Deploy immediately
780
- mailmodo deploy --yes --json
96
+ ```sh
97
+ npm install -g @mailmodo/cli@beta
781
98
  ```
782
99
 
783
- ---
784
-
785
- ## Contributing
100
+ This lets anyone on the team test the PR changes without checking out the branch locally.
786
101
 
787
- Contributions are welcome. This is an open-source project and issues, bug reports, and pull requests are appreciated.
102
+ > **Note:** npm publishing requires the `NPM_AUTH_TOKEN_WRITE` secret to be configured in the repo settings. Until then, the publish step will be skipped but all other steps (build, version bump, release) still work.
788
103
 
789
- ```bash
790
- # Clone and install
791
- git clone https://github.com/Mailmodo/mailmodo-cli.git
792
- cd mailmodo-cli
793
- npm install
104
+ ### Automatic versioning (on merge)
794
105
 
795
- # Build
796
- npm run build
106
+ When a PR is merged into `main`, the version in `package.json` is bumped automatically, a GitHub Release is created, and the new version is published to npm.
797
107
 
798
- # Run a command without building
799
- node ./bin/run.js <command>
800
-
801
- # Run tests
802
- npm test
108
+ The bump type is determined by a tag in the **PR title**:
803
109
 
804
- # Run a single test file
805
- npx mocha --loader ts-node/esm test/commands/<name>/index.test.ts
110
+ | PR title contains | Bump type | Example |
111
+ | ----------------- | --------- | ----------------- |
112
+ | `[major]` | major | `1.2.3` → `2.0.0` |
113
+ | `[minor]` | minor | `1.2.3` → `1.3.0` |
114
+ | `[patch]` | patch | `1.2.3` → `1.2.4` |
115
+ | _(nothing)_ | patch | `1.2.3` → `1.2.4` |
806
116
 
807
- # Lint
808
- npm run lint
809
- ```
810
-
811
- **Versioning:** PR title tags control version bumps on merge to `main`:
812
-
813
- - `[major]` → major bump
814
- - `[minor]` → minor bump
815
- - `[patch]` or no tag → patch bump
816
-
817
- Beta builds are published automatically to npm on every PR:
818
-
819
- ```bash
820
- npm install -g @mailmodo/cli@beta
821
- ```
117
+ **Examples of PR titles:**
822
118
 
823
- ---
119
+ - `[minor] Add email validation` → minor bump
120
+ - `[major] Rewrite auth flow` → major bump
121
+ - `Fix typo in help text` → patch bump (default)
824
122
 
825
123
  ## License
826
124
 
827
- MIT © [Mailmodo](https://github.com/Mailmodo)
125
+ MIT
@@ -380,52 +380,6 @@
380
380
  "index.js"
381
381
  ]
382
382
  },
383
- "init": {
384
- "aliases": [],
385
- "args": {},
386
- "description": "Analyze your product and generate email sequences",
387
- "examples": [
388
- "<%= config.bin %> init",
389
- "<%= config.bin %> init --url https://myapp.com --yes"
390
- ],
391
- "flags": {
392
- "json": {
393
- "description": "Output as JSON",
394
- "name": "json",
395
- "allowNo": false,
396
- "type": "boolean"
397
- },
398
- "yes": {
399
- "char": "y",
400
- "description": "Skip confirmation prompts",
401
- "name": "yes",
402
- "allowNo": false,
403
- "type": "boolean"
404
- },
405
- "url": {
406
- "description": "Product URL to analyze",
407
- "name": "url",
408
- "hasDynamicHelp": false,
409
- "multiple": false,
410
- "type": "option"
411
- }
412
- },
413
- "hasDynamicHelp": false,
414
- "hiddenAliases": [],
415
- "id": "init",
416
- "pluginAlias": "@mailmodo/cli",
417
- "pluginName": "@mailmodo/cli",
418
- "pluginType": "core",
419
- "strict": true,
420
- "enableJsonFlag": false,
421
- "isESM": true,
422
- "relativePath": [
423
- "dist",
424
- "commands",
425
- "init",
426
- "index.js"
427
- ]
428
- },
429
383
  "login": {
430
384
  "aliases": [],
431
385
  "args": {},
@@ -930,7 +884,53 @@
930
884
  "status",
931
885
  "index.js"
932
886
  ]
887
+ },
888
+ "init": {
889
+ "aliases": [],
890
+ "args": {},
891
+ "description": "Analyze your product and generate email sequences",
892
+ "examples": [
893
+ "<%= config.bin %> init",
894
+ "<%= config.bin %> init --url https://myapp.com --yes"
895
+ ],
896
+ "flags": {
897
+ "json": {
898
+ "description": "Output as JSON",
899
+ "name": "json",
900
+ "allowNo": false,
901
+ "type": "boolean"
902
+ },
903
+ "yes": {
904
+ "char": "y",
905
+ "description": "Skip confirmation prompts",
906
+ "name": "yes",
907
+ "allowNo": false,
908
+ "type": "boolean"
909
+ },
910
+ "url": {
911
+ "description": "Product URL to analyze",
912
+ "name": "url",
913
+ "hasDynamicHelp": false,
914
+ "multiple": false,
915
+ "type": "option"
916
+ }
917
+ },
918
+ "hasDynamicHelp": false,
919
+ "hiddenAliases": [],
920
+ "id": "init",
921
+ "pluginAlias": "@mailmodo/cli",
922
+ "pluginName": "@mailmodo/cli",
923
+ "pluginType": "core",
924
+ "strict": true,
925
+ "enableJsonFlag": false,
926
+ "isESM": true,
927
+ "relativePath": [
928
+ "dist",
929
+ "commands",
930
+ "init",
931
+ "index.js"
932
+ ]
933
933
  }
934
934
  },
935
- "version": "0.0.59-beta.pr61.111"
935
+ "version": "0.0.59"
936
936
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mailmodo/cli",
3
3
  "description": "Email lifecycle automation for the AI-native builder generation.",
4
- "version": "0.0.59-beta.pr61.111",
4
+ "version": "0.0.59",
5
5
  "author": "provishalk",
6
6
  "bin": {
7
7
  "mailmodo": "bin/run.js"
@@ -51,20 +51,8 @@
51
51
  ],
52
52
  "homepage": "https://github.com/Mailmodo/mailmodo-cli",
53
53
  "keywords": [
54
- "email",
55
- "email-automation",
56
- "lifecycle-emails",
57
- "onboarding",
58
- "transactional-email",
59
- "cli",
60
- "ai",
61
- "mailmodo",
62
- "sdk",
63
- "saas"
54
+ "oclif"
64
55
  ],
65
- "publishConfig": {
66
- "access": "public"
67
- },
68
56
  "license": "MIT",
69
57
  "main": "dist/index.js",
70
58
  "type": "module",
@@ -85,9 +73,9 @@
85
73
  "lint": "eslint",
86
74
  "postpack": "shx rm -f oclif.manifest.json",
87
75
  "posttest": "npm run lint",
88
- "prepack": "oclif manifest",
76
+ "prepack": "oclif manifest && oclif readme",
89
77
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
90
- "version": "git add README.md",
78
+ "version": "oclif readme && git add README.md",
91
79
  "prepare": "husky"
92
80
  },
93
81
  "types": "dist/index.d.ts",