@revfleet/hscli 0.8.7 → 0.8.11

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 (113) hide show
  1. package/CHANGELOG.md +247 -0
  2. package/CONTRIBUTING.md +120 -0
  3. package/README.md +42 -8
  4. package/brand/readme-hero.svg +25 -0
  5. package/dist/cli.js +35 -0
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/account/index.js +5 -6
  8. package/dist/commands/account/index.js.map +1 -1
  9. package/dist/commands/api/index.js +43 -3
  10. package/dist/commands/api/index.js.map +1 -1
  11. package/dist/commands/auth/index.js +74 -13
  12. package/dist/commands/auth/index.js.map +1 -1
  13. package/dist/commands/cms/hubdb.js +31 -0
  14. package/dist/commands/cms/hubdb.js.map +1 -1
  15. package/dist/commands/cms/index.js +27 -0
  16. package/dist/commands/cms/index.js.map +1 -1
  17. package/dist/commands/cms/source-code.js +21 -0
  18. package/dist/commands/cms/source-code.js.map +1 -1
  19. package/dist/commands/communication-preferences/index.js +11 -12
  20. package/dist/commands/communication-preferences/index.js.map +1 -1
  21. package/dist/commands/crm/activities.d.ts +3 -0
  22. package/dist/commands/crm/activities.js +186 -0
  23. package/dist/commands/crm/activities.js.map +1 -0
  24. package/dist/commands/crm/index.js +4 -0
  25. package/dist/commands/crm/index.js.map +1 -1
  26. package/dist/commands/crm/migration.d.ts +3 -0
  27. package/dist/commands/crm/migration.js +155 -0
  28. package/dist/commands/crm/migration.js.map +1 -0
  29. package/dist/commands/crm/properties.js +105 -18
  30. package/dist/commands/crm/properties.js.map +1 -1
  31. package/dist/commands/crm/property-batch.d.ts +34 -0
  32. package/dist/commands/crm/property-batch.js +205 -0
  33. package/dist/commands/crm/property-batch.js.map +1 -0
  34. package/dist/commands/crm/shared.d.ts +1 -0
  35. package/dist/commands/crm/shared.js +3 -4
  36. package/dist/commands/crm/shared.js.map +1 -1
  37. package/dist/commands/doctor/index.js +119 -1
  38. package/dist/commands/doctor/index.js.map +1 -1
  39. package/dist/commands/events/index.js +7 -8
  40. package/dist/commands/events/index.js.map +1 -1
  41. package/dist/commands/forms/index.js +47 -6
  42. package/dist/commands/forms/index.js.map +1 -1
  43. package/dist/commands/forms/legacy-v2.d.ts +6 -0
  44. package/dist/commands/forms/legacy-v2.js +350 -0
  45. package/dist/commands/forms/legacy-v2.js.map +1 -0
  46. package/dist/commands/forms/property-preflight.d.ts +20 -0
  47. package/dist/commands/forms/property-preflight.js +99 -0
  48. package/dist/commands/forms/property-preflight.js.map +1 -0
  49. package/dist/commands/guide/index.d.ts +3 -0
  50. package/dist/commands/guide/index.js +231 -0
  51. package/dist/commands/guide/index.js.map +1 -0
  52. package/dist/commands/marketing/index.js +3 -4
  53. package/dist/commands/marketing/index.js.map +1 -1
  54. package/dist/commands/settings/index.js +249 -14
  55. package/dist/commands/settings/index.js.map +1 -1
  56. package/dist/core/auth.d.ts +7 -1
  57. package/dist/core/auth.js +45 -7
  58. package/dist/core/auth.js.map +1 -1
  59. package/dist/core/http.d.ts +43 -0
  60. package/dist/core/http.js +227 -57
  61. package/dist/core/http.js.map +1 -1
  62. package/dist/core/output.d.ts +2 -0
  63. package/dist/core/output.js +1 -1
  64. package/dist/core/output.js.map +1 -1
  65. package/dist/core/plugins.d.ts +5 -2
  66. package/dist/core/plugins.js +18 -1
  67. package/dist/core/plugins.js.map +1 -1
  68. package/dist/core/scopes.d.ts +29 -0
  69. package/dist/core/scopes.js +415 -0
  70. package/dist/core/scopes.js.map +1 -0
  71. package/dist/core/telemetry-context.d.ts +13 -0
  72. package/dist/core/telemetry-context.js +30 -0
  73. package/dist/core/telemetry-context.js.map +1 -0
  74. package/dist/mcp/ext-tools.d.ts +1 -1
  75. package/dist/mcp/ext-tools.js +52 -1
  76. package/dist/mcp/ext-tools.js.map +1 -1
  77. package/dist/mcp/hubspot-modules.d.ts +30 -0
  78. package/dist/mcp/hubspot-modules.js +305 -0
  79. package/dist/mcp/hubspot-modules.js.map +1 -0
  80. package/dist/mcp/server.d.ts +2 -0
  81. package/dist/mcp/server.js +120 -48
  82. package/dist/mcp/server.js.map +1 -1
  83. package/docs/ARCHITECTURE.md +39 -0
  84. package/docs/CAPABILITY_LIBRARY.md +639 -0
  85. package/docs/CMS_SETUP.md +349 -0
  86. package/docs/COMMAND_COMPATIBILITY.md +24 -0
  87. package/docs/COMMAND_TREE.md +199 -0
  88. package/docs/COMMERCE_SETUP.md +400 -0
  89. package/docs/COMPARISON.md +146 -0
  90. package/docs/COOKBOOK.md +896 -0
  91. package/docs/INTEGRATIONS_NOTIFICATIONS_SETUP.md +352 -0
  92. package/docs/MARKETING_SETUP.md +509 -0
  93. package/docs/MCP.md +172 -0
  94. package/docs/OPERATIONAL_PLAYBOOKS.md +322 -0
  95. package/docs/OPERATIONS_SETUP.md +362 -0
  96. package/docs/PLUGIN_GUIDE.md +158 -0
  97. package/docs/POLICY_EXAMPLE.json +57 -0
  98. package/docs/PORTAL_SETUP.md +684 -0
  99. package/docs/PUBLISHING.md +154 -0
  100. package/docs/RELEASE_GOVERNANCE.md +34 -0
  101. package/docs/REPORTING_SETUP.md +310 -0
  102. package/docs/ROADMAP-DATE-BASED-API.md +103 -0
  103. package/docs/ROADMAP_PHASE1_TO_3.md +96 -0
  104. package/docs/SAFETY_MODEL.md +40 -0
  105. package/docs/SALES_SETUP.md +369 -0
  106. package/docs/SERVICE_SETUP.md +403 -0
  107. package/docs/TESTING_PLAN.md +89 -0
  108. package/docs/TIERS.md +320 -0
  109. package/docs/TUTORIALS/audit-portal-writes.md +150 -0
  110. package/docs/TUTORIALS/secure-agent-writes.md +177 -0
  111. package/docs/TUTORIALS/trace-replay-repro.md +147 -0
  112. package/docs/WHY_HOW_WHAT.md +81 -0
  113. package/package.json +7 -2
