@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,958 @@
1
+ # List Commands
2
+
3
+ Manage contact lists, including creation, updates, archiving, and subscription form endpoints.
4
+
5
+ ## Overview
6
+
7
+ List commands allow you to:
8
+ - Create and manage contact lists
9
+ - List all lists with filtering and sorting
10
+ - Archive lists instead of deleting them
11
+ - Manage subscription form endpoints for list signup
12
+ - Accept policy requirements for lists
13
+
14
+ Lists are the primary organizational structure for contacts in Cakemail. Each list can have its own interests, segments, and subscription forms.
15
+
16
+ ## Commands
17
+
18
+ - [lists list](#lists-list) - List all contact lists
19
+ - [lists get](#lists-get) - Get list details
20
+ - [lists create](#lists-create) - Create a new list
21
+ - [lists update](#lists-update) - Update list information
22
+ - [lists delete](#lists-delete) - Delete a list permanently
23
+ - [lists archive](#lists-archive) - Archive a list
24
+ - [lists accept-policy](#lists-accept-policy) - Accept policy for list
25
+ - [lists forms](#lists-forms) - List subscription form endpoints
26
+ - [lists form-create](#lists-form-create) - Create subscription form
27
+ - [lists form-delete](#lists-form-delete) - Delete subscription form
28
+
29
+ ---
30
+
31
+ ## lists list
32
+
33
+ List all contact lists in your account with optional filtering and sorting.
34
+
35
+ ### Usage
36
+
37
+ ```bash
38
+ cakemail lists list [options]
39
+ ```
40
+
41
+ ### Options
42
+
43
+ - `-l, --limit <number>` - Limit number of results per page
44
+ - `-p, --page <number>` - Page number (default: 1)
45
+ - `--sort <sort>` - Sort order (e.g., `+name`, `-created_on`)
46
+ - `--filter <filter>` - Filter expression (e.g., `status==active;name==Newsletter`)
47
+
48
+ ### Examples
49
+
50
+ **List all lists:**
51
+
52
+ ```bash
53
+ $ cakemail lists list
54
+ ```
55
+
56
+ **Output:**
57
+ ```
58
+ ┌────────┬─────────────────────┬────────────┬───────────┬─────────────────────┐
59
+ │ ID │ Name │ Contacts │ Language │ Created │
60
+ ├────────┼─────────────────────┼────────────┼───────────┼─────────────────────┤
61
+ │ 123 │ Newsletter Sub... │ 1,234 │ en │ 2024-01-15 10:30:00 │
62
+ │ 124 │ Product Updates │ 856 │ en │ 2024-02-20 14:15:00 │
63
+ │ 125 │ VIP Customers │ 45 │ fr │ 2024-03-01 09:00:00 │
64
+ └────────┴─────────────────────┴────────────┴───────────┴─────────────────────┘
65
+ ```
66
+
67
+ **Filter active lists:**
68
+
69
+ ```bash
70
+ $ cakemail lists list --filter "status==active"
71
+ ```
72
+
73
+ **Sort by name (ascending):**
74
+
75
+ ```bash
76
+ $ cakemail lists list --sort "+name"
77
+ ```
78
+
79
+ **Output:**
80
+ ```
81
+ ┌────────┬─────────────────────┬────────────┬───────────┐
82
+ │ ID │ Name │ Contacts │ Language │
83
+ ├────────┼─────────────────────┼────────────┼───────────┤
84
+ │ 123 │ Newsletter Sub... │ 1,234 │ en │
85
+ │ 124 │ Product Updates │ 856 │ en │
86
+ │ 125 │ VIP Customers │ 45 │ fr │
87
+ └────────┴─────────────────────┴────────────┴───────────┘
88
+ ```
89
+
90
+ **Sort by most recently created:**
91
+
92
+ ```bash
93
+ $ cakemail lists list --sort "-created_on" -l 5
94
+ ```
95
+
96
+ **List in JSON format for automation:**
97
+
98
+ ```bash
99
+ $ cakemail lists list -f json | jq '.data[] | {id, name, contacts: .contact_count}'
100
+ ```
101
+
102
+ **Output:**
103
+ ```json
104
+ {"id": 123, "name": "Newsletter Subscribers", "contacts": 1234}
105
+ {"id": 124, "name": "Product Updates", "contacts": 856}
106
+ {"id": 125, "name": "VIP Customers", "contacts": 45}
107
+ ```
108
+
109
+ ### Notes
110
+
111
+ - Default sort order is by creation date (newest first)
112
+ - Filter syntax: `field==value` with semicolons for multiple filters
113
+ - Sort accepts `+` (ascending) or `-` (descending) prefix
114
+ - Common filter fields: `status`, `name`, `language`
115
+ - Use `--limit` for pagination control
116
+
117
+ ### Related Commands
118
+
119
+ - [lists get](#lists-get) - View detailed list information
120
+ - [lists create](#lists-create) - Create a new list
121
+ - [contacts list](/en/cli/command-reference/contacts#contacts-list) - View contacts in a list
122
+
123
+ ---
124
+
125
+ ## lists get
126
+
127
+ Get detailed information about a specific list.
128
+
129
+ ### Usage
130
+
131
+ ```bash
132
+ cakemail lists get <id>
133
+ ```
134
+
135
+ ### Arguments
136
+
137
+ - `id` - List ID (required)
138
+
139
+ ### Examples
140
+
141
+ **Get list details:**
142
+
143
+ ```bash
144
+ $ cakemail lists get 123
145
+ ```
146
+
147
+ **Output:**
148
+ ```
149
+ {
150
+ "id": 123,
151
+ "name": "Newsletter Subscribers",
152
+ "language": "en",
153
+ "status": "active",
154
+ "contact_count": 1234,
155
+ "subscribed_count": 1180,
156
+ "unsubscribed_count": 54,
157
+ "created_at": "2024-01-15T10:30:00Z",
158
+ "updated_at": "2024-03-15T14:20:00Z",
159
+ "policy_accepted": true
160
+ }
161
+ ```
162
+
163
+ **Extract specific fields:**
164
+
165
+ ```bash
166
+ $ cakemail lists get 123 -f json | jq '{name, contacts: .contact_count}'
167
+ ```
168
+
169
+ **Output:**
170
+ ```json
171
+ {
172
+ "name": "Newsletter Subscribers",
173
+ "contacts": 1234
174
+ }
175
+ ```
176
+
177
+ ### Notes
178
+
179
+ - Returns complete list metadata including contact counts
180
+ - Shows subscription statistics (subscribed vs unsubscribed)
181
+ - Indicates if policy has been accepted
182
+ - Use `-f json` for structured output
183
+
184
+ ### Related Commands
185
+
186
+ - [lists list](#lists-list) - Find list IDs
187
+ - [lists update](#lists-update) - Modify list details
188
+ - [contacts list](/en/cli/command-reference/contacts#contacts-list) - View list contacts
189
+
190
+ ---
191
+
192
+ ## lists create
193
+
194
+ Create a new contact list.
195
+
196
+ ### Usage
197
+
198
+ ```bash
199
+ cakemail lists create [options]
200
+ ```
201
+
202
+ ### Options
203
+
204
+ - `-n, --name <name>` - List name (optional - prompts if not provided)
205
+ - `-l, --language <lang>` - Language code, e.g., `en`, `fr` (optional)
206
+
207
+ ### Examples
208
+
209
+ **Create list with name option (Developer profile):**
210
+
211
+ ```bash
212
+ $ cakemail lists create -n "Newsletter Subscribers"
213
+ ```
214
+
215
+ **Output:**
216
+ ```
217
+ ✓ List created: 123
218
+ {
219
+ "id": 123,
220
+ "name": "Newsletter Subscribers",
221
+ "status": "active",
222
+ "contact_count": 0
223
+ }
224
+ ```
225
+
226
+ **Create list with language:**
227
+
228
+ ```bash
229
+ $ cakemail lists create -n "Abonnés Newsletter" -l fr
230
+ ```
231
+
232
+ **Output:**
233
+ ```
234
+ ✓ List created: 124
235
+ {
236
+ "id": 124,
237
+ "name": "Abonnés Newsletter",
238
+ "language": "fr",
239
+ "status": "active",
240
+ "contact_count": 0
241
+ }
242
+ ```
243
+
244
+ **Interactive creation (Marketer/Balanced profile):**
245
+
246
+ ```bash
247
+ $ cakemail lists create
248
+ ```
249
+
250
+ **Output:**
251
+ ```
252
+ List name: Product Updates
253
+ Language code (optional, e.g., en, fr): en
254
+
255
+ ✓ List created: 125
256
+ {
257
+ "id": 125,
258
+ "name": "Product Updates",
259
+ "language": "en",
260
+ "status": "active"
261
+ }
262
+ ```
263
+
264
+ **Create list in script:**
265
+
266
+ ```bash
267
+ $ cakemail lists create -n "VIP Customers" -l en --batch
268
+ ```
269
+
270
+ ### Profile Behavior
271
+
272
+ - **Developer**: Requires `--name` option, no prompts
273
+ - **Marketer**: Interactive prompts if options missing
274
+ - **Balanced**: Interactive prompts with option preferences
275
+
276
+ ### Notes
277
+
278
+ - List name is required (prompted if not provided in interactive profiles)
279
+ - Language defaults to account language if not specified
280
+ - New lists start with 0 contacts
281
+ - List status is automatically set to "active"
282
+ - Language affects default email templates and subscription forms
283
+
284
+ ### Related Commands
285
+
286
+ - [lists list](#lists-list) - View all lists
287
+ - [contacts add](/en/cli/command-reference/contacts#contacts-add) - Add contacts to list
288
+ - [lists update](#lists-update) - Modify list after creation
289
+
290
+ ---
291
+
292
+ ## lists update
293
+
294
+ Update an existing list's information.
295
+
296
+ ### Usage
297
+
298
+ ```bash
299
+ cakemail lists update <id> [options]
300
+ ```
301
+
302
+ ### Arguments
303
+
304
+ - `id` - List ID (required)
305
+
306
+ ### Options
307
+
308
+ - `-n, --name <name>` - New list name
309
+ - `-l, --language <lang>` - New language code
310
+
311
+ ### Examples
312
+
313
+ **Update list name:**
314
+
315
+ ```bash
316
+ $ cakemail lists update 123 -n "Monthly Newsletter"
317
+ ```
318
+
319
+ **Output:**
320
+ ```
321
+ ✓ List 123 updated
322
+ {
323
+ "id": 123,
324
+ "name": "Monthly Newsletter",
325
+ "language": "en"
326
+ }
327
+ ```
328
+
329
+ **Update language:**
330
+
331
+ ```bash
332
+ $ cakemail lists update 123 -l fr
333
+ ```
334
+
335
+ **Output:**
336
+ ```
337
+ ✓ List 123 updated
338
+ {
339
+ "id": 123,
340
+ "name": "Monthly Newsletter",
341
+ "language": "fr"
342
+ }
343
+ ```
344
+
345
+ **Update multiple fields:**
346
+
347
+ ```bash
348
+ $ cakemail lists update 123 -n "Newsletter Mensuel" -l fr
349
+ ```
350
+
351
+ **Output:**
352
+ ```
353
+ ✓ List 123 updated
354
+ {
355
+ "id": 123,
356
+ "name": "Newsletter Mensuel",
357
+ "language": "fr"
358
+ }
359
+ ```
360
+
361
+ ### Notes
362
+
363
+ - Only provided fields are updated (partial updates)
364
+ - Changing language affects future email templates
365
+ - List ID cannot be changed
366
+ - Contact data is preserved during updates
367
+
368
+ ### Related Commands
369
+
370
+ - [lists get](#lists-get) - View current list details
371
+ - [lists create](#lists-create) - Create new list
372
+
373
+ ---
374
+
375
+ ## lists delete
376
+
377
+ Permanently delete a list and all its contents.
378
+
379
+ ### Usage
380
+
381
+ ```bash
382
+ cakemail lists delete <id> [options]
383
+ ```
384
+
385
+ ### Arguments
386
+
387
+ - `id` - List ID (required)
388
+
389
+ ### Options
390
+
391
+ - `-f, --force` - Skip confirmation prompt (use in scripts)
392
+
393
+ ### Examples
394
+
395
+ **Delete list with confirmation:**
396
+
397
+ ```bash
398
+ $ cakemail lists delete 123
399
+ ```
400
+
401
+ **Output:**
402
+ ```
403
+ ⚠ DANGER: Delete list 123?
404
+
405
+ This is a dangerous operation. The following will happen:
406
+ • All contacts in this list will be deleted
407
+ • All segments in this list will be deleted
408
+ • This action cannot be undone
409
+
410
+ Type the list ID (123) to confirm: 123
411
+
412
+ ✓ List 123 deleted
413
+ ```
414
+
415
+ **Force delete without confirmation:**
416
+
417
+ ```bash
418
+ $ cakemail lists delete 123 --force
419
+ ```
420
+
421
+ **Output:**
422
+ ```
423
+ ✓ List 123 deleted
424
+ ```
425
+
426
+ **Delete in script:**
427
+
428
+ ```bash
429
+ $ cakemail lists delete 123 --force --batch
430
+ ```
431
+
432
+ ### Notes
433
+
434
+ - Deletion is **permanent** and **irreversible**
435
+ - All contacts in the list are permanently deleted
436
+ - All segments, interests, and custom attributes are lost
437
+ - All campaign history for the list is lost
438
+ - Requires extra confirmation due to destructive nature
439
+ - Consider using [lists archive](#lists-archive) instead to preserve data
440
+
441
+ ### Related Commands
442
+
443
+ - [lists archive](#lists-archive) - Archive list without deletion
444
+ - [lists list](#lists-list) - View lists before deletion
445
+ - [lists get](#lists-get) - Review list contents
446
+
447
+ ---
448
+
449
+ ## lists archive
450
+
451
+ Archive a list (preserves data but hides from active use).
452
+
453
+ ### Usage
454
+
455
+ ```bash
456
+ cakemail lists archive <id>
457
+ ```
458
+
459
+ ### Arguments
460
+
461
+ - `id` - List ID (required)
462
+
463
+ ### Examples
464
+
465
+ **Archive a list:**
466
+
467
+ ```bash
468
+ $ cakemail lists archive 123
469
+ ```
470
+
471
+ **Output:**
472
+ ```
473
+ ✓ List 123 archived
474
+ {
475
+ "id": 123,
476
+ "name": "Newsletter Subscribers",
477
+ "status": "archived",
478
+ "archived_at": "2024-03-15T10:30:00Z"
479
+ }
480
+ ```
481
+
482
+ **Verify archive status:**
483
+
484
+ ```bash
485
+ $ cakemail lists get 123 -f json | jq '.status'
486
+ ```
487
+
488
+ **Output:**
489
+ ```
490
+ "archived"
491
+ ```
492
+
493
+ ### Notes
494
+
495
+ - Archived lists are hidden from default list views
496
+ - All data is preserved (contacts, segments, campaigns)
497
+ - Campaigns cannot be sent to archived lists
498
+ - No new contacts can be added to archived lists
499
+ - Archived lists still count towards account limits
500
+ - Archiving is reversible (contact support to unarchive)
501
+ - Preferred over [lists delete](#lists-delete) for data preservation
502
+
503
+ ### Related Commands
504
+
505
+ - [lists delete](#lists-delete) - Permanently delete list
506
+ - [lists list](#lists-list) - View active lists
507
+ - [lists get](#lists-get) - Check list status
508
+
509
+ ---
510
+
511
+ ## lists accept-policy
512
+
513
+ Accept the required policy for a list.
514
+
515
+ ### Usage
516
+
517
+ ```bash
518
+ cakemail lists accept-policy <id>
519
+ ```
520
+
521
+ ### Arguments
522
+
523
+ - `id` - List ID (required)
524
+
525
+ ### Examples
526
+
527
+ **Accept policy for list:**
528
+
529
+ ```bash
530
+ $ cakemail lists accept-policy 123
531
+ ```
532
+
533
+ **Output:**
534
+ ```
535
+ ✓ Policy accepted for list 123
536
+ {
537
+ "id": 123,
538
+ "name": "Newsletter Subscribers",
539
+ "policy_accepted": true,
540
+ "policy_accepted_at": "2024-03-15T10:30:00Z"
541
+ }
542
+ ```
543
+
544
+ **Verify policy status:**
545
+
546
+ ```bash
547
+ $ cakemail lists get 123 -f json | jq '.policy_accepted'
548
+ ```
549
+
550
+ **Output:**
551
+ ```
552
+ true
553
+ ```
554
+
555
+ ### Notes
556
+
557
+ - Required before sending campaigns to certain lists
558
+ - Policy acceptance is tracked per list
559
+ - Timestamp is recorded for compliance
560
+ - Cannot be undone once accepted
561
+ - Required for GDPR/anti-spam compliance
562
+
563
+ ### Related Commands
564
+
565
+ - [lists get](#lists-get) - Check policy status
566
+ - [campaigns send](/en/cli/command-reference/campaigns#campaigns-send) - Send to list
567
+
568
+ ---
569
+
570
+ ## lists forms
571
+
572
+ List all subscription form endpoints for a list.
573
+
574
+ ### Usage
575
+
576
+ ```bash
577
+ cakemail lists forms <id>
578
+ ```
579
+
580
+ ### Arguments
581
+
582
+ - `id` - List ID (required)
583
+
584
+ ### Examples
585
+
586
+ **List subscription forms:**
587
+
588
+ ```bash
589
+ $ cakemail lists forms 123
590
+ ```
591
+
592
+ **Output:**
593
+ ```
594
+ {
595
+ "data": [
596
+ {
597
+ "id": "form_abc123",
598
+ "name": "Website Signup",
599
+ "domain": "example.com",
600
+ "endpoint_url": "https://api.cakemail.com/v1/subscribe/form_abc123",
601
+ "double_opt_in": true,
602
+ "created_at": "2024-01-15T10:30:00Z"
603
+ },
604
+ {
605
+ "id": "form_def456",
606
+ "name": "Landing Page",
607
+ "domain": "landing.example.com",
608
+ "endpoint_url": "https://api.cakemail.com/v1/subscribe/form_def456",
609
+ "double_opt_in": false,
610
+ "created_at": "2024-02-01T14:20:00Z"
611
+ }
612
+ ],
613
+ "count": 2
614
+ }
615
+ ```
616
+
617
+ **Extract form URLs:**
618
+
619
+ ```bash
620
+ $ cakemail lists forms 123 -f json | jq -r '.data[] | "\(.name): \(.endpoint_url)"'
621
+ ```
622
+
623
+ **Output:**
624
+ ```
625
+ Website Signup: https://api.cakemail.com/v1/subscribe/form_abc123
626
+ Landing Page: https://api.cakemail.com/v1/subscribe/form_def456
627
+ ```
628
+
629
+ ### Notes
630
+
631
+ - Each form has a unique endpoint URL
632
+ - Forms can be configured for double opt-in
633
+ - Domain restriction helps prevent form abuse
634
+ - Multiple forms can exist per list
635
+
636
+ ### Related Commands
637
+
638
+ - [lists form-create](#lists-form-create) - Create subscription form
639
+ - [lists form-delete](#lists-form-delete) - Delete subscription form
640
+
641
+ ---
642
+
643
+ ## lists form-create
644
+
645
+ Create a subscription form endpoint for a list.
646
+
647
+ ### Usage
648
+
649
+ ```bash
650
+ cakemail lists form-create <id> [options]
651
+ ```
652
+
653
+ ### Arguments
654
+
655
+ - `id` - List ID (required)
656
+
657
+ ### Options
658
+
659
+ - `-d, --domain <domain>` - Domain name hosting the form
660
+ - `-n, --name <name>` - Name of the form
661
+ - `--double-opt-in` - Enable double opt-in requirement
662
+
663
+ ### Examples
664
+
665
+ **Create basic subscription form:**
666
+
667
+ ```bash
668
+ $ cakemail lists form-create 123 -n "Website Signup" -d "example.com"
669
+ ```
670
+
671
+ **Output:**
672
+ ```
673
+ ✓ Subscription form created
674
+ {
675
+ "id": "form_abc123",
676
+ "name": "Website Signup",
677
+ "domain": "example.com",
678
+ "endpoint_url": "https://api.cakemail.com/v1/subscribe/form_abc123",
679
+ "double_opt_in": false
680
+ }
681
+ ```
682
+
683
+ **Create form with double opt-in:**
684
+
685
+ ```bash
686
+ $ cakemail lists form-create 123 \
687
+ -n "Landing Page" \
688
+ -d "landing.example.com" \
689
+ --double-opt-in
690
+ ```
691
+
692
+ **Output:**
693
+ ```
694
+ ✓ Subscription form created
695
+ {
696
+ "id": "form_def456",
697
+ "name": "Landing Page",
698
+ "domain": "landing.example.com",
699
+ "endpoint_url": "https://api.cakemail.com/v1/subscribe/form_def456",
700
+ "double_opt_in": true
701
+ }
702
+ ```
703
+
704
+ **Create form without domain restriction:**
705
+
706
+ ```bash
707
+ $ cakemail lists form-create 123 -n "Public Form"
708
+ ```
709
+
710
+ ### Notes
711
+
712
+ - Endpoint URL is automatically generated
713
+ - Domain restriction helps prevent unauthorized submissions
714
+ - Double opt-in requires email confirmation before subscribing
715
+ - Form endpoint accepts POST requests with contact data
716
+ - Use the endpoint URL in your website's form action
717
+
718
+ ### Related Commands
719
+
720
+ - [lists forms](#lists-forms) - View all form endpoints
721
+ - [lists form-delete](#lists-form-delete) - Delete form endpoint
722
+
723
+ ---
724
+
725
+ ## lists form-delete
726
+
727
+ Delete a subscription form endpoint.
728
+
729
+ ### Usage
730
+
731
+ ```bash
732
+ cakemail lists form-delete <list-id> <form-id> [options]
733
+ ```
734
+
735
+ ### Arguments
736
+
737
+ - `list-id` - List ID (required)
738
+ - `form-id` - Form ID (required)
739
+
740
+ ### Options
741
+
742
+ - `-f, --force` - Skip confirmation prompt
743
+
744
+ ### Examples
745
+
746
+ **Delete form with confirmation:**
747
+
748
+ ```bash
749
+ $ cakemail lists form-delete 123 form_abc123
750
+ ```
751
+
752
+ **Output:**
753
+ ```
754
+ ⚠ Delete subscription form form_abc123?
755
+
756
+ The following will happen:
757
+ • Subscription form endpoint will be deleted
758
+ • Any websites using this form will stop working
759
+
760
+ Type 'yes' to confirm: yes
761
+
762
+ ✓ Subscription form form_abc123 deleted
763
+ ```
764
+
765
+ **Force delete:**
766
+
767
+ ```bash
768
+ $ cakemail lists form-delete 123 form_abc123 --force
769
+ ```
770
+
771
+ **Output:**
772
+ ```
773
+ ✓ Subscription form form_abc123 deleted
774
+ ```
775
+
776
+ ### Notes
777
+
778
+ - Deletion is immediate
779
+ - Forms using this endpoint will stop working
780
+ - Existing contacts remain in the list
781
+ - Consider updating websites before deletion
782
+ - No undo available
783
+
784
+ ### Related Commands
785
+
786
+ - [lists forms](#lists-forms) - View form endpoints before deletion
787
+ - [lists form-create](#lists-form-create) - Create new form
788
+
789
+ ---
790
+
791
+ ## Common Workflows
792
+
793
+ ### Workflow 1: Create List and Add Subscription Form
794
+
795
+ ```bash
796
+ # Create list
797
+ $ cakemail lists create -n "Newsletter" -l en
798
+
799
+ # Note the list ID from output (e.g., 123)
800
+
801
+ # Create subscription form
802
+ $ cakemail lists form-create 123 \
803
+ -n "Website Signup" \
804
+ -d "example.com" \
805
+ --double-opt-in
806
+
807
+ # Get form endpoint URL
808
+ $ cakemail lists forms 123
809
+ ```
810
+
811
+ ### Workflow 2: Archive Old Lists
812
+
813
+ ```bash
814
+ # List all lists
815
+ $ cakemail lists list
816
+
817
+ # Archive inactive lists (preserves data)
818
+ $ cakemail lists archive 124
819
+ $ cakemail lists archive 125
820
+
821
+ # Verify archives
822
+ $ cakemail lists get 124 -f json | jq '.status'
823
+ ```
824
+
825
+ ### Workflow 3: List Migration
826
+
827
+ ```bash
828
+ # Get source list details
829
+ $ cakemail lists get 123 > old-list.json
830
+
831
+ # Create new list with same settings
832
+ $ cakemail lists create -n "New Newsletter" -l en
833
+
834
+ # Export contacts from old list
835
+ $ cakemail contacts export 123
836
+
837
+ # Import to new list (manual process or use API)
838
+ # Archive old list
839
+ $ cakemail lists archive 123
840
+ ```
841
+
842
+ ### Workflow 4: Multi-Form Setup
843
+
844
+ ```bash
845
+ # Create list
846
+ $ cakemail lists create -n "Multi-Channel List"
847
+
848
+ # Create forms for different sources
849
+ $ cakemail lists form-create 123 -n "Website" -d "example.com"
850
+ $ cakemail lists form-create 123 -n "Landing Page" -d "lp.example.com"
851
+ $ cakemail lists form-create 123 -n "Mobile App" -d "app.example.com"
852
+
853
+ # List all forms
854
+ $ cakemail lists forms 123
855
+ ```
856
+
857
+ ## Best Practices
858
+
859
+ 1. **Use Archive Instead of Delete**: Preserve historical data by archiving lists rather than deleting
860
+ 2. **Double Opt-In**: Enable for subscription forms to ensure list quality
861
+ 3. **Domain Restrictions**: Set domains on subscription forms to prevent abuse
862
+ 4. **Language Settings**: Set appropriate language for localized content
863
+ 5. **Naming Convention**: Use clear, descriptive list names
864
+ 6. **Accept Policies**: Accept list policies before sending campaigns
865
+ 7. **Regular Audits**: Periodically review and archive unused lists
866
+ 8. **Form Management**: Create separate forms for different acquisition channels
867
+
868
+ ## Troubleshooting
869
+
870
+ ### Error: "List ID not found"
871
+
872
+ The specified list doesn't exist or was deleted.
873
+
874
+ **Solution:**
875
+ ```bash
876
+ # List all lists to verify ID
877
+ $ cakemail lists list
878
+
879
+ # Use correct list ID
880
+ $ cakemail lists get 123
881
+ ```
882
+
883
+ ### Error: "List cannot be deleted"
884
+
885
+ List may have active campaigns or dependencies.
886
+
887
+ **Solution:**
888
+ ```bash
889
+ # Archive instead of deleting
890
+ $ cakemail lists archive 123
891
+
892
+ # Or check for active campaigns
893
+ $ cakemail campaigns list --filter "list_id==123;status==active"
894
+ ```
895
+
896
+ ### Error: "Policy not accepted"
897
+
898
+ Some operations require policy acceptance.
899
+
900
+ **Solution:**
901
+ ```bash
902
+ # Accept policy for list
903
+ $ cakemail lists accept-policy 123
904
+
905
+ # Verify acceptance
906
+ $ cakemail lists get 123 -f json | jq '.policy_accepted'
907
+ ```
908
+
909
+ ### Subscription Form Not Working
910
+
911
+ Form endpoint may be misconfigured.
912
+
913
+ **Solution:**
914
+ ```bash
915
+ # Check form configuration
916
+ $ cakemail lists forms 123
917
+
918
+ # Verify endpoint URL is correct
919
+ # Check domain matches your website
920
+ # Ensure form POST matches API format
921
+ ```
922
+
923
+ ### Cannot Create List
924
+
925
+ May have reached account limit.
926
+
927
+ **Solution:**
928
+ ```bash
929
+ # Check total list count
930
+ $ cakemail lists list -f json | jq '.count'
931
+
932
+ # Archive unused lists
933
+ $ cakemail lists archive <old-list-id>
934
+
935
+ # Contact support for limit increase
936
+ ```
937
+
938
+ ### Language Not Applied
939
+
940
+ Language must be valid ISO code.
941
+
942
+ **Solution:**
943
+ ```bash
944
+ # Use standard language codes
945
+ $ cakemail lists create -n "Newsletter" -l en # English
946
+ $ cakemail lists create -n "Newsletter" -l fr # French
947
+ $ cakemail lists create -n "Newsletter" -l es # Spanish
948
+
949
+ # Check supported languages in account settings
950
+ ```
951
+
952
+ ---
953
+
954
+ **Related Documentation:**
955
+ - [Contacts Commands](/en/cli/command-reference/contacts/) - Manage list contacts
956
+ - [Segments Commands](/en/cli/command-reference/segments/) - Create dynamic list segments
957
+ - [Interests Commands](/en/cli/command-reference/interests/) - Manage list-specific interests
958
+ - [Campaigns Commands](/en/cli/command-reference/campaigns/) - Send campaigns to lists