@cakemail-org/cakemail-cli 1.7.0 → 2.0.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.
Files changed (198) hide show
  1. package/.claude/settings.local.json +12 -0
  2. package/.env.example +40 -0
  3. package/.env.test.example +45 -0
  4. package/CHANGELOG.md +1031 -0
  5. package/README.md +41 -37
  6. package/audit-formats.js +128 -0
  7. package/cakemail.rb +20 -0
  8. package/dist/client.js +1 -1
  9. package/dist/client.js.map +1 -1
  10. package/dist/commands/account.js +1 -1
  11. package/dist/commands/account.js.map +1 -1
  12. package/dist/commands/attributes.js +1 -1
  13. package/dist/commands/attributes.js.map +1 -1
  14. package/dist/commands/campaigns.js +1 -1
  15. package/dist/commands/campaigns.js.map +1 -1
  16. package/dist/commands/contacts.js +1 -1
  17. package/dist/commands/contacts.js.map +1 -1
  18. package/dist/commands/emails.js +1 -1
  19. package/dist/commands/emails.js.map +1 -1
  20. package/dist/commands/interests.js +1 -1
  21. package/dist/commands/interests.js.map +1 -1
  22. package/dist/commands/lists.js +1 -1
  23. package/dist/commands/lists.js.map +1 -1
  24. package/dist/commands/logs.js +1 -1
  25. package/dist/commands/logs.js.map +1 -1
  26. package/dist/commands/reports.js +1 -1
  27. package/dist/commands/reports.js.map +1 -1
  28. package/dist/commands/segments.js +1 -1
  29. package/dist/commands/segments.js.map +1 -1
  30. package/dist/commands/senders.js +1 -1
  31. package/dist/commands/senders.js.map +1 -1
  32. package/dist/commands/suppressed.js +1 -1
  33. package/dist/commands/suppressed.js.map +1 -1
  34. package/dist/commands/tags.js +1 -1
  35. package/dist/commands/tags.js.map +1 -1
  36. package/dist/commands/templates.js +1 -1
  37. package/dist/commands/templates.js.map +1 -1
  38. package/dist/commands/transactional-templates.js +1 -1
  39. package/dist/commands/transactional-templates.js.map +1 -1
  40. package/dist/commands/webhooks.js +1 -1
  41. package/dist/commands/webhooks.js.map +1 -1
  42. package/dist/utils/config.js +2 -2
  43. package/dist/utils/config.js.map +1 -1
  44. package/dist/utils/errors.js +1 -1
  45. package/dist/utils/errors.js.map +1 -1
  46. package/dist/utils/progress.d.ts.map +1 -1
  47. package/dist/utils/progress.js +32 -4
  48. package/dist/utils/progress.js.map +1 -1
  49. package/dist/utils/spinner.d.ts +17 -0
  50. package/dist/utils/spinner.d.ts.map +1 -0
  51. package/dist/utils/spinner.js +43 -0
  52. package/dist/utils/spinner.js.map +1 -0
  53. package/docs/DOCUMENTATION-STANDARD.md +1068 -0
  54. package/docs/README.md +161 -0
  55. package/docs/developer/ARCHITECTURE.md +516 -0
  56. package/docs/developer/AUTH.md +204 -0
  57. package/docs/developer/CONTRIBUTING.md +227 -0
  58. package/docs/developer/DOCUMENTATION_SUMMARY.md +346 -0
  59. package/docs/developer/PROJECT_INDEX.md +365 -0
  60. package/docs/planning/API_COVERAGE.md +1045 -0
  61. package/docs/planning/BACKLOG.md +1159 -0
  62. package/docs/planning/PROFILE_SYSTEM_TASKS.md +287 -0
  63. package/docs/planning/UX_IMPLEMENTATION_PLAN.md +691 -0
  64. package/docs/planning/archive/RELEASE_CHECKLIST_v1.3.0.md +332 -0
  65. package/docs/planning/archive/RELEASE_v1.3.0.md +428 -0
  66. package/docs/planning/archive/cakemail-cli-ux-improvements.md +438 -0
  67. package/docs/planning/cakemail-profile-system-plan.md +1121 -0
  68. package/docs/testing/AI_USER_SIMULATION_DESIGN.md +1342 -0
  69. package/docs/testing/KENOGAMI_BIDIRECTIONAL_FLOW.md +1517 -0
  70. package/docs/testing/KENOGAMI_TRUTH_RECONCILIATION_SYSTEM.md +1369 -0
  71. package/docs/user-manual/.obsidian/app.json +1 -0
  72. package/docs/user-manual/.obsidian/appearance.json +1 -0
  73. package/docs/user-manual/.obsidian/core-plugins.json +33 -0
  74. package/docs/user-manual/.obsidian/workspace.json +167 -0
  75. package/docs/user-manual/01-getting-started/01-installation.md +214 -0
  76. package/docs/user-manual/01-getting-started/02-quick-start.md +432 -0
  77. package/docs/user-manual/01-getting-started/03-authentication.md +448 -0
  78. package/docs/user-manual/01-getting-started/04-configuration.md +430 -0
  79. package/docs/user-manual/01-getting-started/05-output-formats.md +447 -0
  80. package/docs/user-manual/02-core-concepts/01-accounts.md +514 -0
  81. package/docs/user-manual/02-core-concepts/02-profile-system.md +771 -0
  82. package/docs/user-manual/02-core-concepts/03-smart-defaults.md +485 -0
  83. package/docs/user-manual/02-core-concepts/04-authentication-methods.md +435 -0
  84. package/docs/user-manual/02-core-concepts/05-pagination-filtering.md +600 -0
  85. package/docs/user-manual/02-core-concepts/06-error-handling.md +718 -0
  86. package/docs/user-manual/02-core-concepts/07-api-coverage.md +483 -0
  87. package/docs/user-manual/03-email-operations/01-senders.md +490 -0
  88. package/docs/user-manual/03-email-operations/02-templates.md +444 -0
  89. package/docs/user-manual/03-email-operations/03-transactional-emails.md +706 -0
  90. package/docs/user-manual/03-email-operations/04-email-tracking.md +407 -0
  91. package/docs/user-manual/04-campaign-management/01-campaigns-basics.md +394 -0
  92. package/docs/user-manual/04-campaign-management/02-campaign-scheduling.md +630 -0
  93. package/docs/user-manual/04-campaign-management/03-campaign-testing.md +997 -0
  94. package/docs/user-manual/04-campaign-management/04-campaign-lifecycle.md +709 -0
  95. package/docs/user-manual/04-campaign-management/05-campaign-links.md +934 -0
  96. package/docs/user-manual/05-contact-management/01-lists.md +836 -0
  97. package/docs/user-manual/05-contact-management/02-contacts.md +1035 -0
  98. package/docs/user-manual/05-contact-management/03-custom-attributes.md +788 -0
  99. package/docs/user-manual/05-contact-management/04-segments.md +1028 -0
  100. package/docs/user-manual/05-contact-management/05-contact-import-export.md +1031 -0
  101. package/docs/user-manual/06-analytics-reporting/01-campaign-analytics.md +867 -0
  102. package/docs/user-manual/06-analytics-reporting/02-account-reports.md +227 -0
  103. package/docs/user-manual/07-integrations/01-webhooks-integration.md +259 -0
  104. package/docs/user-manual/07-integrations/02-automation.md +326 -0
  105. package/docs/user-manual/08-advanced-usage/01-scripting-patterns.md +672 -0
  106. package/docs/user-manual/08-advanced-usage/02-bulk-operations.md +932 -0
  107. package/docs/user-manual/08-advanced-usage/03-ci-cd-integration.md +892 -0
  108. package/docs/user-manual/08-advanced-usage/04-performance-optimization.md +766 -0
  109. package/docs/user-manual/09-command-reference/01-config.md +776 -0
  110. package/docs/user-manual/09-command-reference/02-account.md +652 -0
  111. package/docs/user-manual/09-command-reference/03-lists.md +958 -0
  112. package/docs/user-manual/09-command-reference/04-contacts.md +1408 -0
  113. package/docs/user-manual/09-command-reference/05-attributes.md +617 -0
  114. package/docs/user-manual/09-command-reference/06-segments.md +894 -0
  115. package/docs/user-manual/09-command-reference/07-senders.md +803 -0
  116. package/docs/user-manual/09-command-reference/08-templates.md +818 -0
  117. package/docs/user-manual/09-command-reference/09-campaigns.md +1250 -0
  118. package/docs/user-manual/09-command-reference/10-emails.md +807 -0
  119. package/docs/user-manual/09-command-reference/11-reports.md +1135 -0
  120. package/docs/user-manual/09-command-reference/12-webhooks.md +773 -0
  121. package/docs/user-manual/09-command-reference/13-suppressed.md +797 -0
  122. package/docs/user-manual/09-command-reference/14-interests.md +630 -0
  123. package/docs/user-manual/09-command-reference/15-tags.md +584 -0
  124. package/docs/user-manual/09-command-reference/16-logs.md +656 -0
  125. package/docs/user-manual/09-command-reference/17-transactional-templates.md +850 -0
  126. package/docs/user-manual/10-troubleshooting/01-common-errors.md +457 -0
  127. package/docs/user-manual/10-troubleshooting/02-authentication-issues.md +558 -0
  128. package/docs/user-manual/10-troubleshooting/03-connection-problems.md +634 -0
  129. package/docs/user-manual/10-troubleshooting/04-debugging.md +725 -0
  130. package/docs/user-manual/11-appendix/04-faq.md +484 -0
  131. package/docs/user-manual/11-appendix/05-glossary.md +250 -0
  132. package/docs/user-manual/README.md +0 -0
  133. package/package.json +13 -61
  134. package/src/cli.ts +125 -0
  135. package/src/client.ts +16 -0
  136. package/src/commands/account.ts +267 -0
  137. package/src/commands/accounts.ts +78 -0
  138. package/src/commands/actions.ts +249 -0
  139. package/src/commands/attributes.ts +139 -0
  140. package/src/commands/campaign-blueprints.ts +106 -0
  141. package/src/commands/campaigns.ts +469 -0
  142. package/src/commands/config.ts +77 -0
  143. package/src/commands/contacts.ts +612 -0
  144. package/src/commands/custom-attributes.ts +127 -0
  145. package/src/commands/dkims.ts +117 -0
  146. package/src/commands/domains.ts +82 -0
  147. package/src/commands/email-apis.ts +569 -0
  148. package/src/commands/emails.ts +197 -0
  149. package/src/commands/forms.ts +283 -0
  150. package/src/commands/interests.ts +155 -0
  151. package/src/commands/links.ts +38 -0
  152. package/src/commands/lists.ts +406 -0
  153. package/src/commands/logos.ts +71 -0
  154. package/src/commands/logs.ts +386 -0
  155. package/src/commands/reports.ts +306 -0
  156. package/src/commands/segments.ts +158 -0
  157. package/src/commands/senders.ts +204 -0
  158. package/src/commands/sub-accounts.ts +271 -0
  159. package/src/commands/suppressed-emails.ts +234 -0
  160. package/src/commands/suppressed.ts +198 -0
  161. package/src/commands/system-emails.ts +85 -0
  162. package/src/commands/tags.ts +146 -0
  163. package/src/commands/tasks.ts +116 -0
  164. package/src/commands/templates.ts +189 -0
  165. package/src/commands/tokens.ts +83 -0
  166. package/src/commands/transactional-emails.ts +374 -0
  167. package/src/commands/transactional-templates.ts +385 -0
  168. package/src/commands/users.ts +506 -0
  169. package/src/commands/webhooks.ts +172 -0
  170. package/src/commands/workflow-blueprints.ts +123 -0
  171. package/src/commands/workflows.ts +265 -0
  172. package/src/types/profile.ts +93 -0
  173. package/src/utils/auth.ts +272 -0
  174. package/src/utils/config-file.ts +96 -0
  175. package/src/utils/config.ts +134 -0
  176. package/src/utils/confirm.ts +32 -0
  177. package/src/utils/defaults.ts +99 -0
  178. package/src/utils/errors.ts +116 -0
  179. package/src/utils/interactive.ts +91 -0
  180. package/src/utils/list-defaults.ts +74 -0
  181. package/src/utils/output.ts +190 -0
  182. package/src/utils/progress.ts +320 -0
  183. package/src/utils/spinner.ts +22 -0
  184. package/tests/IMPLEMENTATION_STATUS.md +258 -0
  185. package/tests/PTY_SETUP.md +118 -0
  186. package/tests/PTY_TESTING_GUIDE.md +507 -0
  187. package/tests/README.md +244 -0
  188. package/tests/fixtures/api-responses/campaigns.json +34 -0
  189. package/tests/fixtures/test-config.json +13 -0
  190. package/tests/helpers/cli-runner.ts +128 -0
  191. package/tests/helpers/mock-server.ts +301 -0
  192. package/tests/helpers/pty-runner.ts +181 -0
  193. package/tests/integration/campaigns-real-api.test.ts +196 -0
  194. package/tests/integration/setup-integration.ts +50 -0
  195. package/tests/pty/campaigns.test.ts +241 -0
  196. package/tests/setup.ts +34 -0
  197. package/tsconfig.json +15 -0
  198. package/vitest.config.ts +28 -0