@@ -0,0 +1,509 @@
1
+ # Marketing Setup Guide
2
+
3
+ > See also: [PORTAL_SETUP.md](PORTAL_SETUP.md) · [SALES_SETUP.md](SALES_SETUP.md) · [REPORTING_SETUP.md](REPORTING_SETUP.md)
4
+
5
+ Complete configuration guide for HubSpot Marketing Hub settings. Covers email, campaigns, forms, ads, social, SEO, lead scoring, and ABM. Each section shows the UI path, settings, and hscli commands where API support exists.
6
+
7
+ **Prerequisites:**
8
+ - Portal authenticated (`hscli auth whoami`)
9
+ - Private App scopes: `marketing-email`, `marketing.campaigns.read/write`, `forms`, `content`
10
+ - Domain and email authentication complete (see [PORTAL_SETUP.md](./PORTAL_SETUP.md) Phase 2)
11
+
12
+ ---
13
+
14
+ ## 1. Email Configuration
15
+
16
+ **Where:** Settings > Marketing > Email
17
+
18
+ ### 1.1 Sending Domains
19
+
20
+ | Setting | What to configure | Why it matters |
21
+ |---------|-------------------|----------------|
22
+ | Sending domain | Your authenticated email domain (e.g., `yourcompany.com`) | Emails sent from unauthenticated domains land in spam |
23
+ | DKIM/SPF records | DNS records provided by HubSpot | Proves email authenticity, improves deliverability |
24
+ | DMARC policy | TXT record at your DNS registrar | Controls what happens when authentication fails |
25
+
26
+ > **API:** Domain verification is UI + DNS only. No hscli command.
27
+
28
+ ### 1.2 Subscription Types
29
+
30
+ **Where:** Settings > Marketing > Email > Subscription Types
31
+
32
+ | Setting | What to configure | Why it matters |
33
+ |---------|-------------------|----------------|
34
+ | Subscription types | Define categories (Marketing, Sales, Newsletter, Product Updates, etc.) | Contacts opt in/out per type — required for CAN-SPAM/GDPR |
35
+ | Default subscription | Which type new contacts are enrolled in | Controls initial email eligibility |
36
+ | Opt-in process | Single opt-in vs double opt-in | Double opt-in required in some jurisdictions (Germany, Austria) |
37
+
38
+ > **API:** Subscription types can be managed via the Email Subscriptions API. Scope: `communication_preferences.read/write`.
39
+
40
+ ### 1.3 Email Footer & Compliance
41
+
42
+ **Where:** Settings > Marketing > Email > Configuration > Footer
43
+
44
+ | Setting | What to configure | Why it matters |
45
+ |---------|-------------------|----------------|
46
+ | Company name | Legal entity name | CAN-SPAM requirement |
47
+ | Company address | Full physical mailing address | CAN-SPAM requirement — must appear in every marketing email |
48
+ | Unsubscribe link | Automatically included by HubSpot | Required by law — do not remove |
49
+
50
+ ### 1.4 Frequency Caps
51
+
52
+ **Where:** Settings > Marketing > Email > Configuration > Frequency
53
+
54
+ | Setting | What to configure | Why it matters |
55
+ |---------|-------------------|----------------|
56
+ | Max emails per contact | Limit per time period (e.g., max 3/week) | Prevents over-sending and unsubscribes |
57
+ | Non-marketing emails | Whether transactional emails count toward the cap | Transactional emails typically bypass frequency caps |
58
+ | Time window | Daily, weekly, or monthly cap period | Match to your sending cadence |
59
+
60
+ ### 1.5 Email Health
61
+
62
+ **Where:** Settings > Marketing > Email > Health
63
+
64
+ | Setting | What to configure | Why it matters |
65
+ |---------|-------------------|----------------|
66
+ | Hard bounce handling | Auto-remove hard bounces | Protects sender reputation |
67
+ | Graymail suppression | Enable/disable | Stops sending to contacts who never open |
68
+ | Spam complaint threshold | Monitor via postmaster tools | High complaint rates trigger ISP blocks |
69
+
70
+ > **API:** UI only. Monitor via HubSpot email health dashboard.
71
+
72
+ ---
73
+
74
+ ## 2. Email Templates & Design
75
+
76
+ **Where:** Marketing > Email > Templates (or Design Manager)
77
+
78
+ | Setting | What to configure | Why it matters |
79
+ |---------|-------------------|----------------|
80
+ | Brand kit colors | Primary, secondary, accent colors | Consistent branding across all emails |
81
+ | Default font | Font family and sizes | Brand consistency |
82
+ | Logo placement | Header logo and dimensions | Automatic inclusion in templates |
83
+ | Saved sections | Reusable content blocks (headers, footers, CTAs) | Speeds up email creation |
84
+ | Global modules | Shared modules across templates | Single update propagates everywhere |
85
+
86
+ **hscli:**
87
+ ```bash
88
+ # List email templates
89
+ hscli marketing emails list --limit 20
90
+
91
+ # Get email details
92
+ hscli marketing emails get <emailId>
93
+
94
+ # Create an email (requires template ID)
95
+ hscli marketing emails create --data '{
96
+ "name": "March Newsletter",
97
+ "subject": "Your Monthly Update",
98
+ "type": "REGULAR"
99
+ }' --force
100
+ ```
101
+
102
+ > **API:** `marketing-email` scope. Emails can be created, updated, and listed via API. Template design is primarily UI-based.
103
+
104
+ ---
105
+
106
+ ## 3. Marketing Campaigns
107
+
108
+ **Where:** Marketing > Campaigns
109
+
110
+ Campaigns are containers that group related marketing assets (emails, landing pages, forms, CTAs, social posts, ads, workflows) for unified tracking and ROI reporting.
111
+
112
+ | Setting | What to configure | Why it matters |
113
+ |---------|-------------------|----------------|
114
+ | Campaign name | Descriptive name (e.g., "Q1 2026 Product Launch") | Organizes marketing efforts |
115
+ | Goal | Campaign objective (awareness, lead gen, etc.) | Tracks success metrics |
116
+ | Audience | Target segment or list | Defines who sees the campaign |
117
+ | Start/end dates | Campaign duration | Bounds reporting windows |
118
+ | Budget | Planned spend | ROI calculation |
119
+ | Associated assets | Emails, landing pages, forms, CTAs, blog posts, social posts | All attributed to this campaign |
120
+
121
+ **hscli:**
122
+ ```bash
123
+ # List campaigns
124
+ hscli marketing campaigns list --limit 20
125
+
126
+ # Get campaign details
127
+ hscli marketing campaigns get <campaignId>
128
+
129
+ # Create a campaign
130
+ hscli marketing campaigns create --data '{
131
+ "name": "Q1 Product Launch",
132
+ "type": "CONTENT_CAMPAIGN"
133
+ }' --force
134
+ ```
135
+
136
+ > **API:** `marketing.campaigns.read/write` scope. Campaign CRUD is supported. Asset association is done via each asset's campaign property.
137
+
138
+ ---
139
+
140
+ ## 4. Landing Pages
141
+
142
+ **Where:** Marketing > Landing Pages (creation) | Settings > Content > Templates (defaults)
143
+
144
+ | Setting | What to configure | Why it matters |
145
+ |---------|-------------------|----------------|
146
+ | Default template | Choose starter template or custom theme template | Consistency across landing pages |
147
+ | Custom domain | Landing page subdomain (e.g., `go.yourcompany.com`) | Professional URLs, branded experience |
148
+ | Default meta description | SEO meta for new pages | Search engine visibility |
149
+ | Thank-you redirect | Default post-submission URL or inline thank-you message | Conversion flow completion |
150
+ | A/B testing | Enable variation testing | Optimize conversion rates |
151
+ | Stylesheets | Global CSS for landing pages | Consistent design without per-page styling |
152
+
153
+ > **API:** Landing pages are a subset of CMS pages. Use the Pages API with `content` scope. hscli `cms pages` commands can manage landing pages.
154
+
155
+ **hscli:**
156
+ ```bash
157
+ # List landing pages
158
+ hscli cms pages list --limit 10
159
+
160
+ # Get a specific page
161
+ hscli cms pages get <pageId>
162
+ ```
163
+
164
+ ---
165
+
166
+ ## 5. Forms
167
+
168
+ **Where:** Marketing > Forms (creation) | Settings > Marketing > Forms (defaults)
169
+
170
+ ### 5.1 Form Defaults
171
+
172
+ | Setting | What to configure | Why it matters |
173
+ |---------|-------------------|----------------|
174
+ | Submission notifications | Email address(es) to notify on form submit | Sales team gets notified of new leads |
175
+ | Follow-up emails | Auto-send email after submission | Confirm receipt, deliver promised content |
176
+ | Cookie tracking | Enable/disable form pre-fill from cookies | Progressive profiling depends on this |
177
+ | CAPTCHA | Enable reCAPTCHA | Block spam submissions |
178
+
179
+ ### 5.2 Form Field Types
180
+
181
+ | Field type | Use case |
182
+ |------------|----------|
183
+ | Text (single-line) | Names, titles, short answers |
184
+ | Text (multi-line) | Comments, descriptions |
185
+ | Dropdown select | Predefined options (industry, country) |
186
+ | Radio buttons | Single selection from small set |
187
+ | Checkboxes | Multi-selection (interests, products) |
188
+ | Date picker | Dates (event dates, birthdays) |
189
+ | File upload | Documents, images |
190
+ | Number | Numeric values (employee count, revenue) |
191
+ | Dependent fields | Show field B only when field A = X |
192
+
193
+ ### 5.3 Progressive Profiling
194
+
195
+ **Where:** Form editor > Field settings > Progressive fields
196
+
197
+ | Setting | What to configure | Why it matters |
198
+ |---------|-------------------|----------------|
199
+ | Queued questions | Fields shown only when known fields are already populated | Gathers more data over time without long forms |
200
+ | Max queued per visit | How many progressive fields per submission | Balances data collection with user experience |
201
+
202
+ **hscli:**
203
+ ```bash
204
+ # List all forms
205
+ hscli forms list --limit 20
206
+
207
+ # Get form details (fields, configuration)
208
+ hscli forms get <formId>
209
+
210
+ # Create a form
211
+ hscli forms create --data '{
212
+ "name": "Contact Us",
213
+ "formType": "hubspot",
214
+ "configuration": {
215
+ "language": "en",
216
+ "postSubmitAction": {"type": "thank_you", "value": "Thanks for reaching out!"}
217
+ },
218
+ "fieldGroups": [
219
+ {"fields": [{"name": "email", "required": true}]},
220
+ {"fields": [{"name": "firstname"}, {"name": "lastname"}]},
221
+ {"fields": [{"name": "message", "fieldType": "textarea"}]}
222
+ ]
223
+ }' --force
224
+
225
+ # Replay a legacy /forms/v2/forms export into the current /marketing/v3/forms API
226
+ hscli forms create --source-format v2 --data '{"name":"Legacy form","submitText":"Submit","formFieldGroups":[{"fields":[{"name":"email","label":"Email","fieldType":"email","required":true}]}]}' --dry-run
227
+
228
+ # Real legacy writes preflight target CRM properties and skip missing fields; add --strict to fail instead
229
+ hscli forms create --source-format v2 --strict --data '{"name":"Legacy form","formFieldGroups":[{"fields":[{"name":"email","label":"Email","fieldType":"email","required":true}]}]}' --dry-run
230
+ ```
231
+
232
+ > **API:** `forms` scope. Full CRUD on forms including field configuration. Legacy forms/v2 payloads are auto-translated on create/update when detected; use `hscli forms translate-v2` to inspect the v3 payload before replay. During real writes, hscli preflights target CRM properties, skips missing fields by default, and auto-splits field groups to HubSpot's 3-field v3 limit.
233
+
234
+ ---
235
+
236
+ ## 6. Ads
237
+
238
+ **Where:** Settings > Marketing > Ads
239
+
240
+ ### 6.1 Connect Ad Accounts
241
+
242
+ | Platform | What to connect | Requirements |
243
+ |----------|----------------|--------------|
244
+ | Google Ads | Google Ads account | Google account with Ads access |
245
+ | Facebook/Meta Ads | Facebook Business Manager | Admin access to ad account |
246
+ | LinkedIn Ads | LinkedIn Campaign Manager | Campaign Manager access |
247
+
248
+ ### 6.2 Ad Settings
249
+
250
+ | Setting | What to configure | Why it matters |
251
+ |---------|-------------------|----------------|
252
+ | Auto-tracking | Automatically add tracking parameters to ad URLs | Attributes conversions to specific ads |
253
+ | Audience sync | Sync HubSpot lists to ad audiences | Target/exclude contacts in ad platforms |
254
+ | ROI reporting | Connect revenue data to ad spend | Measure true ad ROI |
255
+ | Lead sync | Auto-create contacts from lead gen forms | Facebook/LinkedIn lead form submissions create HubSpot contacts |
256
+ | Attribution window | How long after ad click to count conversion | Accurate attribution reporting |
257
+
258
+ > **API:** UI only for account connection. Ad performance data is available via the Analytics API.
259
+
260
+ ---
261
+
262
+ ## 7. Social Media
263
+
264
+ **Where:** Settings > Marketing > Social
265
+
266
+ ### 7.1 Connect Social Accounts
267
+
268
+ | Platform | Supported features |
269
+ |----------|-------------------|
270
+ | Facebook Pages | Publish, monitor, report |
271
+ | Instagram Business | Publish, monitor, report |
272
+ | Twitter/X | Publish, monitor |
273
+ | LinkedIn (company + personal) | Publish, report |
274
+ | YouTube | Monitoring only |
275
+
276
+ ### 7.2 Social Settings
277
+
278
+ | Setting | What to configure | Why it matters |
279
+ |---------|-------------------|----------------|
280
+ | Publishing defaults | Default accounts for new posts | Saves time in publishing workflow |
281
+ | Auto-publish blog posts | Share new blog posts automatically | Consistent promotion |
282
+ | Link shortening | Use HubSpot link shortener | Cleaner URLs, tracking |
283
+ | Social monitoring | Keywords, hashtags, mentions to track | Brand awareness, engagement |
284
+
285
+ > **API:** Social publishing is primarily UI. Some endpoints exist for reading social data via the Analytics API.
286
+
287
+ ---
288
+
289
+ ## 8. SEO
290
+
291
+ **Where:** Marketing > SEO (tool) | Settings > Content > SEO
292
+
293
+ | Setting | What to configure | Why it matters |
294
+ |---------|-------------------|----------------|
295
+ | Target domains | Which domains to track for SEO | Focus SEO efforts on your properties |
296
+ | Topic clusters | Core topics + pillar pages + subtopic content | Content strategy aligned to search intent |
297
+ | Recommendations | On-page SEO suggestions per page | Improves search ranking |
298
+ | Google Search Console | Connect for keyword data | See actual search queries driving traffic |
299
+ | Canonical URLs | Default canonical URL strategy | Prevents duplicate content penalties |
300
+ | Sitemap | Auto-generated sitemap | Search engines discover your pages |
301
+
302
+ > **API:** UI only. SEO tools are interactive and not exposed via API.
303
+
304
+ ---
305
+
306
+ ## 9. Lead Scoring
307
+
308
+ **Where:** Settings > Properties > Contact scoring (or Marketing > Lead Scoring for HubSpot Score)
309
+
310
+ ### 9.1 HubSpot Score (Manual)
311
+
312
+ | Criteria type | Examples | Points |
313
+ |---------------|----------|--------|
314
+ | **Positive attributes** | Viewed pricing page, downloaded whitepaper, attended webinar | +5 to +20 |
315
+ | **Negative attributes** | Unsubscribed, competitor domain, no activity in 90 days | -5 to -20 |
316
+ | **Demographic** | Job title = VP+, company size > 50, industry match | +10 to +15 |
317
+ | **Behavioral** | Form submissions, email opens/clicks, page views | +5 to +10 |
318
+
319
+ ### 9.2 Score Thresholds
320
+
321
+ | Threshold | Action |
322
+ |-----------|--------|
323
+ | Score >= 50 | Lifecycle stage → MQL |
324
+ | Score >= 80 | Lifecycle stage → SQL, notify sales |
325
+ | Score < 0 | Suppress from marketing emails |
326
+
327
+ ### 9.3 Predictive Lead Scoring (Enterprise)
328
+
329
+ **Where:** Settings > Properties > Predictive lead scoring (Enterprise only)
330
+
331
+ | Setting | What to configure | Why it matters |
332
+ |---------|-------------------|----------------|
333
+ | Likelihood to close | HubSpot AI model, auto-calculated | Prioritizes sales outreach |
334
+ | Contact priority | Tier 1/2/3 based on predictive score | Focus on highest-value leads |
335
+
336
+ > **API:** Lead score is a contact property (`hubspotscore`). Readable via API but scoring rules are configured in UI only.
337
+
338
+ **hscli:**
339
+ ```bash
340
+ # Read a contact's lead score
341
+ hscli crm contacts get <contactId> --json
342
+
343
+ # Search for MQLs with score above threshold
344
+ hscli crm contacts search --data '{
345
+ "filterGroups": [{
346
+ "filters": [{
347
+ "propertyName": "hubspotscore",
348
+ "operator": "GTE",
349
+ "value": "50"
350
+ }]
351
+ }],
352
+ "limit": 20
353
+ }'
354
+ ```
355
+
356
+ ---
357
+
358
+ ## 10. ABM (Account-Based Marketing)
359
+
360
+ **Where:** Contacts > Target Accounts (tool) | Settings > Properties > Company scoring
361
+
362
+ ### 10.1 Ideal Customer Profile (ICP)
363
+
364
+ | Property | Example criteria |
365
+ |----------|-----------------|
366
+ | Industry | SaaS, FinTech, Healthcare |
367
+ | Company size | 50–500 employees |
368
+ | Revenue | $5M–$50M ARR |
369
+ | Geography | North America, EU |
370
+ | Technology stack | Uses Salesforce, Slack, AWS |
371
+
372
+ ### 10.2 Target Account Tiers
373
+
374
+ | Tier | Description | Treatment |
375
+ |------|-------------|-----------|
376
+ | Tier 1 | Perfect ICP match, high revenue potential | 1:1 personalized outreach, dedicated rep |
377
+ | Tier 2 | Good ICP match, moderate potential | 1:few campaigns, semi-personalized |
378
+ | Tier 3 | Partial match, lower potential | 1:many programmatic campaigns |
379
+
380
+ ### 10.3 Company Scoring
381
+
382
+ | Setting | What to configure | Why it matters |
383
+ |---------|-------------------|----------------|
384
+ | ICP tier property | Custom company property for tier assignment | Segments target accounts |
385
+ | Buying role property | Contact role within the buying committee | Maps stakeholders per account |
386
+ | Target account flag | Boolean property on company | Enables ABM reporting and automation |
387
+
388
+ > **API:** Company properties are fully manageable via API. Target account designation is a company property.
389
+
390
+ **hscli:**
391
+ ```bash
392
+ # Search for Tier 1 target accounts
393
+ hscli crm companies search --data '{
394
+ "filterGroups": [{
395
+ "filters": [{
396
+ "propertyName": "icp_tier",
397
+ "operator": "EQ",
398
+ "value": "tier_1"
399
+ }]
400
+ }],
401
+ "limit": 50
402
+ }'
403
+
404
+ # Create ICP tier property
405
+ hscli crm properties create companies --data '{
406
+ "name": "icp_tier",
407
+ "label": "ICP Tier",
408
+ "type": "enumeration",
409
+ "fieldType": "select",
410
+ "groupName": "companyinformation",
411
+ "options": [
412
+ {"label": "Tier 1", "value": "tier_1", "displayOrder": 0},
413
+ {"label": "Tier 2", "value": "tier_2", "displayOrder": 1},
414
+ {"label": "Tier 3", "value": "tier_3", "displayOrder": 2}
415
+ ]
416
+ }' --force
417
+ ```
418
+
419
+ ---
420
+
421
+ ## Setup Checklist
422
+
423
+ ### Email Configuration
424
+ ```
425
+ [ ] Sending domain authenticated (DKIM + SPF verified)
426
+ [ ] DMARC record configured at DNS registrar
427
+ [ ] Subscription types defined (Marketing, Sales, Newsletter, etc.)
428
+ [ ] Default subscription type selected
429
+ [ ] Double opt-in enabled (if required by jurisdiction)
430
+ [ ] Email footer configured (company name + physical address)
431
+ [ ] Frequency caps set (max emails per contact per time period)
432
+ [ ] Hard bounce auto-removal enabled
433
+ [ ] Graymail suppression configured
434
+ ```
435
+
436
+ ### Email Templates & Design
437
+ ```
438
+ [ ] Brand kit colors configured
439
+ [ ] Default fonts set
440
+ [ ] Logo uploaded and placed in default header
441
+ [ ] Saved sections created (header, footer, CTA blocks)
442
+ [ ] Default email template selected
443
+ ```
444
+
445
+ ### Campaigns
446
+ ```
447
+ [ ] Campaign naming convention established
448
+ [ ] First campaign created with goal and dates
449
+ [ ] Assets associated (email, landing page, form, CTA)
450
+ ```
451
+
452
+ ### Landing Pages
453
+ ```
454
+ [ ] Default landing page template selected
455
+ [ ] Custom landing page domain configured (if applicable)
456
+ [ ] Default meta description set
457
+ [ ] Thank-you page/redirect configured
458
+ ```
459
+
460
+ ### Forms
461
+ ```
462
+ [ ] Default submission notification recipients set
463
+ [ ] CAPTCHA enabled on public-facing forms
464
+ [ ] Cookie tracking enabled for progressive profiling
465
+ [ ] At least one lead capture form created
466
+ [ ] Follow-up email configured for primary forms
467
+ ```
468
+
469
+ ### Ads
470
+ ```
471
+ [ ] Google Ads account connected (if applicable)
472
+ [ ] Facebook/Meta Ads account connected (if applicable)
473
+ [ ] LinkedIn Ads account connected (if applicable)
474
+ [ ] Auto-tracking enabled
475
+ [ ] Audience sync configured for key lists
476
+ ```
477
+
478
+ ### Social Media
479
+ ```
480
+ [ ] Facebook Page connected
481
+ [ ] LinkedIn company page connected
482
+ [ ] Instagram Business account connected (if applicable)
483
+ [ ] Twitter/X account connected (if applicable)
484
+ [ ] Auto-publish for blog posts configured (if desired)
485
+ ```
486
+
487
+ ### SEO
488
+ ```
489
+ [ ] Target domains configured
490
+ [ ] Google Search Console connected
491
+ [ ] At least one topic cluster created
492
+ [ ] Sitemap verified
493
+ ```
494
+
495
+ ### Lead Scoring
496
+ ```
497
+ [ ] Positive scoring attributes defined
498
+ [ ] Negative scoring attributes defined
499
+ [ ] Score thresholds set (MQL, SQL triggers)
500
+ [ ] Lifecycle stage automation tied to score thresholds
501
+ ```
502
+
503
+ ### ABM
504
+ ```
505
+ [ ] Ideal Customer Profile criteria defined
506
+ [ ] ICP tier property created on companies
507
+ [ ] Target accounts identified and tiered
508
+ [ ] Buying role property created on contacts (if applicable)
509
+ ```
package/docs/MCP.md ADDED
@@ -0,0 +1,172 @@
1
+ # MCP Support (`hscli mcp`)
2
+
3
+ > See also: [ARCHITECTURE.md](ARCHITECTURE.md) · [SAFETY_MODEL.md](SAFETY_MODEL.md) · [COMMAND_TREE.md](COMMAND_TREE.md)
4
+
5
+ `hscli` now exposes a Model Context Protocol (MCP) server over **stdio**.
6
+
7
+ ## Run
8
+
9
+ ```bash
10
+ npm run build
11
+ node dist/cli.js mcp
12
+ ```
13
+
14
+ Or if installed globally:
15
+
16
+ ```bash
17
+ hscli mcp
18
+ ```
19
+
20
+ ## Profile isolation and safety defaults
21
+
22
+ - **Profile isolation**: set `HSCLI_MCP_PROFILE=<profile>` to hard-lock the MCP server to one auth profile.
23
+ - If a tool call requests a different profile, the server rejects it.
24
+ - **Write tools are dry-run by default**:
25
+ - `force: true` is required to execute actual writes.
26
+ - Without `force`, write tools return a dry-run payload (`{ dryRun: true, method, path, body }`).
27
+ - **Lifecycle coverage for CRM objects**:
28
+ - standard object tools now include delete, merge, batch read/upsert/archive.
29
+ - **Strict object type allowlist**:
30
+ - Object tools: `contacts`, `companies`, `deals`, `tickets`
31
+ - Properties/associations object types: `contacts`, `companies`, `deals`, `tickets`
32
+ - Pipeline object types: `deals`, `tickets`
33
+ - **Secrets redaction**:
34
+ - Token-like fields and bearer strings are redacted in MCP tool outputs and errors.
35
+
36
+ ## Claude Desktop setup
37
+
38
+ Add a server entry in your Claude Desktop MCP config:
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "hscli": {
44
+ "command": "node",
45
+ "args": ["/absolute/path/to/hscli/dist/cli.js", "mcp"],
46
+ "env": {
47
+ "HSCLI_HOME": "/absolute/path/to/.revfleet",
48
+ "HSCLI_MCP_PROFILE": "default"
49
+ }
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ If `hscli` is on your PATH you can use:
56
+
57
+ ```json
58
+ {
59
+ "mcpServers": {
60
+ "hscli": {
61
+ "command": "hscli",
62
+ "args": ["mcp"]
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ ## OpenAI-compatible MCP clients
69
+
70
+ Use a stdio server command equivalent to:
71
+
72
+ - command: `hscli`
73
+ - args: `mcp`
74
+
75
+ If your client accepts env vars, set:
76
+
77
+ - `HSCLI_HOME` to the auth profile directory containing `auth.json`
78
+ - `HSCLI_MCP_PROFILE` to force strict profile isolation
79
+
80
+ ## Tool catalog
81
+
82
+ ### Contacts
83
+ - `crm_contacts_list`
84
+ - `crm_contacts_get`
85
+ - `crm_contacts_search`
86
+ - `crm_contacts_create` *(write, dry-run by default)*
87
+ - `crm_contacts_update` *(write, dry-run by default)*
88
+ - `crm_contacts_delete` *(write, dry-run by default)*
89
+ - `crm_contacts_merge` *(write, dry-run by default)*
90
+ - `crm_contacts_batch_read`
91
+ - `crm_contacts_batch_upsert` *(write, dry-run by default)*
92
+ - `crm_contacts_batch_archive` *(write, dry-run by default)*
93
+
94
+ ### Companies
95
+ - `crm_companies_list`
96
+ - `crm_companies_get`
97
+ - `crm_companies_search`
98
+ - `crm_companies_create` *(write, dry-run by default)*
99
+ - `crm_companies_update` *(write, dry-run by default)*
100
+ - `crm_companies_delete` *(write, dry-run by default)*
101
+ - `crm_companies_merge` *(write, dry-run by default)*
102
+ - `crm_companies_batch_read`
103
+ - `crm_companies_batch_upsert` *(write, dry-run by default)*
104
+ - `crm_companies_batch_archive` *(write, dry-run by default)*
105
+
106
+ ### Deals
107
+ - `crm_deals_list`
108
+ - `crm_deals_get`
109
+ - `crm_deals_search`
110
+ - `crm_deals_create` *(write, dry-run by default)*
111
+ - `crm_deals_update` *(write, dry-run by default)*
112
+ - `crm_deals_delete` *(write, dry-run by default)*
113
+ - `crm_deals_merge` *(write, dry-run by default)*
114
+ - `crm_deals_batch_read`
115
+ - `crm_deals_batch_upsert` *(write, dry-run by default)*
116
+ - `crm_deals_batch_archive` *(write, dry-run by default)*
117
+
118
+ ### Tickets
119
+ - `crm_tickets_list`
120
+ - `crm_tickets_get`
121
+ - `crm_tickets_search`
122
+ - `crm_tickets_create` *(write, dry-run by default)*
123
+ - `crm_tickets_update` *(write, dry-run by default)*
124
+ - `crm_tickets_delete` *(write, dry-run by default)*
125
+ - `crm_tickets_merge` *(write, dry-run by default)*
126
+ - `crm_tickets_batch_read`
127
+ - `crm_tickets_batch_upsert` *(write, dry-run by default)*
128
+ - `crm_tickets_batch_archive` *(write, dry-run by default)*
129
+
130
+ ### Engagements
131
+ - `crm_notes_*` (`list/get/search/create/update/delete`)
132
+ - `crm_calls_*` (`list/get/search/create/update/delete`)
133
+ - `crm_tasks_*` (`list/get/search/create/update/delete`)
134
+ - `crm_emails_*` (`list/get/search/create/update/delete`)
135
+ - `crm_meetings_*` (`list/get/search/create/update/delete`)
136
+
137
+ ### Properties
138
+ - `crm_properties_list`
139
+ - `crm_properties_get`
140
+ - `crm_properties_create` *(write, dry-run by default)*
141
+ - `crm_properties_batch_create` *(write, dry-run by default; supports custom object type IDs, reserved-name skips, option cleanup, empty-enum demotion/skip)*
142
+ - `crm_properties_update` *(write, dry-run by default)*
143
+
144
+ ### Associations
145
+ - `crm_associations_list`
146
+ - `crm_associations_create` *(write, dry-run by default)*
147
+ - `crm_associations_remove` *(write, dry-run by default)*
148
+
149
+ ### Imports
150
+ - `crm_imports_create` *(write, dry-run by default)*
151
+ - `crm_imports_list`
152
+ - `crm_imports_get`
153
+ - `crm_imports_errors`
154
+
155
+ ### Owners
156
+ - `crm_owners_list`
157
+
158
+ ### Pipelines
159
+ - `crm_pipelines_list`
160
+ - `crm_pipelines_get`
161
+
162
+ ### Custom Objects
163
+ - `crm_custom_schemas_list|get|create|update`
164
+ - `crm_custom_records_list|get|search|create|update|delete`
165
+
166
+ ### Raw API
167
+ - `hub_api_request` *(write methods dry-run by default)*
168
+
169
+ ## Notes
170
+
171
+ - MCP transport is stdio only in this implementation.
172
+ - Existing auth + HTTP core logic is reused (`getToken`, `HubSpotClient`, `maybeWrite`, redaction).