@cakemail-org/cakemail-cli 1.5.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.
- package/.claude/settings.local.json +12 -0
- package/.env.example +40 -0
- package/.env.test.example +45 -0
- package/CHANGELOG.md +1031 -0
- package/README.md +319 -15
- package/audit-formats.js +128 -0
- package/cakemail.rb +20 -0
- package/dist/cli.js +27 -10
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -6
- package/dist/client.js.map +1 -1
- package/dist/commands/account.js +1 -1
- package/dist/commands/account.js.map +1 -1
- package/dist/commands/attributes.js +1 -1
- package/dist/commands/attributes.js.map +1 -1
- package/dist/commands/campaigns.d.ts.map +1 -1
- package/dist/commands/campaigns.js +103 -8
- package/dist/commands/campaigns.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +63 -4
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/contacts.d.ts.map +1 -1
- package/dist/commands/contacts.js +91 -12
- package/dist/commands/contacts.js.map +1 -1
- package/dist/commands/emails.js +1 -1
- package/dist/commands/emails.js.map +1 -1
- package/dist/commands/interests.d.ts +5 -0
- package/dist/commands/interests.d.ts.map +1 -0
- package/dist/commands/interests.js +172 -0
- package/dist/commands/interests.js.map +1 -0
- package/dist/commands/lists.d.ts.map +1 -1
- package/dist/commands/lists.js +6 -8
- package/dist/commands/lists.js.map +1 -1
- package/dist/commands/logs.d.ts +5 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +237 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/reports.js +1 -1
- package/dist/commands/reports.js.map +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/segments.js.map +1 -1
- package/dist/commands/senders.d.ts.map +1 -1
- package/dist/commands/senders.js +11 -8
- package/dist/commands/senders.js.map +1 -1
- package/dist/commands/suppressed.js +1 -1
- package/dist/commands/suppressed.js.map +1 -1
- package/dist/commands/tags.d.ts +5 -0
- package/dist/commands/tags.d.ts.map +1 -0
- package/dist/commands/tags.js +124 -0
- package/dist/commands/tags.js.map +1 -0
- package/dist/commands/templates.js +1 -1
- package/dist/commands/templates.js.map +1 -1
- package/dist/commands/transactional-templates.d.ts +5 -0
- package/dist/commands/transactional-templates.d.ts.map +1 -0
- package/dist/commands/transactional-templates.js +354 -0
- package/dist/commands/transactional-templates.js.map +1 -0
- package/dist/commands/webhooks.js +1 -1
- package/dist/commands/webhooks.js.map +1 -1
- package/dist/utils/auth.d.ts +8 -1
- package/dist/utils/auth.d.ts.map +1 -1
- package/dist/utils/auth.js +39 -11
- package/dist/utils/auth.js.map +1 -1
- package/dist/utils/config-file.d.ts +7 -0
- package/dist/utils/config-file.d.ts.map +1 -1
- package/dist/utils/config-file.js +15 -0
- package/dist/utils/config-file.js.map +1 -1
- package/dist/utils/config.d.ts +2 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +12 -4
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/errors.js +1 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/list-defaults.d.ts +33 -0
- package/dist/utils/list-defaults.d.ts.map +1 -0
- package/dist/utils/list-defaults.js +52 -0
- package/dist/utils/list-defaults.js.map +1 -0
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +36 -13
- package/dist/utils/output.js.map +1 -1
- package/dist/utils/progress.d.ts.map +1 -1
- package/dist/utils/progress.js +32 -4
- package/dist/utils/progress.js.map +1 -1
- package/dist/utils/spinner.d.ts +17 -0
- package/dist/utils/spinner.d.ts.map +1 -0
- package/dist/utils/spinner.js +43 -0
- package/dist/utils/spinner.js.map +1 -0
- package/docs/DOCUMENTATION-STANDARD.md +1068 -0
- package/docs/README.md +161 -0
- package/docs/developer/ARCHITECTURE.md +516 -0
- package/docs/developer/AUTH.md +204 -0
- package/docs/developer/CONTRIBUTING.md +227 -0
- package/docs/developer/DOCUMENTATION_SUMMARY.md +346 -0
- package/docs/developer/PROJECT_INDEX.md +365 -0
- package/docs/planning/API_COVERAGE.md +1045 -0
- package/docs/planning/BACKLOG.md +1159 -0
- package/docs/planning/PROFILE_SYSTEM_TASKS.md +287 -0
- package/docs/planning/UX_IMPLEMENTATION_PLAN.md +691 -0
- package/docs/planning/archive/RELEASE_CHECKLIST_v1.3.0.md +332 -0
- package/docs/planning/archive/RELEASE_v1.3.0.md +428 -0
- package/docs/planning/archive/cakemail-cli-ux-improvements.md +438 -0
- package/docs/planning/cakemail-profile-system-plan.md +1121 -0
- package/docs/testing/AI_USER_SIMULATION_DESIGN.md +1342 -0
- package/docs/testing/KENOGAMI_BIDIRECTIONAL_FLOW.md +1517 -0
- package/docs/testing/KENOGAMI_TRUTH_RECONCILIATION_SYSTEM.md +1369 -0
- package/docs/user-manual/.obsidian/app.json +1 -0
- package/docs/user-manual/.obsidian/appearance.json +1 -0
- package/docs/user-manual/.obsidian/core-plugins.json +33 -0
- package/docs/user-manual/.obsidian/workspace.json +167 -0
- package/docs/user-manual/01-getting-started/01-installation.md +214 -0
- package/docs/user-manual/01-getting-started/02-quick-start.md +432 -0
- package/docs/user-manual/01-getting-started/03-authentication.md +448 -0
- package/docs/user-manual/01-getting-started/04-configuration.md +430 -0
- package/docs/user-manual/01-getting-started/05-output-formats.md +447 -0
- package/docs/user-manual/02-core-concepts/01-accounts.md +514 -0
- package/docs/user-manual/02-core-concepts/02-profile-system.md +771 -0
- package/docs/user-manual/02-core-concepts/03-smart-defaults.md +485 -0
- package/docs/user-manual/02-core-concepts/04-authentication-methods.md +435 -0
- package/docs/user-manual/02-core-concepts/05-pagination-filtering.md +600 -0
- package/docs/user-manual/02-core-concepts/06-error-handling.md +718 -0
- package/docs/user-manual/02-core-concepts/07-api-coverage.md +483 -0
- package/docs/user-manual/03-email-operations/01-senders.md +490 -0
- package/docs/user-manual/03-email-operations/02-templates.md +444 -0
- package/docs/user-manual/03-email-operations/03-transactional-emails.md +706 -0
- package/docs/user-manual/03-email-operations/04-email-tracking.md +407 -0
- package/docs/user-manual/04-campaign-management/01-campaigns-basics.md +394 -0
- package/docs/user-manual/04-campaign-management/02-campaign-scheduling.md +630 -0
- package/docs/user-manual/04-campaign-management/03-campaign-testing.md +997 -0
- package/docs/user-manual/04-campaign-management/04-campaign-lifecycle.md +709 -0
- package/docs/user-manual/04-campaign-management/05-campaign-links.md +934 -0
- package/docs/user-manual/05-contact-management/01-lists.md +836 -0
- package/docs/user-manual/05-contact-management/02-contacts.md +1035 -0
- package/docs/user-manual/05-contact-management/03-custom-attributes.md +788 -0
- package/docs/user-manual/05-contact-management/04-segments.md +1028 -0
- package/docs/user-manual/05-contact-management/05-contact-import-export.md +1031 -0
- package/docs/user-manual/06-analytics-reporting/01-campaign-analytics.md +867 -0
- package/docs/user-manual/06-analytics-reporting/02-account-reports.md +227 -0
- package/docs/user-manual/07-integrations/01-webhooks-integration.md +259 -0
- package/docs/user-manual/07-integrations/02-automation.md +326 -0
- package/docs/user-manual/08-advanced-usage/01-scripting-patterns.md +672 -0
- package/docs/user-manual/08-advanced-usage/02-bulk-operations.md +932 -0
- package/docs/user-manual/08-advanced-usage/03-ci-cd-integration.md +892 -0
- package/docs/user-manual/08-advanced-usage/04-performance-optimization.md +766 -0
- package/docs/user-manual/09-command-reference/01-config.md +776 -0
- package/docs/user-manual/09-command-reference/02-account.md +652 -0
- package/docs/user-manual/09-command-reference/03-lists.md +958 -0
- package/docs/user-manual/09-command-reference/04-contacts.md +1408 -0
- package/docs/user-manual/09-command-reference/05-attributes.md +617 -0
- package/docs/user-manual/09-command-reference/06-segments.md +894 -0
- package/docs/user-manual/09-command-reference/07-senders.md +803 -0
- package/docs/user-manual/09-command-reference/08-templates.md +818 -0
- package/docs/user-manual/09-command-reference/09-campaigns.md +1250 -0
- package/docs/user-manual/09-command-reference/10-emails.md +807 -0
- package/docs/user-manual/09-command-reference/11-reports.md +1135 -0
- package/docs/user-manual/09-command-reference/12-webhooks.md +773 -0
- package/docs/user-manual/09-command-reference/13-suppressed.md +797 -0
- package/docs/user-manual/09-command-reference/14-interests.md +630 -0
- package/docs/user-manual/09-command-reference/15-tags.md +584 -0
- package/docs/user-manual/09-command-reference/16-logs.md +656 -0
- package/docs/user-manual/09-command-reference/17-transactional-templates.md +850 -0
- package/docs/user-manual/10-troubleshooting/01-common-errors.md +457 -0
- package/docs/user-manual/10-troubleshooting/02-authentication-issues.md +558 -0
- package/docs/user-manual/10-troubleshooting/03-connection-problems.md +634 -0
- package/docs/user-manual/10-troubleshooting/04-debugging.md +725 -0
- package/docs/user-manual/11-appendix/04-faq.md +484 -0
- package/docs/user-manual/11-appendix/05-glossary.md +250 -0
- package/docs/user-manual/README.md +0 -0
- package/package.json +13 -47
- package/src/cli.ts +125 -0
- package/src/client.ts +16 -0
- package/src/commands/account.ts +267 -0
- package/src/commands/accounts.ts +78 -0
- package/src/commands/actions.ts +249 -0
- package/src/commands/attributes.ts +139 -0
- package/src/commands/campaign-blueprints.ts +106 -0
- package/src/commands/campaigns.ts +469 -0
- package/src/commands/config.ts +77 -0
- package/src/commands/contacts.ts +612 -0
- package/src/commands/custom-attributes.ts +127 -0
- package/src/commands/dkims.ts +117 -0
- package/src/commands/domains.ts +82 -0
- package/src/commands/email-apis.ts +569 -0
- package/src/commands/emails.ts +197 -0
- package/src/commands/forms.ts +283 -0
- package/src/commands/interests.ts +155 -0
- package/src/commands/links.ts +38 -0
- package/src/commands/lists.ts +406 -0
- package/src/commands/logos.ts +71 -0
- package/src/commands/logs.ts +386 -0
- package/src/commands/reports.ts +306 -0
- package/src/commands/segments.ts +158 -0
- package/src/commands/senders.ts +204 -0
- package/src/commands/sub-accounts.ts +271 -0
- package/src/commands/suppressed-emails.ts +234 -0
- package/src/commands/suppressed.ts +198 -0
- package/src/commands/system-emails.ts +85 -0
- package/src/commands/tags.ts +146 -0
- package/src/commands/tasks.ts +116 -0
- package/src/commands/templates.ts +189 -0
- package/src/commands/tokens.ts +83 -0
- package/src/commands/transactional-emails.ts +374 -0
- package/src/commands/transactional-templates.ts +385 -0
- package/src/commands/users.ts +506 -0
- package/src/commands/webhooks.ts +172 -0
- package/src/commands/workflow-blueprints.ts +123 -0
- package/src/commands/workflows.ts +265 -0
- package/src/types/profile.ts +93 -0
- package/src/utils/auth.ts +272 -0
- package/src/utils/config-file.ts +96 -0
- package/src/utils/config.ts +134 -0
- package/src/utils/confirm.ts +32 -0
- package/src/utils/defaults.ts +99 -0
- package/src/utils/errors.ts +116 -0
- package/src/utils/interactive.ts +91 -0
- package/src/utils/list-defaults.ts +74 -0
- package/src/utils/output.ts +190 -0
- package/src/utils/progress.ts +320 -0
- package/src/utils/spinner.ts +22 -0
- package/tests/IMPLEMENTATION_STATUS.md +258 -0
- package/tests/PTY_SETUP.md +118 -0
- package/tests/PTY_TESTING_GUIDE.md +507 -0
- package/tests/README.md +244 -0
- package/tests/fixtures/api-responses/campaigns.json +34 -0
- package/tests/fixtures/test-config.json +13 -0
- package/tests/helpers/cli-runner.ts +128 -0
- package/tests/helpers/mock-server.ts +301 -0
- package/tests/helpers/pty-runner.ts +181 -0
- package/tests/integration/campaigns-real-api.test.ts +196 -0
- package/tests/integration/setup-integration.ts +50 -0
- package/tests/pty/campaigns.test.ts +241 -0
- package/tests/setup.ts +34 -0
- package/tsconfig.json +15 -0
- package/vitest.config.ts +28 -0
|
@@ -0,0 +1,771 @@
|
|
|
1
|
+
# Profile System
|
|
2
|
+
|
|
3
|
+
Learn how the Cakemail CLI adapts to your workflow with three user profiles.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Profile System allows the CLI to adapt its behavior to match your role and preferences. Choose from three profiles, each optimized for different use cases:
|
|
8
|
+
|
|
9
|
+
- **Developer Profile** - Fast, scriptable, minimal output
|
|
10
|
+
- **Marketer Profile** - Guided, interactive, safe
|
|
11
|
+
- **Balanced Profile** - Best of both worlds (default)
|
|
12
|
+
|
|
13
|
+
## Why Profiles?
|
|
14
|
+
|
|
15
|
+
Different users have different needs:
|
|
16
|
+
|
|
17
|
+
- **Developers** want speed, JSON output, and no interruptions
|
|
18
|
+
- **Marketers** need guidance, confirmations, and visual clarity
|
|
19
|
+
- **Everyone** benefits from adaptive behavior in different contexts
|
|
20
|
+
|
|
21
|
+
The Profile System eliminates the need to manually configure dozens of settings. Pick a profile and get sensible defaults instantly.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## The Three Profiles
|
|
26
|
+
|
|
27
|
+
### Developer Profile
|
|
28
|
+
|
|
29
|
+
Optimized for automation, scripting, and experienced users.
|
|
30
|
+
|
|
31
|
+
**Characteristics:**
|
|
32
|
+
- **Output Format**: JSON (machine-readable)
|
|
33
|
+
- **Colors**: None (plain text for logs)
|
|
34
|
+
- **Date Format**: ISO8601 (2025-10-11T14:30:00Z)
|
|
35
|
+
- **Interactive Prompts**: Disabled (no interruptions)
|
|
36
|
+
- **Confirmations**: Disabled (trusts you know what you're doing)
|
|
37
|
+
- **Progress Indicators**: Hidden (faster output)
|
|
38
|
+
- **Error Messages**: Technical (full details, API context)
|
|
39
|
+
- **Tips & Hints**: Disabled (you know the CLI)
|
|
40
|
+
- **List Defaults**: API defaults (50 items per page, default sort order)
|
|
41
|
+
|
|
42
|
+
**Best For:**
|
|
43
|
+
- CI/CD pipelines
|
|
44
|
+
- Shell scripts and automation
|
|
45
|
+
- Log parsing and data processing
|
|
46
|
+
- Experienced CLI users who want speed
|
|
47
|
+
|
|
48
|
+
**Example:**
|
|
49
|
+
```bash
|
|
50
|
+
$ cakemail config profile-set developer
|
|
51
|
+
$ cakemail campaigns create --name "Weekly Newsletter" --list-id 123 --sender-id 456
|
|
52
|
+
{"id":789,"name":"Weekly Newsletter","status":"draft","list_id":123,"sender_id":456}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
### Marketer Profile
|
|
58
|
+
|
|
59
|
+
Optimized for safety, guidance, and visual clarity.
|
|
60
|
+
|
|
61
|
+
**Characteristics:**
|
|
62
|
+
- **Output Format**: Compact (human-readable summaries)
|
|
63
|
+
- **Colors**: Rich (full color highlighting)
|
|
64
|
+
- **Date Format**: Relative ("2 hours ago", "3 days ago")
|
|
65
|
+
- **Interactive Prompts**: Enabled (guides you through)
|
|
66
|
+
- **Confirmations**: Always confirm (safety first)
|
|
67
|
+
- **Progress Indicators**: Shown (visual feedback)
|
|
68
|
+
- **Error Messages**: Friendly (clear explanations, suggestions)
|
|
69
|
+
- **Tips & Hints**: Enabled (helpful guidance)
|
|
70
|
+
- **List Defaults**: Curated experience (25 items per page, sort by newest first)
|
|
71
|
+
|
|
72
|
+
**Best For:**
|
|
73
|
+
- Marketing team members
|
|
74
|
+
- Occasional CLI users
|
|
75
|
+
- Learning the CLI
|
|
76
|
+
- Operations where safety is critical
|
|
77
|
+
|
|
78
|
+
**Example:**
|
|
79
|
+
```bash
|
|
80
|
+
$ cakemail config profile-set marketer
|
|
81
|
+
$ cakemail campaigns create
|
|
82
|
+
Campaign name: Weekly Newsletter
|
|
83
|
+
? Select a list: › Newsletter Subscribers (1,234 contacts)
|
|
84
|
+
? Select a sender: › Marketing Team <marketing@company.com>
|
|
85
|
+
✓ Campaign created: 789
|
|
86
|
+
|
|
87
|
+
Campaign: Weekly Newsletter
|
|
88
|
+
Status: 🟡 draft
|
|
89
|
+
Created: just now
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### Balanced Profile (Default)
|
|
95
|
+
|
|
96
|
+
The perfect middle ground for most users.
|
|
97
|
+
|
|
98
|
+
**Characteristics:**
|
|
99
|
+
- **Output Format**: Table (structured, readable)
|
|
100
|
+
- **Colors**: Moderate (status indicators only)
|
|
101
|
+
- **Date Format**: Friendly ("Oct 11, 2025")
|
|
102
|
+
- **Interactive Prompts**: Auto-detect (enabled in TTY, disabled in scripts)
|
|
103
|
+
- **Confirmations**: Auto-detect (confirm in interactive mode)
|
|
104
|
+
- **Progress Indicators**: Shown (helpful feedback)
|
|
105
|
+
- **Error Messages**: Balanced (clear but detailed)
|
|
106
|
+
- **Tips & Hints**: Auto-detect (shown when helpful)
|
|
107
|
+
- **List Defaults**: API defaults (50 items per page, default sort order)
|
|
108
|
+
|
|
109
|
+
**Best For:**
|
|
110
|
+
- Most users (recommended default)
|
|
111
|
+
- Mixed interactive and scripted usage
|
|
112
|
+
- Teams with varied skill levels
|
|
113
|
+
- Flexible workflows
|
|
114
|
+
|
|
115
|
+
**Example:**
|
|
116
|
+
```bash
|
|
117
|
+
$ cakemail config profile-set balanced
|
|
118
|
+
$ cakemail campaigns list --limit 3
|
|
119
|
+
┌────────┬──────────────────────┬──────────┬─────────────┐
|
|
120
|
+
│ ID │ Name │ Status │ Created │
|
|
121
|
+
├────────┼──────────────────────┼──────────┼─────────────┤
|
|
122
|
+
│ 789 │ Weekly Newsletter │ 🟢 sent │ Oct 11 2025 │
|
|
123
|
+
│ 788 │ Product Update │ 🟡 draft │ Oct 10 2025 │
|
|
124
|
+
│ 787 │ Flash Sale │ 🔵 scheduled │ Oct 9 2025 │
|
|
125
|
+
└────────┴──────────────────────┴──────────┴─────────────┘
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Profile Features in Detail
|
|
131
|
+
|
|
132
|
+
### Output Formats
|
|
133
|
+
|
|
134
|
+
Each profile defaults to a different output format:
|
|
135
|
+
|
|
136
|
+
| Profile | Format | Best For |
|
|
137
|
+
|---------|--------|----------|
|
|
138
|
+
| Developer | `json` | Parsing, piping, automation |
|
|
139
|
+
| Marketer | `compact` | Quick summaries, key info |
|
|
140
|
+
| Balanced | `table` | Structured data, readability |
|
|
141
|
+
|
|
142
|
+
You can override the format for any command:
|
|
143
|
+
```bash
|
|
144
|
+
cakemail -f json campaigns list # Force JSON regardless of profile
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### Color Schemes
|
|
150
|
+
|
|
151
|
+
Visual styling adapts to your profile:
|
|
152
|
+
|
|
153
|
+
**None** (Developer)
|
|
154
|
+
- Plain text output
|
|
155
|
+
- No ANSI color codes
|
|
156
|
+
- Perfect for logs and piping
|
|
157
|
+
|
|
158
|
+
**Moderate** (Balanced)
|
|
159
|
+
- Status indicators in color (✓ green, ✗ red)
|
|
160
|
+
- Warnings in yellow
|
|
161
|
+
- Errors in red
|
|
162
|
+
- Headers in bold
|
|
163
|
+
|
|
164
|
+
**Rich** (Marketer)
|
|
165
|
+
- Full color palette
|
|
166
|
+
- Status badges with emoji
|
|
167
|
+
- Highlighted sections
|
|
168
|
+
- Color-coded values
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### Date Formatting
|
|
173
|
+
|
|
174
|
+
Dates are displayed differently based on your profile:
|
|
175
|
+
|
|
176
|
+
**ISO8601** (Developer)
|
|
177
|
+
```
|
|
178
|
+
2025-10-11T14:30:00Z
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Friendly** (Balanced)
|
|
182
|
+
```
|
|
183
|
+
Oct 11, 2025 at 2:30 PM
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Relative** (Marketer)
|
|
187
|
+
```
|
|
188
|
+
2 hours ago
|
|
189
|
+
3 days ago
|
|
190
|
+
just now
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
### Interactive Prompts
|
|
196
|
+
|
|
197
|
+
Profiles control when the CLI prompts for missing information.
|
|
198
|
+
|
|
199
|
+
**Developer Profile** - Never prompts
|
|
200
|
+
```bash
|
|
201
|
+
$ cakemail campaigns create --name "Newsletter"
|
|
202
|
+
Error: Missing required parameter: --list-id
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Marketer Profile** - Always prompts
|
|
206
|
+
```bash
|
|
207
|
+
$ cakemail campaigns create
|
|
208
|
+
Campaign name: Newsletter
|
|
209
|
+
? Select a list: › Newsletter Subscribers (1,234 contacts)
|
|
210
|
+
? Select a sender: › Marketing Team <marketing@company.com>
|
|
211
|
+
✓ Campaign created
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Balanced Profile** - Auto-detects context
|
|
215
|
+
```bash
|
|
216
|
+
# Interactive (TTY detected)
|
|
217
|
+
$ cakemail campaigns create
|
|
218
|
+
Campaign name: Newsletter
|
|
219
|
+
[... prompts shown ...]
|
|
220
|
+
|
|
221
|
+
# Non-interactive (pipe or CI detected)
|
|
222
|
+
$ echo "cakemail campaigns create" | bash
|
|
223
|
+
Error: Missing required parameter: --list-id
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
### Confirmation Behavior
|
|
229
|
+
|
|
230
|
+
Destructive operations (delete, etc.) behave differently by profile:
|
|
231
|
+
|
|
232
|
+
**Developer Profile** - No confirmations
|
|
233
|
+
```bash
|
|
234
|
+
$ cakemail campaigns delete 789
|
|
235
|
+
✓ Campaign 789 deleted
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**Marketer Profile** - Always confirm
|
|
239
|
+
```bash
|
|
240
|
+
$ cakemail campaigns delete 789
|
|
241
|
+
⚠ Delete campaign 789?
|
|
242
|
+
Campaign will be permanently deleted
|
|
243
|
+
This action cannot be undone
|
|
244
|
+
|
|
245
|
+
Delete campaign? (y/N):
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Balanced Profile** - Auto-detect
|
|
249
|
+
```bash
|
|
250
|
+
# Interactive terminal: confirms
|
|
251
|
+
$ cakemail campaigns delete 789
|
|
252
|
+
Delete campaign? (y/N):
|
|
253
|
+
|
|
254
|
+
# Script or CI: skips confirmation
|
|
255
|
+
$ ./deploy.sh # contains delete command
|
|
256
|
+
✓ Campaign 789 deleted
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
All profiles support `--force` to skip confirmation:
|
|
260
|
+
```bash
|
|
261
|
+
cakemail campaigns delete 789 --force
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
### Progress Indicators
|
|
267
|
+
|
|
268
|
+
Long-running operations show progress differently:
|
|
269
|
+
|
|
270
|
+
**Developer** - Hidden (output only when complete)
|
|
271
|
+
```bash
|
|
272
|
+
$ cakemail contacts export 123
|
|
273
|
+
{"export_id":456,"status":"completed"}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**Marketer** - Full progress with spinner
|
|
277
|
+
```bash
|
|
278
|
+
$ cakemail contacts export 123
|
|
279
|
+
⠋ Exporting contacts... (attempt 1/30, 5s elapsed)
|
|
280
|
+
⠙ Exporting contacts... (attempt 2/30, 10s elapsed)
|
|
281
|
+
✓ Export complete
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**Balanced** - Simple progress
|
|
285
|
+
```bash
|
|
286
|
+
$ cakemail contacts export 123
|
|
287
|
+
Exporting contacts...
|
|
288
|
+
✓ Export complete
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
### Error Messages
|
|
294
|
+
|
|
295
|
+
Errors adapt to your technical level:
|
|
296
|
+
|
|
297
|
+
**Developer** - Technical details
|
|
298
|
+
```
|
|
299
|
+
Error: HTTP 404 Not Found
|
|
300
|
+
Resource: Campaign (ID: 999)
|
|
301
|
+
Endpoint: GET /campaigns/999
|
|
302
|
+
Response: {"error":"resource_not_found","message":"Campaign not found"}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**Marketer** - Friendly explanation
|
|
306
|
+
```
|
|
307
|
+
✗ Campaign not found
|
|
308
|
+
Campaign with ID '999' doesn't exist
|
|
309
|
+
|
|
310
|
+
💡 Tip: To see all campaigns, use:
|
|
311
|
+
cakemail campaigns list
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
**Balanced** - Clear and actionable
|
|
315
|
+
```
|
|
316
|
+
Error: Campaign not found (ID: 999)
|
|
317
|
+
Suggestion: Use 'cakemail campaigns list' to see available campaigns
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
### List Defaults
|
|
323
|
+
|
|
324
|
+
Profiles control default pagination and sorting behavior for list commands.
|
|
325
|
+
|
|
326
|
+
**Developer Profile** - API defaults
|
|
327
|
+
```bash
|
|
328
|
+
$ cakemail campaigns list
|
|
329
|
+
# Returns 50 items per page (API default)
|
|
330
|
+
# Uses API default sort order
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
**Marketer Profile** - Curated experience
|
|
334
|
+
```bash
|
|
335
|
+
$ cakemail campaigns list
|
|
336
|
+
# Returns 25 items per page (more manageable)
|
|
337
|
+
# Sorts by newest first (-created_on)
|
|
338
|
+
# Shows: "Showing 1-25 of 150 • Page 1 of 6"
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
**Balanced Profile** - API defaults
|
|
342
|
+
```bash
|
|
343
|
+
$ cakemail campaigns list
|
|
344
|
+
# Returns 50 items per page (API default)
|
|
345
|
+
# Uses API default sort order
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**Override with Explicit Flags:**
|
|
349
|
+
```bash
|
|
350
|
+
# All profiles respect explicit flags
|
|
351
|
+
$ cakemail campaigns list --limit 50 --sort "+name"
|
|
352
|
+
# Returns 50 items sorted by name (regardless of profile)
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
**Affected Commands:**
|
|
356
|
+
- `campaigns list`
|
|
357
|
+
- `contacts list`
|
|
358
|
+
- `lists list`
|
|
359
|
+
- `senders list`
|
|
360
|
+
- `templates list`
|
|
361
|
+
- All other list operations
|
|
362
|
+
|
|
363
|
+
**Why Different Defaults?**
|
|
364
|
+
- **Developer**: Wants full control, prefers API behavior (50 items, default sort)
|
|
365
|
+
- **Marketer**: Benefits from smaller pages and newest-first sorting (25 items, `-created_on`)
|
|
366
|
+
- **Balanced**: Uses API defaults for consistency (50 items, default sort)
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## Profile Management
|
|
371
|
+
|
|
372
|
+
### View Current Profile
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
cakemail config profile
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
**Output:**
|
|
379
|
+
```
|
|
380
|
+
Current Profile: balanced
|
|
381
|
+
|
|
382
|
+
Settings:
|
|
383
|
+
Output Format: table
|
|
384
|
+
Color Scheme: moderate
|
|
385
|
+
Date Format: friendly
|
|
386
|
+
Show Progress: true
|
|
387
|
+
Interactive Prompts: auto
|
|
388
|
+
Confirmations: auto
|
|
389
|
+
Error Style: balanced
|
|
390
|
+
Show Tips: auto
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
### Switch Profiles
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
# Switch to developer mode
|
|
399
|
+
cakemail config profile-set developer
|
|
400
|
+
|
|
401
|
+
# Switch to marketer mode
|
|
402
|
+
cakemail config profile-set marketer
|
|
403
|
+
|
|
404
|
+
# Switch to balanced mode (default)
|
|
405
|
+
cakemail config profile-set balanced
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
### Preview Before Switching
|
|
411
|
+
|
|
412
|
+
See what a profile looks like before committing:
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
cakemail config preview developer
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
**Output:**
|
|
419
|
+
```
|
|
420
|
+
Developer Profile Settings:
|
|
421
|
+
Output Format: json
|
|
422
|
+
Color Scheme: none
|
|
423
|
+
Date Format: iso8601
|
|
424
|
+
Show Progress: false
|
|
425
|
+
Interactive Prompts: never
|
|
426
|
+
Confirmations: never
|
|
427
|
+
Error Style: technical
|
|
428
|
+
Show Tips: false
|
|
429
|
+
|
|
430
|
+
This profile is optimized for:
|
|
431
|
+
- Automation and scripting
|
|
432
|
+
- CI/CD pipelines
|
|
433
|
+
- Fast, non-interactive execution
|
|
434
|
+
- Machine-readable output
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
### Override Profile Once
|
|
440
|
+
|
|
441
|
+
Use a different profile for a single command without switching:
|
|
442
|
+
|
|
443
|
+
```bash
|
|
444
|
+
# Use developer mode just for this command
|
|
445
|
+
cakemail --profile developer campaigns list
|
|
446
|
+
|
|
447
|
+
# Use marketer mode just for this command
|
|
448
|
+
cakemail --profile marketer campaigns create
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
---
|
|
452
|
+
|
|
453
|
+
### Customize Profile Settings
|
|
454
|
+
|
|
455
|
+
Profiles provide defaults, but you can customize individual settings:
|
|
456
|
+
|
|
457
|
+
```bash
|
|
458
|
+
# Keep balanced profile, but use JSON output
|
|
459
|
+
cakemail config set output_format json
|
|
460
|
+
|
|
461
|
+
# Keep developer profile, but enable colors
|
|
462
|
+
cakemail config set color_scheme moderate
|
|
463
|
+
|
|
464
|
+
# View all custom settings
|
|
465
|
+
cakemail config show
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
---
|
|
469
|
+
|
|
470
|
+
### Reset to Profile Defaults
|
|
471
|
+
|
|
472
|
+
Remove customizations and restore profile defaults:
|
|
473
|
+
|
|
474
|
+
```bash
|
|
475
|
+
cakemail config reset
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
---
|
|
479
|
+
|
|
480
|
+
## Batch Mode
|
|
481
|
+
|
|
482
|
+
Disable all interactive features for a single command:
|
|
483
|
+
|
|
484
|
+
```bash
|
|
485
|
+
# Force non-interactive mode (regardless of profile)
|
|
486
|
+
cakemail --batch campaigns create --name "Newsletter" --list-id 123 --sender-id 456
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
**Batch mode:**
|
|
490
|
+
- Disables all prompts
|
|
491
|
+
- Skips all confirmations
|
|
492
|
+
- Hides progress indicators
|
|
493
|
+
- Returns errors immediately
|
|
494
|
+
|
|
495
|
+
**Use batch mode for:**
|
|
496
|
+
- CI/CD pipelines
|
|
497
|
+
- Cron jobs
|
|
498
|
+
- Shell scripts
|
|
499
|
+
- Automated workflows
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
## Environment Detection
|
|
504
|
+
|
|
505
|
+
The CLI automatically detects its environment:
|
|
506
|
+
|
|
507
|
+
**Interactive Terminal (TTY)**
|
|
508
|
+
- Prompts enabled (balanced/marketer profiles)
|
|
509
|
+
- Colors enabled
|
|
510
|
+
- Progress indicators shown
|
|
511
|
+
- Confirmations shown
|
|
512
|
+
|
|
513
|
+
**Non-Interactive (Pipe, CI, Cron)**
|
|
514
|
+
- Prompts disabled
|
|
515
|
+
- Colors may be disabled
|
|
516
|
+
- Progress indicators hidden
|
|
517
|
+
- Confirmations skipped
|
|
518
|
+
|
|
519
|
+
**Environment Variables:**
|
|
520
|
+
```bash
|
|
521
|
+
# Force batch mode
|
|
522
|
+
export CAKEMAIL_BATCH_MODE=true
|
|
523
|
+
|
|
524
|
+
# Detected automatically:
|
|
525
|
+
# - CI=true (GitLab, Travis, Jenkins)
|
|
526
|
+
# - GITHUB_ACTIONS=true
|
|
527
|
+
# - Non-TTY input/output
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
## Profile Configuration Storage
|
|
533
|
+
|
|
534
|
+
Profile settings are stored in:
|
|
535
|
+
```
|
|
536
|
+
~/.cakemail/config.json
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
**Example config.json:**
|
|
540
|
+
```json
|
|
541
|
+
{
|
|
542
|
+
"profile": "balanced",
|
|
543
|
+
"custom_settings": {
|
|
544
|
+
"output_format": "json"
|
|
545
|
+
},
|
|
546
|
+
"auth": {
|
|
547
|
+
"access_token": "your_token"
|
|
548
|
+
},
|
|
549
|
+
"defaults": {
|
|
550
|
+
"current_account_id": 12345
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
**Migration from .env:**
|
|
556
|
+
- First time you run the new system, credentials are migrated from `.env`
|
|
557
|
+
- `.env` files still work (backward compatible)
|
|
558
|
+
- Profile settings only in `config.json`
|
|
559
|
+
|
|
560
|
+
---
|
|
561
|
+
|
|
562
|
+
## Configuration Priority
|
|
563
|
+
|
|
564
|
+
When multiple config sources exist:
|
|
565
|
+
|
|
566
|
+
1. **CLI flags** (highest priority)
|
|
567
|
+
```bash
|
|
568
|
+
cakemail --profile developer -f table campaigns list
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
2. **Custom settings**
|
|
572
|
+
```bash
|
|
573
|
+
cakemail config set output_format json
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
3. **Profile defaults**
|
|
577
|
+
```bash
|
|
578
|
+
cakemail config profile-set balanced
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
4. **Environment variables**
|
|
582
|
+
```bash
|
|
583
|
+
export CAKEMAIL_OUTPUT_FORMAT=compact
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
5. **Hard-coded defaults** (lowest priority)
|
|
587
|
+
|
|
588
|
+
---
|
|
589
|
+
|
|
590
|
+
## Use Cases & Examples
|
|
591
|
+
|
|
592
|
+
### Use Case 1: Developer Writing a Script
|
|
593
|
+
|
|
594
|
+
**Goal:** Fast, non-interactive JSON output
|
|
595
|
+
|
|
596
|
+
```bash
|
|
597
|
+
# Set developer profile once
|
|
598
|
+
cakemail config profile-set developer
|
|
599
|
+
|
|
600
|
+
# Script runs without prompts or confirmations
|
|
601
|
+
#!/bin/bash
|
|
602
|
+
campaigns=$(cakemail campaigns list)
|
|
603
|
+
echo "$campaigns" | jq '.data[] | select(.status == "draft")'
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
### Use Case 2: Marketer Running Manual Commands
|
|
609
|
+
|
|
610
|
+
**Goal:** Guided, safe, visual output
|
|
611
|
+
|
|
612
|
+
```bash
|
|
613
|
+
# Set marketer profile
|
|
614
|
+
cakemail config profile-set marketer
|
|
615
|
+
|
|
616
|
+
# Interactive creation with guidance
|
|
617
|
+
cakemail campaigns create
|
|
618
|
+
# [Interactive prompts guide you through]
|
|
619
|
+
|
|
620
|
+
# Safe deletion with confirmation
|
|
621
|
+
cakemail campaigns delete 789
|
|
622
|
+
# [Confirms before deleting]
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
---
|
|
626
|
+
|
|
627
|
+
### Use Case 3: Team Lead Using Both
|
|
628
|
+
|
|
629
|
+
**Goal:** Interactive when exploring, non-interactive when automating
|
|
630
|
+
|
|
631
|
+
```bash
|
|
632
|
+
# Use balanced profile (default)
|
|
633
|
+
cakemail config profile-set balanced
|
|
634
|
+
|
|
635
|
+
# Interactive when in terminal
|
|
636
|
+
cakemail campaigns create
|
|
637
|
+
# [Shows prompts in TTY]
|
|
638
|
+
|
|
639
|
+
# Automatic in scripts
|
|
640
|
+
./deploy-campaign.sh
|
|
641
|
+
# [No prompts in script]
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
---
|
|
645
|
+
|
|
646
|
+
### Use Case 4: CI/CD Pipeline
|
|
647
|
+
|
|
648
|
+
**Goal:** Fully automated, machine-readable
|
|
649
|
+
|
|
650
|
+
```bash
|
|
651
|
+
# In CI environment (GitHub Actions, GitLab CI, etc.)
|
|
652
|
+
# Automatically detects CI and disables interactivity
|
|
653
|
+
|
|
654
|
+
# Or explicitly use developer profile
|
|
655
|
+
cakemail --profile developer campaigns list
|
|
656
|
+
|
|
657
|
+
# Or use --batch flag
|
|
658
|
+
cakemail --batch campaigns create --name "Auto Newsletter" --list-id 123 --sender-id 456
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
---
|
|
662
|
+
|
|
663
|
+
## Troubleshooting
|
|
664
|
+
|
|
665
|
+
### Profile Not Applying
|
|
666
|
+
|
|
667
|
+
**Problem:** Changes to profile don't seem to take effect
|
|
668
|
+
|
|
669
|
+
**Solutions:**
|
|
670
|
+
1. Check custom settings override profile:
|
|
671
|
+
```bash
|
|
672
|
+
cakemail config show
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
2. Reset custom settings:
|
|
676
|
+
```bash
|
|
677
|
+
cakemail config reset
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
3. Check environment variables:
|
|
681
|
+
```bash
|
|
682
|
+
env | grep CAKEMAIL
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
### Unwanted Prompts in Scripts
|
|
688
|
+
|
|
689
|
+
**Problem:** Script hangs waiting for input
|
|
690
|
+
|
|
691
|
+
**Solutions:**
|
|
692
|
+
1. Use developer profile:
|
|
693
|
+
```bash
|
|
694
|
+
cakemail config profile-set developer
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
2. Use `--batch` flag:
|
|
698
|
+
```bash
|
|
699
|
+
cakemail --batch campaigns create --name "Newsletter" --list-id 123
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
3. Provide all required parameters:
|
|
703
|
+
```bash
|
|
704
|
+
cakemail campaigns create --name "Newsletter" --list-id 123 --sender-id 456
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
---
|
|
708
|
+
|
|
709
|
+
### Missing Confirmations
|
|
710
|
+
|
|
711
|
+
**Problem:** Deletions happen without confirmation
|
|
712
|
+
|
|
713
|
+
**Solutions:**
|
|
714
|
+
1. Check current profile:
|
|
715
|
+
```bash
|
|
716
|
+
cakemail config profile
|
|
717
|
+
```
|
|
718
|
+
|
|
719
|
+
2. Switch to marketer or balanced:
|
|
720
|
+
```bash
|
|
721
|
+
cakemail config profile-set balanced
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
3. Confirmations are skipped in:
|
|
725
|
+
- Developer profile
|
|
726
|
+
- CI environments
|
|
727
|
+
- Non-TTY contexts
|
|
728
|
+
- When using `--force` flag
|
|
729
|
+
|
|
730
|
+
---
|
|
731
|
+
|
|
732
|
+
## Best Practices
|
|
733
|
+
|
|
734
|
+
### 1. Choose the Right Profile
|
|
735
|
+
|
|
736
|
+
- **Developer**: CI/CD, automation, scripting
|
|
737
|
+
- **Marketer**: Manual operations, learning, safety-critical tasks
|
|
738
|
+
- **Balanced**: Most users, mixed usage
|
|
739
|
+
|
|
740
|
+
### 2. Override When Needed
|
|
741
|
+
|
|
742
|
+
Don't switch profiles frequently. Instead, use `--profile` for one-off changes:
|
|
743
|
+
```bash
|
|
744
|
+
# Keep your default, but use developer mode once
|
|
745
|
+
cakemail --profile developer campaigns list
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
### 3. Use Batch Mode in Scripts
|
|
749
|
+
|
|
750
|
+
Always use `--batch` in scripts to prevent hangs:
|
|
751
|
+
```bash
|
|
752
|
+
#!/bin/bash
|
|
753
|
+
cakemail --batch campaigns create --name "Newsletter" --list-id 123 --sender-id 456
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
### 4. Customize Minimally
|
|
757
|
+
|
|
758
|
+
Let profiles provide defaults. Only customize when truly needed:
|
|
759
|
+
```bash
|
|
760
|
+
# Good: Use profile defaults
|
|
761
|
+
cakemail config profile-set balanced
|
|
762
|
+
|
|
763
|
+
# Avoid: Over-customizing defeats the purpose
|
|
764
|
+
cakemail config set output_format json
|
|
765
|
+
cakemail config set color_scheme rich
|
|
766
|
+
cakemail config set date_format relative
|
|
767
|
+
# ... (now you've rebuilt marketer profile manually)
|
|
768
|
+
```
|
|
769
|
+
|
|
770
|
+
---
|
|
771
|
+
|