@mailmodo/cli 0.0.32-beta.pr34.57 → 0.0.32

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.
@@ -23,9 +23,10 @@ export default class Login extends BaseCommand {
23
23
  if (existing?.apiKey) {
24
24
  if (flags.json) {
25
25
  this.log(JSON.stringify({
26
+ accountName: existing.accountName ?? null,
26
27
  email: existing.email ?? null,
28
+ freeRemaining: existing.freeRemaining ?? null,
27
29
  status: 'already_logged_in',
28
- totalFreeRemaining: existing.totalFreeRemaining ?? null,
29
30
  }, null, 2));
30
31
  return;
31
32
  }
@@ -67,20 +68,19 @@ export default class Login extends BaseCommand {
67
68
  if (!response.ok) {
68
69
  this.handleApiError(response);
69
70
  }
70
- const { email, totalFreeRemaining } = response.data;
71
+ const { accountName, email, freeRemaining } = response.data;
71
72
  await saveConfig({
73
+ accountName,
72
74
  apiKey: trimmedKey,
73
75
  email,
74
- totalFreeRemaining,
76
+ freeRemaining,
75
77
  });
76
78
  if (flags.json) {
77
- this.log(JSON.stringify({ email, status: 'authenticated', totalFreeRemaining }, null, 2));
79
+ this.log(JSON.stringify({ accountName, email, freeRemaining, status: 'authenticated' }, null, 2));
78
80
  return;
79
81
  }
80
82
  this.log(`\n Logged in as ${chalk.green(email)}`);
81
- if (totalFreeRemaining !== null && totalFreeRemaining !== undefined) {
82
- this.log(` Free tier: ${chalk.cyan(String(totalFreeRemaining))} emails remaining`);
83
- }
83
+ this.log(` Free tier: ${chalk.cyan(String(freeRemaining ?? 1000))} emails remaining`);
84
84
  this.log(' No credit card required.\n');
85
85
  this.log(` Next: Run ${chalk.cyan("'mailmodo init'")} to generate your email sequences.\n`);
86
86
  }
@@ -38,18 +38,13 @@ export default class Status extends BaseCommand {
38
38
  this.log(` ${chalk.dim('No data yet. Deploy emails first.')}`);
39
39
  }
40
40
  this.log('');
41
- if (monthlySent !== null && monthlySent !== undefined) {
42
- this.log(` Emails sent this month: ${chalk.bold(String(monthlySent))}`);
43
- }
41
+ this.log(` Emails sent this month: ${chalk.bold(String(monthlySent ?? 0))}`);
44
42
  if (quota) {
45
43
  if (quota.freeRemaining > 0) {
46
44
  this.log(` Free tier remaining: ${chalk.cyan(String(quota.freeRemaining))}`);
47
45
  }
48
46
  else if (quota.blocksUsed !== undefined) {
49
- if (quota.currentBlockRemaining !== null &&
50
- quota.currentBlockRemaining !== undefined) {
51
- this.log(` Current paid block: ${chalk.cyan(`${quota.currentBlockRemaining} / 10,000 used`)}`);
52
- }
47
+ this.log(` Current paid block: ${chalk.cyan(`${quota.currentBlockRemaining ?? 0} / 10,000 used`)}`);
53
48
  this.log(` Blocks purchased: ${quota.blocksUsed}`);
54
49
  }
55
50
  }
@@ -1,14 +1,15 @@
1
1
  export interface MailmodoConfig {
2
+ accountName?: string;
2
3
  apiKey: string;
3
4
  email?: string;
4
- totalFreeRemaining?: number;
5
+ freeRemaining?: number;
5
6
  }
6
7
  /**
7
8
  * Loads the Mailmodo CLI configuration from ~/.mailmodo/config.
8
9
  * The config file stores the API key and account metadata as JSON.
9
10
  *
10
11
  * @returns {Promise<MailmodoConfig | null>} The parsed configuration object
11
- * containing apiKey, email, and totalFreeRemaining quota,
12
+ * containing apiKey, email, accountName, and freeRemaining quota,
12
13
  * or null if the config file does not exist or is corrupted.
13
14
  */
14
15
  export declare function loadConfig(): Promise<MailmodoConfig | null>;
@@ -18,7 +19,7 @@ export declare function loadConfig(): Promise<MailmodoConfig | null>;
18
19
  * Overwrites any existing config file.
19
20
  *
20
21
  * @param {MailmodoConfig} config - The configuration to persist, must include
21
- * at minimum an apiKey. Optional fields: email, totalFreeRemaining.
22
+ * at minimum an apiKey. Optional fields: email, accountName, freeRemaining.
22
23
  */
23
24
  export declare function saveConfig(config: MailmodoConfig): Promise<void>;
24
25
  /**
@@ -9,7 +9,7 @@ const CONFIG_FILE = join(CONFIG_DIR, 'config');
9
9
  * The config file stores the API key and account metadata as JSON.
10
10
  *
11
11
  * @returns {Promise<MailmodoConfig | null>} The parsed configuration object
12
- * containing apiKey, email, and totalFreeRemaining quota,
12
+ * containing apiKey, email, accountName, and freeRemaining quota,
13
13
  * or null if the config file does not exist or is corrupted.
14
14
  */
15
15
  export async function loadConfig() {
@@ -29,7 +29,7 @@ export async function loadConfig() {
29
29
  * Overwrites any existing config file.
30
30
  *
31
31
  * @param {MailmodoConfig} config - The configuration to persist, must include
32
- * at minimum an apiKey. Optional fields: email, totalFreeRemaining.
32
+ * at minimum an apiKey. Optional fields: email, accountName, freeRemaining.
33
33
  */
34
34
  export async function saveConfig(config) {
35
35
  if (!existsSync(CONFIG_DIR)) {
@@ -228,6 +228,58 @@
228
228
  "index.js"
229
229
  ]
230
230
  },
231
+ "edit": {
232
+ "aliases": [],
233
+ "args": {
234
+ "id": {
235
+ "description": "Email template ID to edit",
236
+ "name": "id",
237
+ "required": true
238
+ }
239
+ },
240
+ "description": "Edit an email using AI-assisted natural language changes",
241
+ "examples": [
242
+ "<%= config.bin %> edit welcome",
243
+ "<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
244
+ ],
245
+ "flags": {
246
+ "json": {
247
+ "description": "Output as JSON",
248
+ "name": "json",
249
+ "allowNo": false,
250
+ "type": "boolean"
251
+ },
252
+ "yes": {
253
+ "char": "y",
254
+ "description": "Skip confirmation prompts",
255
+ "name": "yes",
256
+ "allowNo": false,
257
+ "type": "boolean"
258
+ },
259
+ "change": {
260
+ "description": "Natural language description of the change",
261
+ "name": "change",
262
+ "hasDynamicHelp": false,
263
+ "multiple": false,
264
+ "type": "option"
265
+ }
266
+ },
267
+ "hasDynamicHelp": false,
268
+ "hiddenAliases": [],
269
+ "id": "edit",
270
+ "pluginAlias": "@mailmodo/cli",
271
+ "pluginName": "@mailmodo/cli",
272
+ "pluginType": "core",
273
+ "strict": true,
274
+ "enableJsonFlag": false,
275
+ "isESM": true,
276
+ "relativePath": [
277
+ "dist",
278
+ "commands",
279
+ "edit",
280
+ "index.js"
281
+ ]
282
+ },
231
283
  "emails": {
232
284
  "aliases": [],
233
285
  "args": {},
@@ -460,64 +512,6 @@
460
512
  "index.js"
461
513
  ]
462
514
  },
463
- "preview": {
464
- "aliases": [],
465
- "args": {
466
- "id": {
467
- "description": "Email template ID to preview",
468
- "name": "id"
469
- }
470
- },
471
- "description": "Preview an email in browser, as text, or send a test",
472
- "examples": [
473
- "<%= config.bin %> preview welcome",
474
- "<%= config.bin %> preview welcome --text",
475
- "<%= config.bin %> preview welcome --send me@example.com"
476
- ],
477
- "flags": {
478
- "json": {
479
- "description": "Output as JSON",
480
- "name": "json",
481
- "allowNo": false,
482
- "type": "boolean"
483
- },
484
- "yes": {
485
- "char": "y",
486
- "description": "Skip confirmation prompts",
487
- "name": "yes",
488
- "allowNo": false,
489
- "type": "boolean"
490
- },
491
- "send": {
492
- "description": "Send test email to this address",
493
- "name": "send",
494
- "hasDynamicHelp": false,
495
- "multiple": false,
496
- "type": "option"
497
- },
498
- "text": {
499
- "description": "Output plain text version (for AI agents)",
500
- "name": "text",
501
- "allowNo": false,
502
- "type": "boolean"
503
- }
504
- },
505
- "hasDynamicHelp": false,
506
- "hiddenAliases": [],
507
- "id": "preview",
508
- "pluginAlias": "@mailmodo/cli",
509
- "pluginName": "@mailmodo/cli",
510
- "pluginType": "core",
511
- "strict": true,
512
- "enableJsonFlag": false,
513
- "isESM": true,
514
- "relativePath": [
515
- "dist",
516
- "commands",
517
- "preview",
518
- "index.js"
519
- ]
520
- },
521
515
  "settings": {
522
516
  "aliases": [],
523
517
  "args": {},
@@ -565,13 +559,19 @@
565
559
  "index.js"
566
560
  ]
567
561
  },
568
- "status": {
562
+ "preview": {
569
563
  "aliases": [],
570
- "args": {},
571
- "description": "View email performance metrics and quota usage",
564
+ "args": {
565
+ "id": {
566
+ "description": "Email template ID to preview",
567
+ "name": "id"
568
+ }
569
+ },
570
+ "description": "Preview an email in browser, as text, or send a test",
572
571
  "examples": [
573
- "<%= config.bin %> status",
574
- "<%= config.bin %> status --json"
572
+ "<%= config.bin %> preview welcome",
573
+ "<%= config.bin %> preview welcome --text",
574
+ "<%= config.bin %> preview welcome --send me@example.com"
575
575
  ],
576
576
  "flags": {
577
577
  "json": {
@@ -586,11 +586,24 @@
586
586
  "name": "yes",
587
587
  "allowNo": false,
588
588
  "type": "boolean"
589
+ },
590
+ "send": {
591
+ "description": "Send test email to this address",
592
+ "name": "send",
593
+ "hasDynamicHelp": false,
594
+ "multiple": false,
595
+ "type": "option"
596
+ },
597
+ "text": {
598
+ "description": "Output plain text version (for AI agents)",
599
+ "name": "text",
600
+ "allowNo": false,
601
+ "type": "boolean"
589
602
  }
590
603
  },
591
604
  "hasDynamicHelp": false,
592
605
  "hiddenAliases": [],
593
- "id": "status",
606
+ "id": "preview",
594
607
  "pluginAlias": "@mailmodo/cli",
595
608
  "pluginName": "@mailmodo/cli",
596
609
  "pluginType": "core",
@@ -600,23 +613,17 @@
600
613
  "relativePath": [
601
614
  "dist",
602
615
  "commands",
603
- "status",
616
+ "preview",
604
617
  "index.js"
605
618
  ]
606
619
  },
607
- "edit": {
620
+ "status": {
608
621
  "aliases": [],
609
- "args": {
610
- "id": {
611
- "description": "Email template ID to edit",
612
- "name": "id",
613
- "required": true
614
- }
615
- },
616
- "description": "Edit an email using AI-assisted natural language changes",
622
+ "args": {},
623
+ "description": "View email performance metrics and quota usage",
617
624
  "examples": [
618
- "<%= config.bin %> edit welcome",
619
- "<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
625
+ "<%= config.bin %> status",
626
+ "<%= config.bin %> status --json"
620
627
  ],
621
628
  "flags": {
622
629
  "json": {
@@ -631,18 +638,11 @@
631
638
  "name": "yes",
632
639
  "allowNo": false,
633
640
  "type": "boolean"
634
- },
635
- "change": {
636
- "description": "Natural language description of the change",
637
- "name": "change",
638
- "hasDynamicHelp": false,
639
- "multiple": false,
640
- "type": "option"
641
641
  }
642
642
  },
643
643
  "hasDynamicHelp": false,
644
644
  "hiddenAliases": [],
645
- "id": "edit",
645
+ "id": "status",
646
646
  "pluginAlias": "@mailmodo/cli",
647
647
  "pluginName": "@mailmodo/cli",
648
648
  "pluginType": "core",
@@ -652,10 +652,10 @@
652
652
  "relativePath": [
653
653
  "dist",
654
654
  "commands",
655
- "edit",
655
+ "status",
656
656
  "index.js"
657
657
  ]
658
658
  }
659
659
  },
660
- "version": "0.0.32-beta.pr34.57"
660
+ "version": "0.0.32"
661
661
  }
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.32-beta.pr34.57",
4
+ "version": "0.0.32",
5
5
  "author": "provishalk",
6
6
  "bin": {
7
7
  "mailmodo": "bin/run.js"