@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,400 @@
1
+ # Commerce 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 Commerce Hub settings. Covers products, payment processing, payment links, quotes, invoices, subscriptions, tax, and commerce automation.
6
+
7
+ **Prerequisites:**
8
+ - Portal authenticated (`hscli auth whoami`)
9
+ - Private App scopes: `e-commerce`, `crm.objects.line_items.read/write`
10
+ - HubSpot Payments enabled (US only) or Stripe integration connected
11
+
12
+ ---
13
+
14
+ ## 1. Products
15
+
16
+ **Where:** Settings > Objects > Products
17
+
18
+ ### 1.1 Product Library
19
+
20
+ | Setting | What to configure | Why it matters |
21
+ |---------|-------------------|----------------|
22
+ | Product name | Name of each product/service | Appears on quotes, invoices, payment links |
23
+ | SKU | Stock keeping unit identifier | Internal tracking and reporting |
24
+ | Unit price | Default selling price | Pre-populated on line items |
25
+ | Description | Product description | Customer-facing on quotes/invoices |
26
+ | Billing frequency | One-time, monthly, quarterly, annually | Revenue recognition and subscription handling |
27
+ | Cost of goods sold | COGS per unit | Margin and profitability reporting |
28
+ | Product image | Product photo/icon | Visual on quotes and payment links |
29
+
30
+ **hscli:**
31
+ ```bash
32
+ # List all products
33
+ hscli crm products list --limit 50
34
+
35
+ # Create a product
36
+ hscli crm products create --data '{
37
+ "properties": {
38
+ "name": "Professional Plan",
39
+ "description": "Monthly professional subscription",
40
+ "price": "99.00",
41
+ "hs_sku": "PRO-001",
42
+ "hs_recurring_billing_period": "P1M",
43
+ "hs_cost_of_goods_sold": "20.00"
44
+ }
45
+ }' --force
46
+
47
+ # Update a product
48
+ hscli crm products update <productId> --data '{
49
+ "properties": {
50
+ "price": "109.00"
51
+ }
52
+ }' --force
53
+ ```
54
+
55
+ ### 1.2 Product Properties
56
+
57
+ | Property | Type | Purpose |
58
+ |----------|------|---------|
59
+ | `name` | Text | Product name |
60
+ | `price` | Currency | Unit price |
61
+ | `hs_sku` | Text | SKU |
62
+ | `description` | Text | Description |
63
+ | `hs_recurring_billing_period` | Select | Billing frequency (P1M, P3M, P12M) |
64
+ | `hs_cost_of_goods_sold` | Currency | COGS |
65
+ | `hs_images` | Text | Image URL |
66
+ | `tax` | Number | Tax rate (if applicable) |
67
+
68
+ ---
69
+
70
+ ## 2. Payment Processing
71
+
72
+ **Where:** Settings > Commerce > Payments
73
+
74
+ ### 2.1 HubSpot Payments (US Only)
75
+
76
+ | Setting | What to configure | Why it matters |
77
+ |---------|-------------------|----------------|
78
+ | Business verification | Legal entity name, EIN, address | Required for processing |
79
+ | Bank account | Payout bank account | Where funds are deposited |
80
+ | Statement descriptor | What appears on customer bank statements | Brand recognition on statements |
81
+ | Payment methods | Credit card, ACH/bank transfer | Offer customer payment options |
82
+ | Payout schedule | Daily, weekly, or monthly payouts | Cash flow management |
83
+
84
+ ### 2.2 Stripe Integration (Global)
85
+
86
+ | Setting | What to configure | Why it matters |
87
+ |---------|-------------------|----------------|
88
+ | Stripe account | Connect existing Stripe account | Leverage existing payment infrastructure |
89
+ | Sync settings | Products, customers, subscriptions | Keep HubSpot and Stripe in sync |
90
+ | Webhook events | Payment success, failure, refund | Real-time status updates |
91
+
92
+ ### 2.3 Payment Methods
93
+
94
+ | Method | Availability | Processing fee (typical) |
95
+ |--------|-------------|------------------------|
96
+ | Credit card | HubSpot Payments + Stripe | 2.9% + $0.30 |
97
+ | Debit card | HubSpot Payments + Stripe | 2.9% + $0.30 |
98
+ | ACH/Bank transfer | HubSpot Payments | 0.5% (cap $10) |
99
+ | Wire transfer | Manual (outside HubSpot) | Varies |
100
+
101
+ > **API:** Payment processing setup is UI-only. Payment events trigger CRM updates accessible via API.
102
+
103
+ ---
104
+
105
+ ## 3. Payment Links
106
+
107
+ **Where:** Commerce > Payment Links
108
+
109
+ ### 3.1 Payment Link Configuration
110
+
111
+ | Setting | What to configure | Why it matters |
112
+ |---------|-------------------|----------------|
113
+ | Link name | Internal name for the payment link | Organization and tracking |
114
+ | Products | Select products from library | What the customer is buying |
115
+ | Quantity | Fixed or customer-selectable | Flexibility for customers |
116
+ | Discounts | Percentage or fixed amount | Promotions and special pricing |
117
+ | Checkout page | Branding, custom fields | Professional checkout experience |
118
+ | Redirect URL | Post-payment redirect page | Thank you page or onboarding |
119
+ | Expiration | Optional expiry date | Time-limited offers |
120
+
121
+ ### 3.2 Checkout Customization
122
+
123
+ | Element | Configuration |
124
+ |---------|--------------|
125
+ | Company logo | Brand logo on checkout page |
126
+ | Colors | Match brand palette |
127
+ | Custom fields | Additional info collection (company name, address, etc.) |
128
+ | Terms & conditions | Link to terms page |
129
+ | Billing address | Require billing address collection |
130
+ | Shipping address | Require shipping address (physical products) |
131
+
132
+ **hscli:**
133
+ ```bash
134
+ # List payment links
135
+ hscli commerce payment-links list --limit 20
136
+
137
+ # Create a payment link
138
+ hscli commerce payment-links create --data '{
139
+ "name": "Pro Plan Monthly",
140
+ "lineItems": [
141
+ {"productId": "<productId>", "quantity": 1}
142
+ ]
143
+ }' --force
144
+ ```
145
+
146
+ ---
147
+
148
+ ## 4. Quotes (Commerce)
149
+
150
+ **Where:** Settings > Objects > Quotes
151
+
152
+ ### 4.1 Quote Configuration
153
+
154
+ | Setting | What to configure | Why it matters |
155
+ |---------|-------------------|----------------|
156
+ | Quote templates | Branded templates (logo, colors, layout) | Professional appearance |
157
+ | Default expiration | Validity period (e.g., 30 days) | Urgency and expectation management |
158
+ | E-signature | Enable native or integrated e-sign | Streamline deal closing |
159
+ | Payment on quote | Enable payment collection | Combine quote + payment |
160
+ | Countersignature | Internal approval before sending | Control on pricing/terms |
161
+ | Snippet | Pre-built text blocks for quotes | Consistency and speed |
162
+ | Quote numbering | Prefix and auto-increment | Professional tracking |
163
+
164
+ ### 4.2 Quote Workflow
165
+
166
+ ```
167
+ Create Quote → Add Line Items → Apply Discounts → Add Terms
168
+ → Preview → Send for Signature → Collect Payment → Mark Won
169
+ ```
170
+
171
+ ### 4.3 Quote Approval Workflow
172
+
173
+ | Condition | Action |
174
+ |-----------|--------|
175
+ | Discount > 20% | Require manager approval |
176
+ | Deal amount > $50K | Require VP approval |
177
+ | Non-standard terms | Require legal review |
178
+ | Custom pricing | Require finance approval |
179
+
180
+ ---
181
+
182
+ ## 5. Invoices
183
+
184
+ **Where:** Commerce > Invoices | Settings > Commerce > Invoices
185
+
186
+ ### 5.1 Invoice Settings
187
+
188
+ | Setting | What to configure | Why it matters |
189
+ |---------|-------------------|----------------|
190
+ | Invoice template | Branded template (logo, colors) | Professional invoicing |
191
+ | Invoice numbering | Prefix + auto-increment (e.g., INV-0001) | Accounting compliance |
192
+ | Payment terms | Net 15, Net 30, Net 60, Due on receipt | Cash flow expectations |
193
+ | Default currency | Primary currency | Multi-currency support |
194
+ | Tax settings | Tax rates, tax IDs | Compliance |
195
+ | Late payment terms | Late fee percentage or flat amount | Incentivize timely payment |
196
+ | Remittance info | Bank details for wire transfer | Alternative payment method |
197
+ | Notes | Default footer notes | Standard terms or thank-you |
198
+
199
+ ### 5.2 Invoice Automation
200
+
201
+ | Trigger | Action | Purpose |
202
+ |---------|--------|---------|
203
+ | Invoice created | Send to customer via email | Prompt delivery |
204
+ | Payment due in 7 days | Send reminder email | Proactive collection |
205
+ | Invoice overdue | Send overdue notice | Collections process |
206
+ | Invoice overdue > 30 days | Escalate to manager | Escalated collections |
207
+ | Payment received | Send receipt, update deal | Confirmation and bookkeeping |
208
+
209
+ **hscli:**
210
+ ```bash
211
+ # List invoices
212
+ hscli commerce invoices list --limit 20
213
+
214
+ # Get invoice details
215
+ hscli commerce invoices get <invoiceId>
216
+
217
+ # Create an invoice
218
+ hscli commerce invoices create --data '{
219
+ "properties": {
220
+ "hs_invoice_date": "2026-03-15",
221
+ "hs_due_date": "2026-04-14",
222
+ "hs_currency_code": "USD"
223
+ },
224
+ "associations": [
225
+ {"to": {"id": "<contactId>"}, "types": [{"associationCategory": "HUBSPOT_DEFINED", "associationTypeId": 100}]}
226
+ ]
227
+ }' --force
228
+ ```
229
+
230
+ ---
231
+
232
+ ## 6. Subscriptions
233
+
234
+ **Where:** Commerce > Subscriptions
235
+
236
+ ### 6.1 Subscription Settings
237
+
238
+ | Setting | What to configure | Why it matters |
239
+ |---------|-------------------|----------------|
240
+ | Billing frequency | Monthly, quarterly, annual | Recurring revenue cadence |
241
+ | Auto-renewal | Enable/disable auto-renewal | Revenue continuity |
242
+ | Cancellation policy | Immediate, end of period, with notice | Customer expectations |
243
+ | Proration | Prorate upgrades/downgrades | Fair billing on plan changes |
244
+ | Trial periods | Free trial duration (if applicable) | Customer acquisition |
245
+ | Grace period | Days after failed payment before suspension | Reduce involuntary churn |
246
+
247
+ ### 6.2 Subscription Lifecycle
248
+
249
+ ```
250
+ Trial (optional) → Active → Renewal
251
+ ↓ ↓
252
+ Cancel Payment Failed
253
+ ↓ ↓
254
+ Expired Retry (dunning)
255
+
256
+ Suspended → Canceled
257
+ ```
258
+
259
+ ### 6.3 Dunning Management (Failed Payments)
260
+
261
+ | Attempt | Timing | Action |
262
+ |---------|--------|--------|
263
+ | 1st retry | 3 days after failure | Auto-retry payment |
264
+ | 2nd retry | 5 days after failure | Auto-retry + email notification |
265
+ | 3rd retry | 7 days after failure | Auto-retry + escalation email |
266
+ | Final | 10 days after failure | Suspend subscription, notify customer |
267
+
268
+ ---
269
+
270
+ ## 7. Tax Configuration
271
+
272
+ **Where:** Settings > Commerce > Tax
273
+
274
+ ### 7.1 Tax Settings
275
+
276
+ | Setting | What to configure | Why it matters |
277
+ |---------|-------------------|----------------|
278
+ | Tax calculation | Automatic or manual | Compliance complexity |
279
+ | Tax rates | Per product or per region | Correct tax collection |
280
+ | Tax ID display | Show tax ID on invoices | B2B compliance |
281
+ | Tax-exempt customers | Flag tax-exempt contacts/companies | Avoid over-charging |
282
+ | Tax reporting | Integration with accounting software | Simplified tax filing |
283
+
284
+ ### 7.2 Tax by Region
285
+
286
+ | Region | Tax type | Configuration |
287
+ |--------|----------|--------------|
288
+ | United States | Sales tax | State-by-state rates, nexus rules |
289
+ | European Union | VAT | Country rates, reverse charge for B2B |
290
+ | Canada | GST/HST/PST | Province-based |
291
+ | Australia | GST | Flat 10% |
292
+ | United Kingdom | VAT | Standard 20%, reduced rates |
293
+
294
+ > **API:** Tax configuration is primarily UI-based. Tax amounts on line items are accessible via the API.
295
+
296
+ ---
297
+
298
+ ## 8. Commerce Automation
299
+
300
+ **Where:** Automation > Workflows (commerce triggers)
301
+
302
+ ### 8.1 Payment Workflows
303
+
304
+ | Trigger | Actions | Purpose |
305
+ |---------|---------|---------|
306
+ | Payment received | Send receipt email, update deal stage, create task | Post-payment processing |
307
+ | Payment failed | Notify customer, create retry task, alert finance | Payment recovery |
308
+ | Refund issued | Send confirmation, update deal, adjust revenue | Refund processing |
309
+ | Subscription created | Welcome email, create onboarding ticket | Customer onboarding |
310
+ | Subscription canceled | Exit survey, notify CSM, update lifecycle | Churn management |
311
+ | Invoice overdue | Send reminders (3, 7, 14, 30 days) | Collections automation |
312
+
313
+ ### 8.2 Revenue Workflows
314
+
315
+ | Trigger | Actions | Purpose |
316
+ |---------|---------|---------|
317
+ | MRR change | Update dashboards, notify finance | Revenue tracking |
318
+ | Upgrade | Thank you email, update plan property | Expansion revenue |
319
+ | Downgrade | Retention offer email, alert CSM | Churn prevention |
320
+ | Renewal due in 30 days | Notify account manager, create renewal task | Proactive renewal |
321
+
322
+ ---
323
+
324
+ ## Setup Checklist
325
+
326
+ ### Products
327
+ ```
328
+ [ ] Product library populated with all products/services
329
+ [ ] Pricing configured (one-time and recurring)
330
+ [ ] SKUs assigned
331
+ [ ] Product descriptions written
332
+ [ ] COGS entered (for margin reporting)
333
+ [ ] Billing frequencies set for subscription products
334
+ ```
335
+
336
+ ### Payment Processing
337
+ ```
338
+ [ ] HubSpot Payments verified OR Stripe connected
339
+ [ ] Payout bank account configured
340
+ [ ] Statement descriptor set
341
+ [ ] Payment methods enabled (card, ACH)
342
+ [ ] Test payment processed successfully
343
+ ```
344
+
345
+ ### Payment Links
346
+ ```
347
+ [ ] At least one payment link created
348
+ [ ] Checkout page branded (logo, colors)
349
+ [ ] Redirect URL configured (thank you page)
350
+ [ ] Custom fields added (if needed)
351
+ [ ] Payment link tested end-to-end
352
+ ```
353
+
354
+ ### Quotes
355
+ ```
356
+ [ ] Quote template branded
357
+ [ ] Default expiration set
358
+ [ ] E-signature enabled (if applicable)
359
+ [ ] Payment on quotes enabled (if applicable)
360
+ [ ] Approval workflows configured (discount thresholds)
361
+ [ ] Quote numbering configured
362
+ ```
363
+
364
+ ### Invoices
365
+ ```
366
+ [ ] Invoice template branded
367
+ [ ] Invoice numbering configured
368
+ [ ] Payment terms set (Net 30, etc.)
369
+ [ ] Tax settings configured
370
+ [ ] Reminder email automation set up
371
+ [ ] Overdue notice automation set up
372
+ ```
373
+
374
+ ### Subscriptions
375
+ ```
376
+ [ ] Billing frequencies defined per product
377
+ [ ] Auto-renewal settings configured
378
+ [ ] Cancellation policy defined
379
+ [ ] Proration rules set
380
+ [ ] Dunning management configured (retry schedule)
381
+ [ ] Grace period set for failed payments
382
+ ```
383
+
384
+ ### Tax
385
+ ```
386
+ [ ] Tax calculation method chosen (auto/manual)
387
+ [ ] Tax rates configured per product or region
388
+ [ ] Tax-exempt customers flagged
389
+ [ ] Tax ID displayed on invoices (if B2B)
390
+ ```
391
+
392
+ ### Commerce Automation
393
+ ```
394
+ [ ] Payment received workflow active
395
+ [ ] Payment failed workflow active
396
+ [ ] Invoice overdue reminder workflow active
397
+ [ ] Subscription created onboarding workflow active
398
+ [ ] Subscription canceled churn workflow active
399
+ [ ] Renewal reminder workflow active
400
+ ```
@@ -0,0 +1,146 @@
1
+ # hscli capability surface
2
+
3
+ A factual inventory of what `hscli` exposes via its CLI and MCP server surface, and the HubSpot operations it covers. No comparisons, no marketing framing — just what's in the box.
4
+
5
+ Last updated: 2026-04-22 (v0.8.0)
6
+
7
+ ## MCP tool surface
8
+
9
+ `hscli mcp` exposes two tool families over stdio:
10
+
11
+ ### Native tool family (per-object)
12
+
13
+ | Object | Tools |
14
+ |---|---|
15
+ | contacts, companies, deals, tickets, line items, products, quotes, invoices, orders, carts | `crm_<type>_list`, `_get`, `_search`, `_create`, `_update`, `_delete`, `_merge`, `_batch_read`, `_batch_upsert`, `_batch_archive` |
16
+ | notes, calls, tasks, emails, meetings | Same 10 tools each |
17
+ | custom objects | `crm_custom_schemas_{list,get,create,update}`, `crm_custom_records_{list,get,search,create,update,delete}` |
18
+ | properties | `crm_properties_{list,get,create,update}`, `crm_property_groups_{list,create,update}` |
19
+ | associations | `crm_associations_{list,create,remove}` |
20
+ | pipelines | `crm_pipelines_{list,get,stages}` |
21
+ | lists | `crm_lists_{list,get,create,update,delete,memberships}` |
22
+ | imports | `crm_imports_{create,list,get,errors}` |
23
+ | exports | `crm_exports_{create,list,get,status}` |
24
+ | sequences | `sales_sequences_{list,get,enrollments}` |
25
+ | reporting | `reporting_dashboards_{list,get}` |
26
+ | raw | `hub_api_request` |
27
+
28
+ ### HubSpot Remote MCP compatibility family
29
+
30
+ `hscli mcp` also registers the 11 tool names used by HubSpot's hosted Remote MCP server at `mcp.hubspot.com`. An agent built against the HubSpot Remote MCP can point at `hscli mcp` without modification:
31
+
32
+ | Tool | Scope | Notes |
33
+ |---|---|---|
34
+ | `get_user_details` | Read | Returns portal / account info |
35
+ | `search_crm_objects` | Read | filterGroups (max 5) + query + sorts + pagination |
36
+ | `get_crm_objects` | Read | Batch read by ID, max 100/call |
37
+ | `manage_crm_objects` | Write + **delete** | `operation: "create" \| "update" \| "delete"` — the `delete` operation is an hscli extension (HubSpot Remote MCP is create/update only) |
38
+ | `search_properties` | Read | Keyword filter, max 5 keywords |
39
+ | `get_properties` | Read | Full property definitions |
40
+ | `search_owners` | Read | By email, by ID, or list |
41
+ | `get_campaign_analytics` | Read | Per-campaign metrics |
42
+ | `get_campaign_contacts_by_type` | Read | Paginated, with `attributionType` |
43
+ | `get_campaign_asset_types` | Read | Supported asset types |
44
+ | `get_campaign_asset_metrics` | Read | Per-asset metrics |
45
+
46
+ ### Extension tool family (hscli-only)
47
+
48
+ Tools for surfaces not exposed by HubSpot's hosted Remote MCP:
49
+
50
+ | Area | Tools |
51
+ |---|---|
52
+ | Workflows | `workflows_{list,get,enroll,unenroll}` |
53
+ | Files | `files_{list,get,delete,signed_url}` |
54
+ | Forms | `forms_{list,get,submissions,submit}` |
55
+ | Webhooks | `webhooks_{list_subscriptions,create_subscription,delete_subscription}` |
56
+ | Marketing emails | `marketing_emails_{list,get,statistics}` |
57
+ | HubDB | `hubdb_{tables_list,rows_list,row_create,row_update,publish}` |
58
+ | CMS URL redirects | `cms_redirects_{list,create,delete}` |
59
+ | Conversations | `conversations_{inboxes_list,threads_list,messages_send}` |
60
+
61
+ ## CLI surface
62
+
63
+ Every MCP tool has a matching CLI subcommand. Top-level command groups:
64
+
65
+ ```
66
+ hscli auth Token mgmt (login, logout, whoami, encrypt, decrypt)
67
+ hscli crm Full CRM surface (contacts, companies, deals, tickets,
68
+ custom objects, properties, pipelines, associations,
69
+ imports, exports, describe/validate, owners, etc.)
70
+ hscli marketing Emails, campaigns, ads, forms, landing pages,
71
+ transactional, subscriptions, events, behavioral events
72
+ hscli sales Sequences, meetings, calling, scheduler, sales extensions
73
+ hscli service Conversations (threads, messages, inboxes, channels),
74
+ feedback, chatflows, knowledge-base
75
+ hscli cms Blog posts + authors + tags, site pages, landing pages,
76
+ HubDB (tables, rows, drafts, publishing), URL redirects,
77
+ source-code, domains, SEO audit, site search, comments
78
+ hscli workflows v4 flows + legacy v2/v3 workflow enrollment
79
+ hscli automation Custom actions
80
+ hscli files File upload, list, delete, signed URLs
81
+ hscli forms Forms CRUD + submissions
82
+ hscli webhooks Subscription CRUD
83
+ hscli settings Users, teams, business units, currencies, GDPR,
84
+ audit-logs, communication preferences (v3 + v4 batch)
85
+ hscli account Account info, audit-logs, private-apps, API usage
86
+ hscli reporting Analytics v2 reports/dashboards
87
+ hscli exports CRM exports
88
+ hscli lists Lists (v3) + folders + memberships
89
+ hscli conversations Threads, messages, inboxes, channels, custom-channels
90
+ hscli api Raw API request with scope allowlisting
91
+ hscli doctor Diagnostics + capability probing
92
+ hscli policy policy-as-code: list, show-matching, validate, templates
93
+ hscli audit Operational audit over trace JSONL files
94
+ hscli trace Session tracing + replay
95
+ hscli seed Generate test portal data (tier-aware)
96
+ hscli mcp Run MCP server over stdio
97
+ ```
98
+
99
+ Legacy v1/v2 API support lives under `hscli contacts-v1`, `hscli companies-v2`, `hscli deals-v1`, `hscli owners-v2`, `hscli engagements-v1`, `hscli properties-legacy`, `hscli reports-v2`, `hscli calling-v1`, `hscli channels`, `hscli broadcast`, `hscli appinstalls`, `hscli marketing-emails-v1`.
100
+
101
+ ## HubSpot API coverage
102
+
103
+ **Total endpoints covered:** 1,180 (verified against an automated scrape of HubSpot's developer documentation + live probe runs against multiple tier profiles).
104
+
105
+ Whether an endpoint returns 2xx on a given portal depends on HubSpot's tier gates:
106
+
107
+ | Portal tier | Reachable endpoints (read + write) |
108
+ |---|---:|
109
+ | Free | ~550 / 1180 (46.6%) |
110
+ | Starter | ~640 / 1180 (54.2%) |
111
+ | Professional | ~890 / 1180 (75.4%) |
112
+ | Enterprise (all hubs) + Commerce + Ops | ~1140 / 1180 (96.6%) |
113
+
114
+ Per-endpoint tier mapping: [docs/TIERS.md](TIERS.md).
115
+
116
+ ## Auth models
117
+
118
+ | Method | Supported | Notes |
119
+ |---|:---:|---|
120
+ | HubSpot Private App token | ✅ | Primary. Scriptable / machine-to-machine / CI. |
121
+ | OAuth authorization code | Partial | Available for developer apps via `hscli auth login --oauth` |
122
+ | OAuth refresh-token rotation | ✅ | Persisted in `~/.revfleet/auth.json` (or encrypted `auth.enc`) |
123
+ | Legacy `hapikey` | ❌ | Retired by HubSpot (June 2023) |
124
+
125
+ ## Safety model
126
+
127
+ - **Mutations are blocked by default.** `--force` or `--dry-run` required; neither = preview only.
128
+ - **Policy-as-code.** `--policy-file <path>` (or `HSCLI_POLICY_FILE`) evaluates rules with method + path globs, time windows (tz-aware), change-ticket requirements, approval gates. See [docs/POLICY_EXAMPLE.json](POLICY_EXAMPLE.json).
129
+ - **Change tickets.** `--change-ticket <id>` required by policy for guarded writes; value is written to telemetry.
130
+ - **Path scope allowlisting.** All requests must resolve to an approved HubSpot API path root; traversal is rejected.
131
+ - **Idempotency keys.** Every write includes an `Idempotency-Key` header for replay-safe retries.
132
+ - **Token redaction.** Bearer tokens, `token=`, `api_key=`, and `Authorization:` values are scrubbed from every output and error payload.
133
+ - **Rate-limit awareness.** Reads HubSpot's `X-HubSpot-RateLimit-*` headers; proactive throttling + daily quota reset in the portal's declared timezone.
134
+ - **Capability probing.** Endpoints are fingerprinted by `portalId + scopes`; `--strict-capabilities` fails fast on unsupported endpoints before issuing a network call.
135
+
136
+ ## Observability
137
+
138
+ - **Trace.** `hscli trace start` writes every request to a JSONL file with method, path, status, latency, profile, MCP tool name (if applicable), optional request/response bodies. Session state lives at `~/.revfleet/trace-session.json`. See [docs/TUTORIALS/trace-replay-repro.md](TUTORIALS/trace-replay-repro.md).
139
+ - **Audit.** `hscli audit {timeline,who,what,writes,by-tool}` aggregates trace JSONL into operational audit views (who did what when, which tool is buggy, which path had the most writes). See [docs/TUTORIALS/audit-portal-writes.md](TUTORIALS/audit-portal-writes.md).
140
+ - **Replay.** `hscli trace replay <file>` re-issues GETs (writes are intentionally non-replayable).
141
+
142
+ ## Hosting / deployment
143
+
144
+ - **Self-hosted.** `hscli` runs on your machine / CI runner / private infrastructure. No traffic transits third-party servers.
145
+ - **Token sovereignty.** HubSpot tokens stay at rest in `~/.revfleet/auth.json` (mode 0600, dir mode 0700) or encrypted `auth.enc` when `HSCLI_VAULT_PASSPHRASE` is set.
146
+ - **No telemetry phoning home.** Trace files are local-only; `hscli` ships no outbound telemetry.