@emailens/cli 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Emailens
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,118 @@
1
+ # @emailens/cli
2
+
3
+ CLI tool for email compatibility analysis — preview how HTML emails render across 12 email clients (Gmail, Outlook, Apple Mail, Yahoo, Samsung, Thunderbird, HEY, Superhuman).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @emailens/cli
9
+ ```
10
+
11
+ Or use with npx:
12
+
13
+ ```bash
14
+ npx @emailens/cli analyze email.html
15
+ ```
16
+
17
+ ## Commands
18
+
19
+ ### `emailens analyze <file>`
20
+
21
+ Analyze CSS compatibility and get per-client scores.
22
+
23
+ ```bash
24
+ emailens analyze email.html
25
+ emailens analyze email.html --clients gmail-web,outlook-windows
26
+ emailens analyze email.html --json
27
+ cat email.html | emailens analyze -
28
+ ```
29
+
30
+ ### `emailens preview <file>`
31
+
32
+ Full preview pipeline: transforms, analysis, dark mode simulation, and optional screenshots.
33
+
34
+ ```bash
35
+ emailens preview email.html
36
+ emailens preview email.html --dark-mode
37
+ emailens preview email.html --screenshots --out ./screenshots
38
+ emailens preview email.html --json
39
+ ```
40
+
41
+ ### `emailens export <file>`
42
+
43
+ Export a self-contained HTML or JSON report.
44
+
45
+ ```bash
46
+ emailens export email.html -o ./report
47
+ emailens export email.html --json -o ./report
48
+ emailens export email.html --dark-mode --screenshots -o ./report
49
+ ```
50
+
51
+ ### `emailens clients`
52
+
53
+ List all 12 supported email clients.
54
+
55
+ ```bash
56
+ emailens clients
57
+ emailens clients --json
58
+ ```
59
+
60
+ ## Options
61
+
62
+ All file-processing commands share:
63
+
64
+ | Flag | Alias | Description |
65
+ |------|-------|-------------|
66
+ | `--format` | `-f` | Input format: `html`, `jsx`, `mjml`, `maizzle` |
67
+ | `--clients` | `-c` | Comma-separated client IDs to filter |
68
+ | `--json` | | Output JSON instead of terminal table |
69
+ | `--quiet` | `-q` | Suppress spinners and decorations |
70
+
71
+ Preview and export add:
72
+
73
+ | Flag | Alias | Description |
74
+ |------|-------|-------------|
75
+ | `--dark-mode` | `-d` | Include dark mode simulation |
76
+ | `--screenshots` | | Capture screenshots (requires `BROWSERLESS_URL`) |
77
+ | `--out` | `-o` | Output directory |
78
+
79
+ ## Framework Support
80
+
81
+ The CLI can compile React Email (JSX/TSX), MJML, and Maizzle templates to HTML before analysis. Format is auto-detected from file extension, or specify with `--format`.
82
+
83
+ ```bash
84
+ emailens analyze newsletter.tsx # Auto-detected as JSX
85
+ emailens analyze template.mjml # Auto-detected as MJML
86
+ emailens preview email.html --format maizzle # Explicit format
87
+ ```
88
+
89
+ Framework compilers are optional peer dependencies — install only what you need:
90
+
91
+ ```bash
92
+ npm install sucrase react @react-email/components @react-email/render # For JSX
93
+ npm install mjml # For MJML
94
+ npm install @maizzle/framework # For Maizzle
95
+ ```
96
+
97
+ ## Screenshots
98
+
99
+ Screenshots require a [Browserless](https://www.browserless.io/) instance and `playwright-core`:
100
+
101
+ ```bash
102
+ npm install playwright-core
103
+ export BROWSERLESS_URL=ws://localhost:3000
104
+ emailens preview email.html --screenshots --out ./screenshots
105
+ ```
106
+
107
+ ## Piping
108
+
109
+ Read from stdin with `-`:
110
+
111
+ ```bash
112
+ cat email.html | emailens analyze -
113
+ echo '<html><body>Hello</body></html>' | emailens preview - --json
114
+ ```
115
+
116
+ ## License
117
+
118
+ MIT