@@ -0,0 +1,1045 @@
1
+ # Cakemail API Coverage Report
2
+
3
+ **CLI Version:** 1.2.0
4
+ **Package Name:** @cakemail-org/cakemail-cli
5
+ **SDK Version:** @cakemail-org/cakemail-sdk v2.0.0
6
+ **SDK API Coverage:** 100% (232 operations)
7
+ **CLI Commands Implemented:** 56 / 232 (24%)
8
+ **Coverage Focus:** High-value, commonly-used operations with strategic expansion plan
9
+
10
+ ---
11
+
12
+ ## Overview
13
+
14
+ The Cakemail CLI is built on top of the official [@cakemail-org/cakemail-sdk](https://www.npmjs.com/package/@cakemail-org/cakemail-sdk) v2.0, which provides **100% coverage** of the Cakemail API (232 operations across 28 services).
15
+
16
+ The CLI focuses on implementing **high-value, commonly-used commands** that developers and marketers need in their daily workflows, while the full SDK is available for advanced use cases.
17
+
18
+ **Design Philosophy:**
19
+ - **CLI**: Intuitive commands for daily operations
20
+ - **SDK**: Complete API access for advanced automation
21
+ - **Best of both**: Use CLI commands in terminal, SDK in custom scripts
22
+
23
+ ---
24
+
25
+ ## Command Coverage by Category
26
+
27
+ | Category | CLI Commands | API Endpoints | Gaps | Priority | Target Version |
28
+ |----------|--------------|---------------|------|----------|----------------|
29
+ | **Campaigns** | 15 / 18 | 18 total | Revisions(1), Render(1), Blueprint(3) | Medium | v1.3 |
30
+ | **Lists** | 4 / 11 | 11 total | Archive(1), Stats(1), Update(1), Policy(1), Forms(7) | High | v1.3 |
31
+ | **Contacts** | 6 / 17 | 17 total | Import(1), Export(5), Bulk-Tag(4), Interests(2) | **CRITICAL** | v1.3 |
32
+ | **Senders** | 7 / 7 | 7 total | - | ✅ Complete | - |
33
+ | **Templates** | 6 / 6 | 6 total | - | ✅ Complete | - |
34
+ | **Webhooks** | 6 / 6 | 6 total | - | ✅ Complete | - |
35
+ | **Email API v2** | 3 / 8 | 8 total | Logs(2), Stats(1), Tags(1), Templates(1) | High | v1.3 |
36
+ | **Reports** | 0 / 18 | 18 total | All reporting features | **CRITICAL** | v1.3 |
37
+ | **Segments** | 0 / 5 | 5 total | All segment operations | **CRITICAL** | v1.3 |
38
+ | **Custom Attributes** | 0 / 3 | 3 total | All attribute management | High | v1.3 |
39
+ | **Tags** | 0 / 5 | 5 total | All tag operations | High | v1.4 |
40
+ | **Interests** | 0 / 5 | 5 total | All interest management | Medium | v1.4 |
41
+ | **Suppression List** | 0 / 6 | 6 total | All suppression operations | High | v1.3 |
42
+ | **Logs** | 0 / 10 | 10 total | Campaign/List/Workflow logs | Medium | v1.4 |
43
+ | **Account** | 0 / 13 | 13 total | Self/Sub-account management | Low | v1.5 |
44
+ | **Users** | 0 / 13 | 13 total | User management, MFA | Low | v1.5 |
45
+ | **Domains & DKIM** | 0 / 7 | 7 total | Domain verification, DKIM | Medium | v1.5 |
46
+ | **Workflows** | 0 / 18 | 18 total | Automation workflows | Medium | v1.5 |
47
+ | **Forms** | 0 / 5 | 5 total | Subscription forms | Low | v1.5 |
48
+ | **Transactional Templates** | 0 / 9 | 9 total | Transactional email mgmt | Medium | v1.4 |
49
+ | **Tasks** | 0 / 3 | 3 total | Async task monitoring | Low | v1.5 |
50
+ | **System Emails** | 0 / 3 | 3 total | System email config | Low | v1.5 |
51
+ | **Links** | 0 / 1 | 1 total | Link information | Low | - |
52
+ | **Logos** | 0 / 2 | 2 total | Brand logo upload | Low | - |
53
+ | **Token** | 0 / 3 | 3 total | Token management | Low | - |
54
+
55
+ **Total Coverage:** 56 / 232 operations (24.1%)
56
+ **Target v1.3:** 106 / 232 operations (45.7%)
57
+ **Target v1.4:** 140 / 232 operations (60.3%)
58
+ **Target v1.5:** 180+ / 232 operations (77.6%+)
59
+
60
+ ---
61
+
62
+ ## Installation
63
+
64
+ The CLI is distributed via three channels:
65
+
66
+ ```bash
67
+ # npm
68
+ npm install -g @cakemail-org/cakemail-cli
69
+
70
+ # Homebrew
71
+ brew tap cakemail/cakemail
72
+ brew install cakemail-cli
73
+
74
+ # npx (no installation)
75
+ npx @cakemail-org/cakemail-cli campaigns list
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Implemented CLI Commands
81
+
82
+ ### ✅ Campaigns (15 commands) - COMPLETE
83
+
84
+ **Full campaign lifecycle management:**
85
+
86
+ ```bash
87
+ # List and filter
88
+ cakemail campaigns list
89
+ cakemail campaigns list --status active --sort "-created_on"
90
+ cakemail campaigns list -l 50 -p 2 # Pagination
91
+
92
+ # CRUD operations
93
+ cakemail campaigns get <id>
94
+ cakemail campaigns create -n "Newsletter" -s "Subject" --list-id 123
95
+ cakemail campaigns update <id> -n "New Name"
96
+ cakemail campaigns delete <id>
97
+
98
+ # Lifecycle operations
99
+ cakemail campaigns schedule <id> --date "2025-12-01T10:00:00Z"
100
+ cakemail campaigns reschedule <id> --date "2025-12-02T10:00:00Z"
101
+ cakemail campaigns unschedule <id>
102
+ cakemail campaigns test <id> -e test@example.com
103
+ cakemail campaigns cancel <id>
104
+ cakemail campaigns suspend <id>
105
+ cakemail campaigns resume <id>
106
+
107
+ # Management
108
+ cakemail campaigns archive <id>
109
+ cakemail campaigns unarchive <id>
110
+ cakemail campaigns links <id>
111
+ ```
112
+
113
+ **SDK Access:**
114
+ ```typescript
115
+ client.sdk.campaigns.list({ status: 'active' })
116
+ client.sdk.campaignService.getCampaign({ campaignId: 123 })
117
+ ```
118
+
119
+ ---
120
+
121
+ ### ✅ Lists (4 commands) - CORE COMPLETE
122
+
123
+ **Essential list management:**
124
+
125
+ ```bash
126
+ # List operations
127
+ cakemail lists list
128
+ cakemail lists list --sort "+name" -l 100
129
+
130
+ # CRUD operations
131
+ cakemail lists get <id>
132
+ cakemail lists create -n "VIP Customers" -l "en_US"
133
+ cakemail lists delete <id>
134
+ ```
135
+
136
+ **SDK Access:**
137
+ ```typescript
138
+ client.sdk.lists.create({ name: 'Newsletter', language: 'en_US' })
139
+ client.sdk.listService.getList({ listId: 123 })
140
+ ```
141
+
142
+ **Available via SDK (not yet in CLI):**
143
+ - List updates and archiving
144
+ - List statistics (subscriber counts, growth metrics)
145
+ - Subscription forms management
146
+ - List-level settings and policies
147
+
148
+ ---
149
+
150
+ ### ✅ Contacts (6 commands) - CORE COMPLETE
151
+
152
+ **Essential contact operations:**
153
+
154
+ ```bash
155
+ # List contacts
156
+ cakemail contacts list <list-id>
157
+ cakemail contacts list <list-id> --status subscribed --sort "+email"
158
+
159
+ # CRUD operations
160
+ cakemail contacts get <list-id> <contact-id>
161
+ cakemail contacts add <list-id> -e user@example.com --first-name "John" --last-name "Doe"
162
+ cakemail contacts update <list-id> <contact-id> --first-name "Jane"
163
+ cakemail contacts delete <list-id> <contact-id>
164
+
165
+ # Subscription management
166
+ cakemail contacts unsubscribe <list-id> <contact-id>
167
+ ```
168
+
169
+ **SDK Access:**
170
+ ```typescript
171
+ client.sdk.contacts.create({
172
+ email: 'user@example.com',
173
+ list_ids: [123],
174
+ first_name: 'John',
175
+ custom_attributes: { company: 'Acme' }
176
+ })
177
+ client.sdk.contactService.getContact({ contactId: 456 })
178
+ ```
179
+
180
+ **Available via SDK (not yet in CLI):**
181
+ - Bulk contact imports/exports
182
+ - Contact tagging (single and bulk)
183
+ - Interest management
184
+ - Segment-based operations
185
+ - Contact merge operations
186
+
187
+ ---
188
+
189
+ ### ✅ Senders (7 commands) - COMPLETE
190
+
191
+ **Full sender management with email verification:**
192
+
193
+ ```bash
194
+ # List senders
195
+ cakemail senders list
196
+ cakemail senders list --sort "+email"
197
+
198
+ # CRUD operations
199
+ cakemail senders get <id>
200
+ cakemail senders create -n "John Doe" -e "john@example.com"
201
+ cakemail senders update <id> -n "Jane Doe"
202
+ cakemail senders delete <id>
203
+
204
+ # Email verification
205
+ cakemail senders confirm <confirmation-id> # From verification email
206
+ cakemail senders resend-confirmation <id>
207
+ ```
208
+
209
+ **SDK Access:**
210
+ ```typescript
211
+ client.sdk.senderService.createSender({
212
+ requestBody: { name: 'John Doe', email: 'john@example.com' }
213
+ })
214
+ client.sdk.senderService.confirmSender({
215
+ requestBody: { confirmation_id: 'abc123' }
216
+ })
217
+ ```
218
+
219
+ **Note:** Sender IDs are strings in SDK 2.0 (not integers).
220
+
221
+ ---
222
+
223
+ ### ✅ Templates (6 commands) - COMPLETE
224
+
225
+ **Full template management with file uploads:**
226
+
227
+ ```bash
228
+ # List templates
229
+ cakemail templates list
230
+ cakemail templates list --filter "name==Newsletter"
231
+
232
+ # CRUD operations
233
+ cakemail templates get <id>
234
+ cakemail templates create -n "Welcome Email" --html-file template.html
235
+ cakemail templates update <id> -n "Updated Template" --text-file body.txt
236
+ cakemail templates delete <id>
237
+
238
+ # Rendering
239
+ cakemail templates render <id> # Preview template HTML
240
+ ```
241
+
242
+ **SDK Access:**
243
+ ```typescript
244
+ client.sdk.templateService.createTemplate({
245
+ requestBody: {
246
+ name: 'Welcome',
247
+ html: '<h1>Hello {{name}}</h1>',
248
+ text: 'Hello {{name}}'
249
+ }
250
+ })
251
+ client.sdk.templateService.renderTemplate({ templateId: 123 })
252
+ ```
253
+
254
+ **File Upload Support:**
255
+ - `--html-file <path>`: Load HTML from file
256
+ - `--text-file <path>`: Load text from file
257
+
258
+ ---
259
+
260
+ ### ✅ Webhooks (6 commands) - COMPLETE
261
+
262
+ **Full webhook management:**
263
+
264
+ ```bash
265
+ # List webhooks
266
+ cakemail webhooks list
267
+ cakemail webhooks list -l 100
268
+
269
+ # CRUD operations
270
+ cakemail webhooks get <id>
271
+ cakemail webhooks create -u "https://api.example.com/webhook" -e "campaign.sent,campaign.opened"
272
+ cakemail webhooks update <id> -u "https://new-url.com/webhook"
273
+
274
+ # Archive management
275
+ cakemail webhooks archive <id>
276
+ cakemail webhooks unarchive <id>
277
+ ```
278
+
279
+ **SDK Access:**
280
+ ```typescript
281
+ client.sdk.webhooks.create({
282
+ url: 'https://api.example.com/webhook',
283
+ events: ['campaign.sent', 'campaign.opened'],
284
+ secret: 'webhook_secret_key'
285
+ })
286
+ client.sdk.webhookService.getWebhook({ webhookId: 123 })
287
+ ```
288
+
289
+ **Webhook Security:**
290
+ - Use `--secret` option for signature verification
291
+ - Webhooks receive HMAC signatures for validation
292
+
293
+ ---
294
+
295
+ ### ✅ Email API v2 (3 commands) - CORE COMPLETE
296
+
297
+ **Transactional email operations:**
298
+
299
+ ```bash
300
+ # Send email
301
+ cakemail emails send \
302
+ -t user@example.com \
303
+ -s "Welcome!" \
304
+ --from-email "sender@example.com" \
305
+ --html-file email.html \
306
+ --tracking
307
+
308
+ # Or use template
309
+ cakemail emails send \
310
+ -t user@example.com \
311
+ -s "Welcome!" \
312
+ --template-id 123 \
313
+ --params '{"name":"John","code":"ABC123"}'
314
+
315
+ # Retrieve sent email
316
+ cakemail emails get <email-id>
317
+
318
+ # Render email HTML
319
+ cakemail emails render <email-id>
320
+ ```
321
+
322
+ **SDK Access:**
323
+ ```typescript
324
+ client.sdk.email.submit({
325
+ to: 'user@example.com',
326
+ subject: 'Welcome!',
327
+ template_id: 123,
328
+ params: { name: 'John' },
329
+ tracking: true,
330
+ tags: ['onboarding', 'welcome']
331
+ })
332
+ client.sdk.email.retrieve('email-id')
333
+ ```
334
+
335
+ **Available via SDK (not yet in CLI):**
336
+ - Email API logs and delivery status
337
+ - Tag-based email queries
338
+ - Batch email operations
339
+
340
+ ---
341
+
342
+ ## SDK Services Available (Not Yet in CLI)
343
+
344
+ The following SDK services provide 100% API access but don't have dedicated CLI commands yet. Use them directly via the SDK in your custom scripts.
345
+
346
+ ### 📊 High-Value Services (Planned v1.3-1.4)
347
+
348
+ #### ReportService
349
+ Campaign, list, and account analytics:
350
+ ```typescript
351
+ const report = await client.sdk.reportService.getCampaignReport({
352
+ campaignId: 123
353
+ });
354
+ const listStats = await client.sdk.reportService.getListStatistics({
355
+ listId: 456
356
+ });
357
+ ```
358
+
359
+ #### SegmentService
360
+ Contact segmentation and targeting:
361
+ ```typescript
362
+ const segments = await client.sdk.segmentService.listSegments({
363
+ listId: 123
364
+ });
365
+ const segment = await client.sdk.segmentService.createSegment({
366
+ requestBody: {
367
+ name: 'Active Users',
368
+ conditions: [...]
369
+ }
370
+ });
371
+ ```
372
+
373
+ #### CustomAttributeService
374
+ Custom field management:
375
+ ```typescript
376
+ const attributes = await client.sdk.customAttributeService.listAttributes();
377
+ const attr = await client.sdk.customAttributeService.createAttribute({
378
+ requestBody: {
379
+ name: 'company',
380
+ type: 'text'
381
+ }
382
+ });
383
+ ```
384
+
385
+ #### TagsService
386
+ Contact tagging system:
387
+ ```typescript
388
+ const tags = await client.sdk.tagsService.listTags({ listId: 123 });
389
+ await client.sdk.tagsService.tagContact({
390
+ contactId: 456,
391
+ requestBody: { tags: ['vip', 'enterprise'] }
392
+ });
393
+ ```
394
+
395
+ #### InterestService
396
+ Contact interest management:
397
+ ```typescript
398
+ const interests = await client.sdk.interestService.listInterests({
399
+ listId: 123
400
+ });
401
+ ```
402
+
403
+ ---
404
+
405
+ ### 🔧 Advanced Services (Planned v1.5+)
406
+
407
+ #### WorkflowService & ActionService
408
+ Automation workflows:
409
+ ```typescript
410
+ const workflows = await client.sdk.workflowService.listWorkflows({});
411
+ const actions = await client.sdk.actionService.listActions({
412
+ workflowId: 123
413
+ });
414
+ ```
415
+
416
+ #### FormService
417
+ Subscription forms:
418
+ ```typescript
419
+ const forms = await client.sdk.formService.listForms({ listId: 123 });
420
+ ```
421
+
422
+ #### SubAccountService
423
+ Multi-tenant operations:
424
+ ```typescript
425
+ const subAccounts = await client.sdk.subAccountService.listSubAccounts({});
426
+ ```
427
+
428
+ #### UserService
429
+ User management:
430
+ ```typescript
431
+ const users = await client.sdk.userService.listUsers({});
432
+ ```
433
+
434
+ #### DomainService & DkimService
435
+ Email authentication:
436
+ ```typescript
437
+ const domains = await client.sdk.domainService.listDomains({});
438
+ const dkim = await client.sdk.dkimService.getDkim({ domainId: 123 });
439
+ ```
440
+
441
+ ---
442
+
443
+ ### 🛠️ Supporting Services
444
+
445
+ Additional services available via SDK:
446
+
447
+ - **AccountService** - Account management and settings
448
+ - **SuppressedEmailService** - Suppression list management
449
+ - **SystemEmailService** - System email configuration
450
+ - **LinksService** - Link tracking and analytics
451
+ - **LogoService** - Brand logo management
452
+ - **TokenService** - Authentication token management
453
+ - **TransactionalEmailService** - Transactional template management
454
+ - **LogService** - Activity logs and audit trails
455
+ - **TaskService** - Async task monitoring
456
+ - **CampaignBlueprintService** - Campaign templates
457
+ - **WorkflowBlueprintService** - Workflow templates
458
+
459
+ ---
460
+
461
+ ## Using the SDK Directly
462
+
463
+ For operations not yet available as CLI commands, use the SDK directly in Node.js scripts:
464
+
465
+ ```typescript
466
+ import { CakemailClient } from '@cakemail-org/cakemail-sdk';
467
+
468
+ const client = new CakemailClient({
469
+ email: process.env.CAKEMAIL_EMAIL,
470
+ password: process.env.CAKEMAIL_PASSWORD
471
+ });
472
+
473
+ // Access any of the 28 SDK services
474
+ const report = await client.reportService.getCampaignReport({
475
+ campaignId: 123
476
+ });
477
+
478
+ const segments = await client.segmentService.listSegments({
479
+ listId: 456
480
+ });
481
+
482
+ const attributes = await client.customAttributeService.listAttributes();
483
+ ```
484
+
485
+ **Hybrid Approach:**
486
+ Use CLI for daily operations, SDK for advanced automation:
487
+ ```bash
488
+ #!/bin/bash
489
+ # Create campaign via CLI
490
+ CAMPAIGN_ID=$(cakemail campaigns create -n "Newsletter" -s "Weekly Update" --list-id 123 | jq -r '.id')
491
+
492
+ # Get analytics via SDK (custom script)
493
+ node get-analytics.js $CAMPAIGN_ID
494
+ ```
495
+
496
+ ---
497
+
498
+ ## Output Formats
499
+
500
+ All CLI commands support three output formats:
501
+
502
+ ### JSON (Default)
503
+ Full structured data, pipeable to other tools:
504
+ ```bash
505
+ cakemail campaigns list | jq '.data[] | select(.status=="active")'
506
+ ```
507
+
508
+ ### Table
509
+ Human-readable formatted table:
510
+ ```bash
511
+ cakemail -f table campaigns list
512
+ # ┌──────┬──────────────┬────────┬────────────┐
513
+ # │ ID │ Name │ Status │ Created │
514
+ # ├──────┼──────────────┼────────┼────────────┤
515
+ # │ 123 │ Newsletter │ active │ 2025-10-01 │
516
+ # └──────┴──────────────┴────────┴────────────┘
517
+ ```
518
+
519
+ ### Compact
520
+ One-line summaries for quick scanning:
521
+ ```bash
522
+ cakemail -f compact senders list
523
+ # 123 │ John Doe (verified)
524
+ # 456 │ Jane Smith (pending)
525
+ ```
526
+
527
+ **Configuration:**
528
+ ```bash
529
+ # Set default format
530
+ export CAKEMAIL_OUTPUT_FORMAT=compact
531
+
532
+ # Or in .env file
533
+ CAKEMAIL_OUTPUT_FORMAT=table
534
+
535
+ # Override per command
536
+ cakemail -f json campaigns list
537
+ ```
538
+
539
+ ---
540
+
541
+ ## Advanced Filtering and Sorting
542
+
543
+ All list commands support powerful filtering and sorting:
544
+
545
+ ### Sorting
546
+ ```bash
547
+ # Ascending
548
+ cakemail campaigns list --sort "+name"
549
+ cakemail lists list --sort "+created_on"
550
+
551
+ # Descending
552
+ cakemail campaigns list --sort "-created_on"
553
+ cakemail contacts list 123 --sort "-email"
554
+ ```
555
+
556
+ ### Filtering
557
+ ```bash
558
+ # Single condition
559
+ cakemail campaigns list --filter "status==active"
560
+
561
+ # Multiple conditions (semicolon-separated)
562
+ cakemail campaigns list --filter "status==active;name==Newsletter"
563
+
564
+ # Operators: ==, !=, >, <, >=, <=
565
+ cakemail campaigns list --filter "created_on>=2025-01-01"
566
+ ```
567
+
568
+ ### Pagination
569
+ ```bash
570
+ # Limit per page
571
+ cakemail campaigns list -l 50
572
+
573
+ # Specific page
574
+ cakemail campaigns list -l 50 -p 2
575
+
576
+ # Combine with filters
577
+ cakemail campaigns list --status active -l 100 --sort "-created_on"
578
+ ```
579
+
580
+ ---
581
+
582
+ ## Coverage Expansion Plan
583
+
584
+ ### 🔴 CRITICAL Priority (v1.3) - Q4 2025
585
+ **Target: +50 commands (56 → 106 commands, 24% → 46% coverage)**
586
+
587
+ These features are essential for daily operations and analytics:
588
+
589
+ #### Reports (18 new commands)
590
+ ```bash
591
+ # Campaign analytics
592
+ cakemail reports campaign <id> # Full campaign stats
593
+ cakemail reports campaign <id> --links # Link click analytics
594
+ cakemail reports campaign <id> --export # Export campaign report
595
+
596
+ # List analytics
597
+ cakemail reports list <id> # List growth and engagement stats
598
+
599
+ # Account analytics
600
+ cakemail reports account # Account-wide statistics
601
+
602
+ # Email API analytics
603
+ cakemail reports emails # Email API statistics
604
+ cakemail reports emails-summary # Daily/weekly summary
605
+
606
+ # Export operations
607
+ cakemail reports export-campaigns # Bulk campaign reports
608
+ cakemail reports export-suppressed # Suppression list export
609
+ ```
610
+
611
+ **Business Impact:** Critical for measuring campaign effectiveness, ROI calculation, and decision-making.
612
+
613
+ #### Contact Import/Export (6 new commands)
614
+ ```bash
615
+ # Import contacts
616
+ cakemail contacts import <list-id> --file contacts.csv
617
+ cakemail contacts import <list-id> --file contacts.json --update-existing
618
+
619
+ # Export contacts
620
+ cakemail contacts export <list-id>
621
+ cakemail contacts export <list-id> --status subscribed --format csv
622
+ cakemail contacts export <list-id> --download export-123
623
+
624
+ # List and manage exports
625
+ cakemail contacts exports <list-id>
626
+ cakemail contacts export-delete <list-id> <export-id>
627
+ ```
628
+
629
+ **Business Impact:** Essential for data migration, backups, and list hygiene.
630
+
631
+ #### Segments (5 new commands)
632
+ ```bash
633
+ # Segment management
634
+ cakemail segments list <list-id>
635
+ cakemail segments get <list-id> <segment-id>
636
+ cakemail segments create <list-id> --name "Active Users" --conditions '...'
637
+ cakemail segments update <list-id> <segment-id>
638
+ cakemail segments delete <list-id> <segment-id>
639
+ cakemail segments contacts <list-id> <segment-id> # View segment members
640
+ ```
641
+
642
+ **Business Impact:** Enables targeted campaigns and advanced audience segmentation.
643
+
644
+ #### Custom Attributes (3 new commands)
645
+ ```bash
646
+ # Custom field management
647
+ cakemail attributes list <list-id>
648
+ cakemail attributes create <list-id> --name company --type text
649
+ cakemail attributes delete <list-id> <attribute-name>
650
+ ```
651
+
652
+ **Business Impact:** Customization and personalization capabilities.
653
+
654
+ #### Suppression List (6 new commands)
655
+ ```bash
656
+ # Suppression management
657
+ cakemail suppressed list
658
+ cakemail suppressed add user@example.com
659
+ cakemail suppressed delete user@example.com
660
+ cakemail suppressed export
661
+ cakemail suppressed download <export-id>
662
+ ```
663
+
664
+ **Business Impact:** Compliance (GDPR, CAN-SPAM) and deliverability management.
665
+
666
+ #### Extended List Operations (7 new commands)
667
+ ```bash
668
+ # List lifecycle
669
+ cakemail lists update <id> --name "New Name"
670
+ cakemail lists archive <id>
671
+ cakemail lists accept-policy <id>
672
+ cakemail lists stats <id>
673
+
674
+ # Subscription forms
675
+ cakemail lists forms <id>
676
+ cakemail lists form-create <id> --url "/subscribe"
677
+ cakemail lists form-delete <id> <form-id>
678
+ ```
679
+
680
+ **Business Impact:** Complete list management capabilities.
681
+
682
+ #### Email API Extended (5 new commands)
683
+ ```bash
684
+ # Email API logs and analytics
685
+ cakemail emails logs
686
+ cakemail emails logs --tag newsletter --status delivered
687
+ cakemail emails stats
688
+ cakemail emails tags list
689
+ cakemail emails summary
690
+ ```
691
+
692
+ **Business Impact:** Transactional email monitoring and troubleshooting.
693
+
694
+ ---
695
+
696
+ ### 🟡 HIGH Priority (v1.4) - Q1 2026
697
+ **Target: +34 commands (106 → 140 commands, 46% → 60% coverage)**
698
+
699
+ Efficiency and scale features:
700
+
701
+ #### Tags (5 new commands)
702
+ ```bash
703
+ cakemail tags list
704
+ cakemail tags create --name vip
705
+ cakemail tags delete <tag>
706
+ cakemail contacts tag <list-id> <contact-id> --tags "vip,premium"
707
+ cakemail contacts untag <list-id> <contact-id> --tags "trial"
708
+ cakemail contacts tag-bulk <list-id> --contacts "1,2,3" --tags "segment-a"
709
+ ```
710
+
711
+ #### Interests (5 new commands)
712
+ ```bash
713
+ cakemail interests list <list-id>
714
+ cakemail interests create <list-id> --name "Product Updates"
715
+ cakemail interests delete <list-id> <interest-name>
716
+ cakemail contacts add-interests <list-id> <contact-id> --interests "updates,news"
717
+ cakemail contacts remove-interests <list-id> <contact-id> --interests "promotions"
718
+ ```
719
+
720
+ #### Transactional Email Templates (9 new commands)
721
+ ```bash
722
+ cakemail transactional-templates list <list-id>
723
+ cakemail transactional-templates create <list-id> --name "Order Confirmation"
724
+ cakemail transactional-templates update <list-id> <template-id>
725
+ cakemail transactional-templates delete <list-id> <template-id>
726
+ cakemail transactional-templates send <list-id> <template-id> --contact <id>
727
+ cakemail transactional-templates test <list-id> <template-id> --email test@ex.com
728
+ cakemail transactional-templates render <list-id> <template-id>
729
+ ```
730
+
731
+ #### Campaign Logs (5 new commands)
732
+ ```bash
733
+ cakemail logs campaign <id>
734
+ cakemail logs campaign <id> --export
735
+ cakemail logs campaign <id> --download <export-id>
736
+ cakemail logs list <id>
737
+ cakemail logs list <id> --export
738
+ ```
739
+
740
+ #### Campaign Enhancements (3 new commands)
741
+ ```bash
742
+ cakemail campaigns render <id> # Preview campaign HTML
743
+ cakemail campaigns revisions <id> # View campaign history
744
+ cakemail campaigns blueprint <id> # Use campaign blueprint
745
+ ```
746
+
747
+ ---
748
+
749
+ ### 🟢 MEDIUM Priority (v1.5+) - Q2-Q3 2026
750
+ **Target: +40 commands (140 → 180+ commands, 60% → 78%+ coverage)**
751
+
752
+ Advanced and enterprise features:
753
+
754
+ #### Workflows (18 commands)
755
+ ```bash
756
+ # Workflow management
757
+ cakemail workflows list
758
+ cakemail workflows create --name "Welcome Series"
759
+ cakemail workflows update <id>
760
+ cakemail workflows delete <id>
761
+ cakemail workflows activate <id>
762
+ cakemail workflows deactivate <id>
763
+ cakemail workflows lock <id>
764
+ cakemail workflows unlock <id>
765
+
766
+ # Workflow actions
767
+ cakemail workflows actions <workflow-id>
768
+ cakemail workflows action-create <workflow-id>
769
+ cakemail workflows action-update <workflow-id> <action-id>
770
+ cakemail workflows action-delete <workflow-id> <action-id>
771
+ cakemail workflows action-test <workflow-id> <action-id>
772
+
773
+ # Workflow analytics
774
+ cakemail workflows report <workflow-id> <action-id>
775
+ cakemail workflows logs <workflow-id> <action-id>
776
+ ```
777
+
778
+ #### Account & User Management (13 commands)
779
+ ```bash
780
+ # Account management
781
+ cakemail account show
782
+ cakemail account update
783
+ cakemail account convert-to-org
784
+
785
+ # Sub-accounts
786
+ cakemail sub-accounts list
787
+ cakemail sub-accounts create
788
+ cakemail sub-accounts suspend <id>
789
+
790
+ # Users
791
+ cakemail users list
792
+ cakemail users create
793
+ cakemail users update <id>
794
+ cakemail users delete <id>
795
+ ```
796
+
797
+ #### Domain & DKIM (7 commands)
798
+ ```bash
799
+ cakemail domains show
800
+ cakemail domains update
801
+ cakemail domains validate
802
+ cakemail dkim list
803
+ cakemail dkim create --domain example.com
804
+ cakemail dkim delete <id>
805
+ ```
806
+
807
+ ---
808
+
809
+ ## Roadmap
810
+
811
+ ### ✅ Phase 1: Foundation (v0.1-v1.0) - COMPLETE
812
+ - Core CRUD operations for campaigns, lists, contacts
813
+ - Multiple output formats
814
+ - Authentication and configuration
815
+ - Error handling and help system
816
+
817
+ ### ✅ Phase 2: SDK Migration (v1.0-v1.2) - COMPLETE
818
+ - Full migration to @cakemail-org/cakemail-sdk
819
+ - 100% SDK coverage available
820
+ - All commands using SDK services
821
+ - Package rename to @cakemail-org/cakemail-cli
822
+ - Homebrew distribution
823
+
824
+ ### 🎯 Phase 3: Analytics & Data Operations (v1.3) - Q4 2025
825
+ **+50 commands: 56 → 106 (24% → 46% coverage)**
826
+ - ✅ **Reports** (18 commands) - Campaign/list/email analytics
827
+ - ✅ **Contact Import/Export** (6 commands) - Bulk data operations
828
+ - ✅ **Segments** (5 commands) - Audience segmentation
829
+ - ✅ **Custom Attributes** (3 commands) - Custom fields
830
+ - ✅ **Suppression List** (6 commands) - Compliance management
831
+ - ✅ **Extended Lists** (7 commands) - Complete list lifecycle
832
+ - ✅ **Extended Email API** (5 commands) - Transactional monitoring
833
+
834
+ ### 🎯 Phase 4: Scale & Efficiency (v1.4) - Q1 2026
835
+ **+34 commands: 106 → 140 (46% → 60% coverage)**
836
+ - ✅ **Tags** (5 commands) - Contact organization
837
+ - ✅ **Interests** (5 commands) - Preference management
838
+ - ✅ **Transactional Templates** (9 commands) - Template management
839
+ - ✅ **Campaign Logs** (5 commands) - Activity tracking
840
+ - ✅ **Campaign Enhancements** (3 commands) - Advanced features
841
+ - ✅ **Bulk Operations** - Tag/interest bulk updates
842
+ - ✅ **Advanced Filtering** - Complex queries
843
+
844
+ ### 🎯 Phase 5: Enterprise & Automation (v1.5+) - Q2-Q3 2026
845
+ **+40+ commands: 140 → 180+ (60% → 78%+ coverage)**
846
+ - ✅ **Workflows** (18 commands) - Marketing automation
847
+ - ✅ **Account Management** (13 commands) - Multi-tenant operations
848
+ - ✅ **Domain & DKIM** (7 commands) - Email authentication
849
+ - ✅ **Forms** (5 commands) - Subscription forms
850
+ - ✅ **Tasks** (3 commands) - Async operations
851
+ - ✅ **Advanced Security** - MFA, permissions
852
+
853
+ ---
854
+
855
+ ## Priority Matrix for Development
856
+
857
+ Feature prioritization is based on **Impact × Frequency** scoring:
858
+
859
+ | Feature Category | Impact | Frequency | Score | Priority | Version |
860
+ |-----------------|--------|-----------|-------|----------|---------|
861
+ | **Reports - Campaign Analytics** | 10 | 9 | 90 | 🔴 CRITICAL | v1.3 |
862
+ | **Contact Import/Export** | 9 | 8 | 72 | 🔴 CRITICAL | v1.3 |
863
+ | **Segments** | 9 | 7 | 63 | 🔴 CRITICAL | v1.3 |
864
+ | **Suppression List** | 8 | 7 | 56 | 🟡 HIGH | v1.3 |
865
+ | **Reports - Email API** | 7 | 8 | 56 | 🟡 HIGH | v1.3 |
866
+ | **Custom Attributes** | 7 | 7 | 49 | 🟡 HIGH | v1.3 |
867
+ | **Extended Lists** | 6 | 8 | 48 | 🟡 HIGH | v1.3 |
868
+ | **Tags** | 7 | 6 | 42 | 🟡 HIGH | v1.4 |
869
+ | **Transactional Templates** | 7 | 6 | 42 | 🟡 HIGH | v1.4 |
870
+ | **Interests** | 6 | 6 | 36 | 🟢 MEDIUM | v1.4 |
871
+ | **Campaign Logs** | 6 | 5 | 30 | 🟢 MEDIUM | v1.4 |
872
+ | **Workflows** | 8 | 3 | 24 | 🟢 MEDIUM | v1.5 |
873
+ | **Domain & DKIM** | 7 | 3 | 21 | 🟢 MEDIUM | v1.5 |
874
+ | **Account Management** | 5 | 4 | 20 | ⚪ LOW | v1.5 |
875
+ | **User Management** | 4 | 3 | 12 | ⚪ LOW | v1.5 |
876
+ | **Forms** | 3 | 3 | 9 | ⚪ LOW | v1.5+ |
877
+
878
+ **Scoring Criteria:**
879
+ - **Impact**: 1-10 (how much time/value does this provide?)
880
+ - **Frequency**: 1-10 (how often is this operation performed?)
881
+ - **Score**: Impact × Frequency
882
+ - **CRITICAL** (>60): Essential for daily operations
883
+ - **HIGH** (40-60): Important for efficiency
884
+ - **MEDIUM** (20-39): Valuable for advanced users
885
+ - **LOW** (<20): Nice-to-have or specialized
886
+
887
+ ---
888
+
889
+ ## Design Philosophy
890
+
891
+ The CLI prioritizes:
892
+
893
+ 1. **Developer Experience**: Simple, intuitive commands with excellent error messages
894
+ 2. **High-Value Operations**: Features used daily by developers and marketers
895
+ 3. **SDK Foundation**: Built on official SDK for reliability and maintainability
896
+ 4. **Progressive Enhancement**: Core features via CLI, advanced features via SDK
897
+ 5. **Composability**: Commands designed to work with pipes, scripts, and other tools
898
+ 6. **Data-Driven Decisions**: Priority based on impact × frequency analysis
899
+
900
+ **80/20 Rule**: The CLI implements 20% of operations that satisfy 80% of use cases. The SDK provides the remaining 80% for specialized needs.
901
+
902
+ **Coverage Strategy**:
903
+ - v1.3 targets 46% coverage (106/232) by adding the highest-impact analytics and data operations
904
+ - v1.4 targets 60% coverage (140/232) by adding efficiency and scale features
905
+ - v1.5+ targets 78%+ coverage (180+/232) by adding enterprise and automation features
906
+
907
+ ---
908
+
909
+ ## Command Prioritization Criteria
910
+
911
+ New CLI commands are prioritized based on:
912
+
913
+ 1. **Frequency**: How often is this operation performed?
914
+ 2. **Impact**: How much time does this save vs web interface?
915
+ 3. **Automation**: Is this operation needed in CI/CD pipelines?
916
+ 4. **Complexity**: How much does the CLI simplify the operation?
917
+ 5. **Demand**: How many customers have requested this?
918
+
919
+ **Request a Feature**: Open an issue at [github.com/cakemail/cakemail-cli](https://github.com/cakemail/cakemail-cli)
920
+
921
+ ---
922
+
923
+ ## Authentication
924
+
925
+ The CLI supports two authentication methods:
926
+
927
+ ```bash
928
+ # Method 1: Email/Password (OAuth2)
929
+ export CAKEMAIL_EMAIL=your@email.com
930
+ export CAKEMAIL_PASSWORD=your_password
931
+
932
+ # Method 2: Access Token (for CI/CD)
933
+ export CAKEMAIL_ACCESS_TOKEN=your_token
934
+
935
+ # Or use .env file
936
+ echo "CAKEMAIL_EMAIL=your@email.com" > .env
937
+ echo "CAKEMAIL_PASSWORD=your_password" >> .env
938
+ ```
939
+
940
+ The SDK handles OAuth2 token management, refresh, and expiration automatically.
941
+
942
+ ---
943
+
944
+ ## CI/CD Integration
945
+
946
+ The CLI is designed for automation:
947
+
948
+ **GitHub Actions Example:**
949
+ ```yaml
950
+ - name: Deploy Campaign
951
+ env:
952
+ CAKEMAIL_EMAIL: ${{ secrets.CAKEMAIL_EMAIL }}
953
+ CAKEMAIL_PASSWORD: ${{ secrets.CAKEMAIL_PASSWORD }}
954
+ run: |
955
+ npm install -g @cakemail-org/cakemail-cli
956
+ CAMPAIGN_ID=$(cakemail campaigns create -n "Release ${{ github.ref }}" | jq -r '.id')
957
+ cakemail campaigns schedule $CAMPAIGN_ID --date "2025-12-01T10:00:00Z"
958
+ ```
959
+
960
+ **Features for Automation:**
961
+ - JSON output for parsing
962
+ - Correct exit codes (0=success, 1=error)
963
+ - Environment variable authentication
964
+ - Deterministic, scriptable commands
965
+
966
+ ---
967
+
968
+ ---
969
+
970
+ ## Summary & Next Steps
971
+
972
+ ### Current State (v1.2.0)
973
+ - ✅ **56 commands implemented** (24% coverage)
974
+ - ✅ **Core workflows complete**: Campaigns, templates, contacts, senders, webhooks, email sending
975
+ - ✅ **Solid foundation**: SDK-based, 3 output formats, Homebrew distribution
976
+ - ❌ **Missing critical features**: Analytics, reporting, bulk operations, segmentation
977
+
978
+ ### Gap Analysis
979
+ **Coverage by Criticality:**
980
+ - 🔴 **CRITICAL gaps** (3 features): Reports, Import/Export, Segments → **50 missing commands**
981
+ - 🟡 **HIGH gaps** (4 features): Suppression, Custom Attributes, Extended Lists, Email API logs → **21 missing commands**
982
+ - 🟢 **MEDIUM gaps** (8 features): Tags, Interests, Workflows, etc. → **74 missing commands**
983
+ - ⚪ **LOW gaps** (10 features): Account, Users, Forms, etc. → **31 missing commands**
984
+
985
+ **Total opportunity:** 176 additional commands to reach 78%+ coverage
986
+
987
+ ### Immediate Actions for v1.3 (Q4 2025)
988
+
989
+ **Phase 1: Reports (Weeks 1-2)**
990
+ 1. Implement campaign analytics commands (6 commands)
991
+ 2. Implement list analytics commands (3 commands)
992
+ 3. Implement email API analytics (4 commands)
993
+ 4. Add report export capabilities (5 commands)
994
+
995
+ **Phase 2: Contact Operations (Weeks 3-4)**
996
+ 1. Implement contact import with CSV/JSON support (2 commands)
997
+ 2. Implement contact export with filtering (4 commands)
998
+ 3. Add bulk tag operations (4 commands)
999
+
1000
+ **Phase 3: Segmentation (Weeks 5-6)**
1001
+ 1. Implement segment CRUD operations (5 commands)
1002
+ 2. Add segment contact listing (1 command)
1003
+ 3. Integrate segments with campaign creation
1004
+
1005
+ **Phase 4: Supporting Features (Weeks 7-8)**
1006
+ 1. Custom attributes management (3 commands)
1007
+ 2. Suppression list operations (6 commands)
1008
+ 3. Extended list operations (7 commands)
1009
+ 4. Extended email API (5 commands)
1010
+
1011
+ **Total:** 50 new commands over 8 weeks
1012
+
1013
+ ### Success Metrics for v1.3
1014
+ - **Coverage**: 24% → 46% (double current coverage)
1015
+ - **User satisfaction**: Enable analytics workflows (most-requested feature)
1016
+ - **Data portability**: Enable import/export workflows
1017
+ - **Compliance**: Full suppression list management
1018
+ - **Targeting**: Enable segment-based campaigns
1019
+
1020
+ ### Developer Effort Estimate
1021
+
1022
+ **v1.3 Complexity Analysis:**
1023
+ - **Low complexity** (30 commands): CRUD operations leveraging existing patterns
1024
+ - **Medium complexity** (15 commands): File uploads, CSV parsing, export downloads
1025
+ - **High complexity** (5 commands): Complex filtering, bulk operations, async tasks
1026
+
1027
+ **Estimated effort:** 6-8 weeks full-time development
1028
+ - Week 1-2: Reports (leverage existing formatters)
1029
+ - Week 3-4: Import/Export (CSV parsing, file handling)
1030
+ - Week 5-6: Segments (new entity, similar to lists)
1031
+ - Week 7-8: Supporting features (straightforward CRUD)
1032
+
1033
+ ### Risk Mitigation
1034
+ - **API Changes**: All commands use official SDK (stable interface)
1035
+ - **Breaking Changes**: New commands only, no modifications to existing
1036
+ - **Testing**: Each command group tested independently
1037
+ - **Rollback**: Commands can be feature-flagged if needed
1038
+
1039
+ ---
1040
+
1041
+ *Last Updated: 2025-10-10*
1042
+ *CLI Version: 1.2.0*
1043
+ *Package: @cakemail-org/cakemail-cli*
1044
+ *SDK Version: @cakemail-org/cakemail-sdk v2.0.0 (232 operations, 28 services)*
1045
+ *Coverage Analysis: 56/232 commands (24%) with strategic expansion to 180+/232 (78%+) over 3 releases*