@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,287 @@
1
+ # Profile System Implementation - Task Tracker
2
+
3
+ **Status:** Planning
4
+ **Started:** 2025-10-11
5
+ **Target Completion:** TBD
6
+
7
+ ---
8
+
9
+ ## Phase 1: Foundation (2 weeks)
10
+
11
+ ### Week 1
12
+
13
+ - [ ] **Task 1.1:** Create profile schema and types
14
+ - File: `src/types/profile.ts`
15
+ - Define ProfileType, ProfileConfig interfaces
16
+ - Define default profiles (developer, marketer, balanced)
17
+ - Estimated: 2 hours
18
+
19
+ - [ ] **Task 1.2:** Implement config file storage
20
+ - File: `src/utils/config-file.ts`
21
+ - Create `~/.cakemail/config.json` management
22
+ - Load, save, merge config
23
+ - Handle migration from `.env`
24
+ - Estimated: 4 hours
25
+
26
+ - [ ] **Task 1.3:** Add profile selection to auth setup
27
+ - File: `src/commands/auth.ts`
28
+ - Add profile selection prompts
29
+ - Save selected profile to config
30
+ - Estimated: 3 hours
31
+
32
+ ### Week 2
33
+
34
+ - [ ] **Task 1.4:** Create profile loading mechanism
35
+ - File: `src/utils/config.ts`
36
+ - Load profile from config file
37
+ - Apply profile defaults
38
+ - Handle priority order (flags > custom > profile > defaults)
39
+ - Estimated: 4 hours
40
+
41
+ - [ ] **Task 1.5:** Add profile management commands
42
+ - File: `src/commands/config.ts`
43
+ - `config profile` - Show current profile
44
+ - `config profile <type>` - Switch profile
45
+ - `config set <key> <value>` - Override setting
46
+ - `config reset` - Reset to profile defaults
47
+ - Estimated: 4 hours
48
+
49
+ - [ ] **Task 1.6:** Update getConfig() to support profiles
50
+ - File: `src/utils/config.ts`
51
+ - Integrate profile loading with existing config
52
+ - Ensure backward compatibility with `.env`
53
+ - Estimated: 3 hours
54
+
55
+ - [ ] **Task 1.7:** Testing & Documentation
56
+ - Write unit tests for profile loading
57
+ - Test migration from `.env` to config.json
58
+ - Update README with profile info
59
+ - Estimated: 4 hours
60
+
61
+ **Phase 1 Total:** ~24 hours
62
+
63
+ ---
64
+
65
+ ## Phase 2: Output Adaptation (3 weeks)
66
+
67
+ ### Week 3
68
+
69
+ - [ ] **Task 2.1:** Profile-aware output formatter
70
+ - File: `src/utils/output.ts`
71
+ - Accept profile config in constructor
72
+ - Apply format based on profile.output.format
73
+ - Apply color scheme based on profile.output.colors
74
+ - Estimated: 4 hours
75
+
76
+ - [ ] **Task 2.2:** Implement color schemes
77
+ - Add "minimal" color scheme (developer)
78
+ - Add "rich" color scheme (marketer) - already have most of this
79
+ - Add "moderate" color scheme (balanced)
80
+ - Estimated: 3 hours
81
+
82
+ - [ ] **Task 2.3:** Profile-specific date formatting
83
+ - ISO 8601 for developer
84
+ - Relative dates for marketer (already implemented)
85
+ - Friendly dates for balanced
86
+ - Estimated: 2 hours
87
+
88
+ ### Week 4
89
+
90
+ - [ ] **Task 2.4:** Profile-aware error messages
91
+ - File: `src/utils/errors.ts`
92
+ - Technical errors for developer (with API details)
93
+ - Friendly errors for marketer (with guidance)
94
+ - Balanced for balanced profile
95
+ - Estimated: 5 hours
96
+
97
+ - [ ] **Task 2.5:** Tips and hints system
98
+ - Show tips for marketer profile
99
+ - Hide tips for developer profile
100
+ - Contextual tips based on command
101
+ - Estimated: 3 hours
102
+
103
+ - [ ] **Task 2.6:** Profile-aware help system
104
+ - Different help text per profile
105
+ - Technical examples for developers
106
+ - Interactive examples for marketers
107
+ - Estimated: 6 hours
108
+
109
+ ### Week 5
110
+
111
+ - [ ] **Task 2.7:** Update all commands to use profile-aware output
112
+ - Update formatter initialization in cli.ts
113
+ - Test each command with different profiles
114
+ - Ensure consistent experience
115
+ - Estimated: 6 hours
116
+
117
+ - [ ] **Task 2.8:** Testing & Documentation
118
+ - Test output with each profile
119
+ - Visual regression testing
120
+ - Update docs with examples
121
+ - Estimated: 4 hours
122
+
123
+ **Phase 2 Total:** ~33 hours
124
+
125
+ ---
126
+
127
+ ## Phase 3: Behavior Adaptation (3 weeks)
128
+
129
+ ### Week 6
130
+
131
+ - [ ] **Task 3.1:** Interactive prompt system
132
+ - File: `src/utils/interactive.ts`
133
+ - Wrapper around inquirer
134
+ - Profile-aware (only prompt if profile.behavior.interactive_prompts)
135
+ - Handle missing required arguments
136
+ - Estimated: 5 hours
137
+
138
+ - [ ] **Task 3.2:** Make confirmations profile-aware
139
+ - File: `src/utils/confirm.ts`
140
+ - Check profile.behavior.confirm_destructive
141
+ - Auto-skip for developer profile
142
+ - Always show for marketer profile
143
+ - Estimated: 2 hours
144
+
145
+ - [ ] **Task 3.3:** Add interactive prompts to campaigns create
146
+ - Prompt for missing required fields
147
+ - Show list selection with details
148
+ - Show sender selection
149
+ - Preview before creation
150
+ - Estimated: 5 hours
151
+
152
+ ### Week 7
153
+
154
+ - [ ] **Task 3.4:** Add interactive prompts to more commands
155
+ - lists create
156
+ - contacts add
157
+ - templates create
158
+ - senders create
159
+ - Estimated: 6 hours
160
+
161
+ - [ ] **Task 3.5:** Progress indicators profile awareness
162
+ - File: `src/utils/progress.ts`
163
+ - Show for marketer/balanced
164
+ - Hide for developer (or only with --verbose)
165
+ - Estimated: 2 hours
166
+
167
+ - [ ] **Task 3.6:** Scripting mode detection
168
+ - Detect piped output (!stdout.isTTY)
169
+ - Detect CI environment
170
+ - Auto-disable interactivity when detected
171
+ - Estimated: 3 hours
172
+
173
+ ### Week 8
174
+
175
+ - [ ] **Task 3.7:** Testing interactive mode
176
+ - Test prompts with each profile
177
+ - Test scripting mode detection
178
+ - Test backward compatibility
179
+ - Estimated: 5 hours
180
+
181
+ - [ ] **Task 3.8:** Documentation
182
+ - Interactive mode examples
183
+ - Scripting examples per profile
184
+ - Estimated: 3 hours
185
+
186
+ **Phase 3 Total:** ~31 hours
187
+
188
+ ---
189
+
190
+ ## Phase 4: Polish & Testing (2 weeks)
191
+
192
+ ### Week 9
193
+
194
+ - [ ] **Task 4.1:** Add --profile override flag
195
+ - File: `src/cli.ts`
196
+ - Parse --profile flag globally
197
+ - Override config.profile temporarily
198
+ - Estimated: 2 hours
199
+
200
+ - [ ] **Task 4.2:** Add --batch flag
201
+ - Disable all interactivity
202
+ - Useful for marketer scripting
203
+ - Estimated: 1 hour
204
+
205
+ - [ ] **Task 4.3:** Profile preview command
206
+ - `config profile preview <type>`
207
+ - Show example output for each command
208
+ - Estimated: 3 hours
209
+
210
+ - [ ] **Task 4.4:** Migration for existing users
211
+ - Detect first run after profile update
212
+ - Prompt for profile selection
213
+ - Migrate .env to config.json
214
+ - Estimated: 4 hours
215
+
216
+ ### Week 10
217
+
218
+ - [ ] **Task 4.5:** Comprehensive testing
219
+ - Unit tests for all profile logic
220
+ - Integration tests for each profile
221
+ - Test migration paths
222
+ - Test backward compatibility
223
+ - Estimated: 8 hours
224
+
225
+ - [ ] **Task 4.6:** Documentation overhaul
226
+ - Update README with profile system
227
+ - Add profile selection guide
228
+ - Add examples per profile
229
+ - Update CHANGELOG
230
+ - Estimated: 4 hours
231
+
232
+ - [ ] **Task 4.7:** Beta testing preparation
233
+ - Create beta branch
234
+ - Write beta testing guide
235
+ - Recruit beta testers
236
+ - Estimated: 2 hours
237
+
238
+ **Phase 4 Total:** ~24 hours
239
+
240
+ ---
241
+
242
+ ## Beta Testing (2-3 weeks)
243
+
244
+ - [ ] Beta test with 2-3 developers
245
+ - [ ] Beta test with 2-3 marketers
246
+ - [ ] Collect feedback
247
+ - [ ] Iterate on issues
248
+ - [ ] Polish rough edges
249
+
250
+ ---
251
+
252
+ ## Release
253
+
254
+ - [ ] Final testing
255
+ - [ ] Update version to 1.5.0
256
+ - [ ] Publish to npm
257
+ - [ ] Update Homebrew formula
258
+ - [ ] Announce release
259
+ - [ ] Monitor for issues
260
+
261
+ ---
262
+
263
+ ## Total Estimated Time
264
+
265
+ - Phase 1: 24 hours (~3 days)
266
+ - Phase 2: 33 hours (~4 days)
267
+ - Phase 3: 31 hours (~4 days)
268
+ - Phase 4: 24 hours (~3 days)
269
+ - **Total: ~112 hours (~14 working days)**
270
+ - **With buffer: ~3 weeks of full-time work**
271
+
272
+ ---
273
+
274
+ ## Notes
275
+
276
+ - This tracker uses simple markdown checkboxes
277
+ - Update dates as you complete tasks
278
+ - Add notes inline as needed
279
+ - No external tools required
280
+ - Easy to grep and track progress
281
+
282
+ ---
283
+
284
+ ## Completed Tasks
285
+
286
+ [Move completed tasks here as you finish them]
287
+