@revfleet/hscli 0.5.3
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/CHANGELOG.md +466 -0
- package/LICENSE +21 -0
- package/README.md +287 -0
- package/SECURITY.md +68 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +192 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/account/index.d.ts +3 -0
- package/dist/commands/account/index.js +65 -0
- package/dist/commands/account/index.js.map +1 -0
- package/dist/commands/api/index.d.ts +3 -0
- package/dist/commands/api/index.js +35 -0
- package/dist/commands/api/index.js.map +1 -0
- package/dist/commands/auth/index.d.ts +3 -0
- package/dist/commands/auth/index.js +229 -0
- package/dist/commands/auth/index.js.map +1 -0
- package/dist/commands/automation/index.d.ts +3 -0
- package/dist/commands/automation/index.js +119 -0
- package/dist/commands/automation/index.js.map +1 -0
- package/dist/commands/cms/blog-settings.d.ts +3 -0
- package/dist/commands/cms/blog-settings.js +70 -0
- package/dist/commands/cms/blog-settings.js.map +1 -0
- package/dist/commands/cms/content-ops.d.ts +13 -0
- package/dist/commands/cms/content-ops.js +262 -0
- package/dist/commands/cms/content-ops.js.map +1 -0
- package/dist/commands/cms/hubdb.d.ts +3 -0
- package/dist/commands/cms/hubdb.js +55 -0
- package/dist/commands/cms/hubdb.js.map +1 -0
- package/dist/commands/cms/index.d.ts +3 -0
- package/dist/commands/cms/index.js +119 -0
- package/dist/commands/cms/index.js.map +1 -0
- package/dist/commands/cms/source-code.d.ts +3 -0
- package/dist/commands/cms/source-code.js +101 -0
- package/dist/commands/cms/source-code.js.map +1 -0
- package/dist/commands/communication-preferences/index.d.ts +3 -0
- package/dist/commands/communication-preferences/index.js +107 -0
- package/dist/commands/communication-preferences/index.js.map +1 -0
- package/dist/commands/conversations/index.d.ts +3 -0
- package/dist/commands/conversations/index.js +233 -0
- package/dist/commands/conversations/index.js.map +1 -0
- package/dist/commands/crm/associations.d.ts +3 -0
- package/dist/commands/crm/associations.js +180 -0
- package/dist/commands/crm/associations.js.map +1 -0
- package/dist/commands/crm/cards.d.ts +3 -0
- package/dist/commands/crm/cards.js +72 -0
- package/dist/commands/crm/cards.js.map +1 -0
- package/dist/commands/crm/carts.d.ts +3 -0
- package/dist/commands/crm/carts.js +5 -0
- package/dist/commands/crm/carts.js.map +1 -0
- package/dist/commands/crm/communications.d.ts +3 -0
- package/dist/commands/crm/communications.js +5 -0
- package/dist/commands/crm/communications.js.map +1 -0
- package/dist/commands/crm/companies.d.ts +3 -0
- package/dist/commands/crm/companies.js +5 -0
- package/dist/commands/crm/companies.js.map +1 -0
- package/dist/commands/crm/contacts.d.ts +3 -0
- package/dist/commands/crm/contacts.js +5 -0
- package/dist/commands/crm/contacts.js.map +1 -0
- package/dist/commands/crm/custom-objects.d.ts +3 -0
- package/dist/commands/crm/custom-objects.js +83 -0
- package/dist/commands/crm/custom-objects.js.map +1 -0
- package/dist/commands/crm/dated.d.ts +9 -0
- package/dist/commands/crm/dated.js +247 -0
- package/dist/commands/crm/dated.js.map +1 -0
- package/dist/commands/crm/deals.d.ts +3 -0
- package/dist/commands/crm/deals.js +5 -0
- package/dist/commands/crm/deals.js.map +1 -0
- package/dist/commands/crm/describe.d.ts +3 -0
- package/dist/commands/crm/describe.js +89 -0
- package/dist/commands/crm/describe.js.map +1 -0
- package/dist/commands/crm/discounts.d.ts +3 -0
- package/dist/commands/crm/discounts.js +5 -0
- package/dist/commands/crm/discounts.js.map +1 -0
- package/dist/commands/crm/engagements.d.ts +3 -0
- package/dist/commands/crm/engagements.js +8 -0
- package/dist/commands/crm/engagements.js.map +1 -0
- package/dist/commands/crm/fees.d.ts +3 -0
- package/dist/commands/crm/fees.js +5 -0
- package/dist/commands/crm/fees.js.map +1 -0
- package/dist/commands/crm/goals.d.ts +3 -0
- package/dist/commands/crm/goals.js +30 -0
- package/dist/commands/crm/goals.js.map +1 -0
- package/dist/commands/crm/imports.d.ts +3 -0
- package/dist/commands/crm/imports.js +45 -0
- package/dist/commands/crm/imports.js.map +1 -0
- package/dist/commands/crm/index.d.ts +3 -0
- package/dist/commands/crm/index.js +64 -0
- package/dist/commands/crm/index.js.map +1 -0
- package/dist/commands/crm/invoices.d.ts +3 -0
- package/dist/commands/crm/invoices.js +5 -0
- package/dist/commands/crm/invoices.js.map +1 -0
- package/dist/commands/crm/leads.d.ts +3 -0
- package/dist/commands/crm/leads.js +5 -0
- package/dist/commands/crm/leads.js.map +1 -0
- package/dist/commands/crm/line-items.d.ts +3 -0
- package/dist/commands/crm/line-items.js +5 -0
- package/dist/commands/crm/line-items.js.map +1 -0
- package/dist/commands/crm/orders.d.ts +3 -0
- package/dist/commands/crm/orders.js +5 -0
- package/dist/commands/crm/orders.js.map +1 -0
- package/dist/commands/crm/owners.d.ts +3 -0
- package/dist/commands/crm/owners.js +22 -0
- package/dist/commands/crm/owners.js.map +1 -0
- package/dist/commands/crm/payments.d.ts +3 -0
- package/dist/commands/crm/payments.js +5 -0
- package/dist/commands/crm/payments.js.map +1 -0
- package/dist/commands/crm/pipelines.d.ts +3 -0
- package/dist/commands/crm/pipelines.js +70 -0
- package/dist/commands/crm/pipelines.js.map +1 -0
- package/dist/commands/crm/products.d.ts +3 -0
- package/dist/commands/crm/products.js +5 -0
- package/dist/commands/crm/products.js.map +1 -0
- package/dist/commands/crm/properties.d.ts +3 -0
- package/dist/commands/crm/properties.js +103 -0
- package/dist/commands/crm/properties.js.map +1 -0
- package/dist/commands/crm/quotes.d.ts +3 -0
- package/dist/commands/crm/quotes.js +5 -0
- package/dist/commands/crm/quotes.js.map +1 -0
- package/dist/commands/crm/shared.d.ts +17 -0
- package/dist/commands/crm/shared.js +256 -0
- package/dist/commands/crm/shared.js.map +1 -0
- package/dist/commands/crm/subscriptions.d.ts +3 -0
- package/dist/commands/crm/subscriptions.js +5 -0
- package/dist/commands/crm/subscriptions.js.map +1 -0
- package/dist/commands/crm/sync.d.ts +3 -0
- package/dist/commands/crm/sync.js +116 -0
- package/dist/commands/crm/sync.js.map +1 -0
- package/dist/commands/crm/taxes.d.ts +3 -0
- package/dist/commands/crm/taxes.js +5 -0
- package/dist/commands/crm/taxes.js.map +1 -0
- package/dist/commands/crm/tickets.d.ts +3 -0
- package/dist/commands/crm/tickets.js +5 -0
- package/dist/commands/crm/tickets.js.map +1 -0
- package/dist/commands/crm/users.d.ts +3 -0
- package/dist/commands/crm/users.js +5 -0
- package/dist/commands/crm/users.js.map +1 -0
- package/dist/commands/doctor/index.d.ts +3 -0
- package/dist/commands/doctor/index.js +232 -0
- package/dist/commands/doctor/index.js.map +1 -0
- package/dist/commands/domains/shared.d.ts +13 -0
- package/dist/commands/domains/shared.js +56 -0
- package/dist/commands/domains/shared.js.map +1 -0
- package/dist/commands/email-events/index.d.ts +3 -0
- package/dist/commands/email-events/index.js +77 -0
- package/dist/commands/email-events/index.js.map +1 -0
- package/dist/commands/events/index.d.ts +3 -0
- package/dist/commands/events/index.js +80 -0
- package/dist/commands/events/index.js.map +1 -0
- package/dist/commands/exports/index.d.ts +3 -0
- package/dist/commands/exports/index.js +45 -0
- package/dist/commands/exports/index.js.map +1 -0
- package/dist/commands/extensions/index.d.ts +3 -0
- package/dist/commands/extensions/index.js +118 -0
- package/dist/commands/extensions/index.js.map +1 -0
- package/dist/commands/feature-flags/index.d.ts +3 -0
- package/dist/commands/feature-flags/index.js +65 -0
- package/dist/commands/feature-flags/index.js.map +1 -0
- package/dist/commands/files/folders.d.ts +3 -0
- package/dist/commands/files/folders.js +74 -0
- package/dist/commands/files/folders.js.map +1 -0
- package/dist/commands/files/index.d.ts +3 -0
- package/dist/commands/files/index.js +30 -0
- package/dist/commands/files/index.js.map +1 -0
- package/dist/commands/forms/index.d.ts +3 -0
- package/dist/commands/forms/index.js +37 -0
- package/dist/commands/forms/index.js.map +1 -0
- package/dist/commands/integrations/index.d.ts +3 -0
- package/dist/commands/integrations/index.js +64 -0
- package/dist/commands/integrations/index.js.map +1 -0
- package/dist/commands/integrators/index.d.ts +3 -0
- package/dist/commands/integrators/index.js +79 -0
- package/dist/commands/integrators/index.js.map +1 -0
- package/dist/commands/legacy/index.d.ts +13 -0
- package/dist/commands/legacy/index.js +254 -0
- package/dist/commands/legacy/index.js.map +1 -0
- package/dist/commands/legacy-v1/index.d.ts +29 -0
- package/dist/commands/legacy-v1/index.js +568 -0
- package/dist/commands/legacy-v1/index.js.map +1 -0
- package/dist/commands/lists/index.d.ts +3 -0
- package/dist/commands/lists/index.js +148 -0
- package/dist/commands/lists/index.js.map +1 -0
- package/dist/commands/marketing/ads.d.ts +3 -0
- package/dist/commands/marketing/ads.js +45 -0
- package/dist/commands/marketing/ads.js.map +1 -0
- package/dist/commands/marketing/behavioral-events.d.ts +3 -0
- package/dist/commands/marketing/behavioral-events.js +38 -0
- package/dist/commands/marketing/behavioral-events.js.map +1 -0
- package/dist/commands/marketing/events.d.ts +3 -0
- package/dist/commands/marketing/events.js +69 -0
- package/dist/commands/marketing/events.js.map +1 -0
- package/dist/commands/marketing/index.d.ts +3 -0
- package/dist/commands/marketing/index.js +55 -0
- package/dist/commands/marketing/index.js.map +1 -0
- package/dist/commands/marketing/landing-pages.d.ts +3 -0
- package/dist/commands/marketing/landing-pages.js +48 -0
- package/dist/commands/marketing/landing-pages.js.map +1 -0
- package/dist/commands/marketing/seo.d.ts +3 -0
- package/dist/commands/marketing/seo.js +35 -0
- package/dist/commands/marketing/seo.js.map +1 -0
- package/dist/commands/marketing/social.d.ts +3 -0
- package/dist/commands/marketing/social.js +45 -0
- package/dist/commands/marketing/social.js.map +1 -0
- package/dist/commands/marketing/subscriptions.d.ts +3 -0
- package/dist/commands/marketing/subscriptions.js +27 -0
- package/dist/commands/marketing/subscriptions.js.map +1 -0
- package/dist/commands/marketing/transactional.d.ts +3 -0
- package/dist/commands/marketing/transactional.js +30 -0
- package/dist/commands/marketing/transactional.js.map +1 -0
- package/dist/commands/marketing-emails-v1/index.d.ts +3 -0
- package/dist/commands/marketing-emails-v1/index.js +72 -0
- package/dist/commands/marketing-emails-v1/index.js.map +1 -0
- package/dist/commands/mcp.d.ts +2 -0
- package/dist/commands/mcp.js +10 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/media-bridge/index.d.ts +3 -0
- package/dist/commands/media-bridge/index.js +209 -0
- package/dist/commands/media-bridge/index.js.map +1 -0
- package/dist/commands/reporting/index.d.ts +3 -0
- package/dist/commands/reporting/index.js +73 -0
- package/dist/commands/reporting/index.js.map +1 -0
- package/dist/commands/sales/calling.d.ts +3 -0
- package/dist/commands/sales/calling.js +32 -0
- package/dist/commands/sales/calling.js.map +1 -0
- package/dist/commands/sales/index.d.ts +3 -0
- package/dist/commands/sales/index.js +10 -0
- package/dist/commands/sales/index.js.map +1 -0
- package/dist/commands/sales/meetings.d.ts +3 -0
- package/dist/commands/sales/meetings.js +37 -0
- package/dist/commands/sales/meetings.js.map +1 -0
- package/dist/commands/sales/sequences.d.ts +3 -0
- package/dist/commands/sales/sequences.js +78 -0
- package/dist/commands/sales/sequences.js.map +1 -0
- package/dist/commands/seed/cms.d.ts +6 -0
- package/dist/commands/seed/cms.js +204 -0
- package/dist/commands/seed/cms.js.map +1 -0
- package/dist/commands/seed/commerce.d.ts +3 -0
- package/dist/commands/seed/commerce.js +117 -0
- package/dist/commands/seed/commerce.js.map +1 -0
- package/dist/commands/seed/context.d.ts +8 -0
- package/dist/commands/seed/context.js +76 -0
- package/dist/commands/seed/context.js.map +1 -0
- package/dist/commands/seed/crm-core.d.ts +3 -0
- package/dist/commands/seed/crm-core.js +137 -0
- package/dist/commands/seed/crm-core.js.map +1 -0
- package/dist/commands/seed/data.d.ts +73 -0
- package/dist/commands/seed/data.js +49 -0
- package/dist/commands/seed/data.js.map +1 -0
- package/dist/commands/seed/engagements.d.ts +3 -0
- package/dist/commands/seed/engagements.js +89 -0
- package/dist/commands/seed/engagements.js.map +1 -0
- package/dist/commands/seed/index.d.ts +3 -0
- package/dist/commands/seed/index.js +95 -0
- package/dist/commands/seed/index.js.map +1 -0
- package/dist/commands/seed/infra.d.ts +6 -0
- package/dist/commands/seed/infra.js +163 -0
- package/dist/commands/seed/infra.js.map +1 -0
- package/dist/commands/seed/marketing.d.ts +3 -0
- package/dist/commands/seed/marketing.js +172 -0
- package/dist/commands/seed/marketing.js.map +1 -0
- package/dist/commands/seed/shared.d.ts +8 -0
- package/dist/commands/seed/shared.js +37 -0
- package/dist/commands/seed/shared.js.map +1 -0
- package/dist/commands/seed/types.d.ts +44 -0
- package/dist/commands/seed/types.js +2 -0
- package/dist/commands/seed/types.js.map +1 -0
- package/dist/commands/service/chatflows.d.ts +3 -0
- package/dist/commands/service/chatflows.js +30 -0
- package/dist/commands/service/chatflows.js.map +1 -0
- package/dist/commands/service/index.d.ts +3 -0
- package/dist/commands/service/index.js +25 -0
- package/dist/commands/service/index.js.map +1 -0
- package/dist/commands/service/knowledge-base.d.ts +3 -0
- package/dist/commands/service/knowledge-base.js +19 -0
- package/dist/commands/service/knowledge-base.js.map +1 -0
- package/dist/commands/service/pipelines.d.ts +3 -0
- package/dist/commands/service/pipelines.js +36 -0
- package/dist/commands/service/pipelines.js.map +1 -0
- package/dist/commands/settings/index.d.ts +3 -0
- package/dist/commands/settings/index.js +149 -0
- package/dist/commands/settings/index.js.map +1 -0
- package/dist/commands/site-search/index.d.ts +3 -0
- package/dist/commands/site-search/index.js +36 -0
- package/dist/commands/site-search/index.js.map +1 -0
- package/dist/commands/timeline/index.d.ts +3 -0
- package/dist/commands/timeline/index.js +32 -0
- package/dist/commands/timeline/index.js.map +1 -0
- package/dist/commands/webhooks/index.d.ts +3 -0
- package/dist/commands/webhooks/index.js +41 -0
- package/dist/commands/webhooks/index.js.map +1 -0
- package/dist/commands/workflows/index.d.ts +3 -0
- package/dist/commands/workflows/index.js +13 -0
- package/dist/commands/workflows/index.js.map +1 -0
- package/dist/core/auth.d.ts +33 -0
- package/dist/core/auth.js +137 -0
- package/dist/core/auth.js.map +1 -0
- package/dist/core/capabilities.d.ts +60 -0
- package/dist/core/capabilities.js +559 -0
- package/dist/core/capabilities.js.map +1 -0
- package/dist/core/http.d.ts +47 -0
- package/dist/core/http.js +433 -0
- package/dist/core/http.js.map +1 -0
- package/dist/core/output.d.ts +23 -0
- package/dist/core/output.js +197 -0
- package/dist/core/output.js.map +1 -0
- package/dist/core/permissions.d.ts +9 -0
- package/dist/core/permissions.js +27 -0
- package/dist/core/permissions.js.map +1 -0
- package/dist/core/plugins.d.ts +42 -0
- package/dist/core/plugins.js +94 -0
- package/dist/core/plugins.js.map +1 -0
- package/dist/core/policy.d.ts +2 -0
- package/dist/core/policy.js +38 -0
- package/dist/core/policy.js.map +1 -0
- package/dist/core/schema-cache.d.ts +56 -0
- package/dist/core/schema-cache.js +338 -0
- package/dist/core/schema-cache.js.map +1 -0
- package/dist/core/schemas.d.ts +96 -0
- package/dist/core/schemas.js +104 -0
- package/dist/core/schemas.js.map +1 -0
- package/dist/core/urls.d.ts +50 -0
- package/dist/core/urls.js +122 -0
- package/dist/core/urls.js.map +1 -0
- package/dist/core/vault.d.ts +37 -0
- package/dist/core/vault.js +143 -0
- package/dist/core/vault.js.map +1 -0
- package/dist/mcp/server.d.ts +5 -0
- package/dist/mcp/server.js +680 -0
- package/dist/mcp/server.js.map +1 -0
- package/package.json +84 -0
package/README.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# hubcli
|
|
2
|
+
|
|
3
|
+
[](https://github.com/Luigi08001/hscli/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@revfleet/hscli)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](package.json)
|
|
7
|
+
[-7c3aed)](docs/TIERS.md)
|
|
8
|
+
|
|
9
|
+
**The headless HubSpot CLI + MCP server. 100% public API coverage (1,180 endpoints, 55+ command domains), enterprise safety rails, self-hosted.**
|
|
10
|
+
|
|
11
|
+
## Get started in 30 seconds
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# 1. Install
|
|
15
|
+
npm install -g @revfleet/hscli
|
|
16
|
+
|
|
17
|
+
# 2. Auth with a HubSpot Private App token (create one at
|
|
18
|
+
# Settings → Integrations → Private Apps → Create private app)
|
|
19
|
+
printf '%s' 'pat-eu1-XXXX-XXXX-XXXX' | hscli auth login --token-stdin
|
|
20
|
+
|
|
21
|
+
# 3. Read
|
|
22
|
+
hscli crm contacts list --limit 5
|
|
23
|
+
|
|
24
|
+
# 4. Write (dry-run by default, --force to execute)
|
|
25
|
+
hscli --force crm contacts create --data '{"properties":{"email":"jane@example.com"}}'
|
|
26
|
+
|
|
27
|
+
# 5. Run as an MCP server for Claude Desktop, Cursor, Claude Code
|
|
28
|
+
hscli mcp
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
That's the whole thing. For the full picture of what's available, read on.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
<details>
|
|
36
|
+
<summary><strong>Full coverage map (55+ domains)</strong></summary>
|
|
37
|
+
|
|
38
|
+
hubcli gives you one TypeScript binary that covers **every** endpoint of HubSpot's public API surface — verified against a scrape of HubSpot's own dev docs (1,178 source files, 1,180 endpoints). Whether an endpoint actually returns data on *your* portal depends on the HubSpot tier you're on (see [docs/TIERS.md](docs/TIERS.md)). hubcli exposes them all.
|
|
39
|
+
|
|
40
|
+
- **Full CRM** — contacts, companies, deals, tickets, leads, quotes, products, line items, orders, carts, discounts, fees, taxes, invoices, subscriptions, payments, goals, communications, users, feedback-submissions, custom objects, properties (+ legacy v1/v2), pipelines, associations v4 (+ labels CRUD + dated 2025-09), owners, imports, exports, engagements (notes/tasks/calls/meetings), sync, describe/validate, timeline, CRM Cards (UI Extensions), filter + count primitives on every object
|
|
41
|
+
- **Marketing** — emails (v3 + legacy v1, per-email stats), campaigns, ads, social, SEO, landing pages, transactional, subscriptions, events (+ attendance + participations), behavioral events, forms, form integrations, legacy email events stream (per-recipient)
|
|
42
|
+
- **Sales** — sequences (+ enroll/unenroll), meetings, calling, goals, scheduler (meeting links, book/reschedule/cancel), sales extensions (videoconferencing, accounting)
|
|
43
|
+
- **Service** — conversations (threads, messages, inboxes, channels, channel-accounts, actors, custom-channels), feedback, chatflows, knowledge-base, ticket pipelines, visitor-identification
|
|
44
|
+
- **CMS** — site pages, landing pages (+ folders), blog posts (+ authors + tags + blog-settings), HubDB (tables, rows, drafts, publishing), URL redirects, source-code, domains, SEO audit, site search, topics, audit-logs, comments, legacy content/api/v2 (Pages, Layouts, Templates, Modules, UrlMappings)
|
|
45
|
+
- **Settings** — users, teams, business units, currencies, GDPR, audit-logs, communication preferences (v3 + v4 batch)
|
|
46
|
+
- **Account** — info, audit-logs, private-apps, API usage
|
|
47
|
+
- **Operations** — lists (+ folders + memberships), reporting, exports, workflows (v4 + legacy v2/v3), automation custom actions, webhooks (subscriptions), timeline (templates + events + integrators)
|
|
48
|
+
- **Commerce Hub** — quotes, products, line-items, invoices, subscriptions, payments, orders, carts, discounts, fees, taxes, payments-subscriptions, tax rates
|
|
49
|
+
- **Developer Platform** — feature flags, CRM cards, integrators timeline, media bridge (properties + schemas + settings + events), extensions (calling + videoconferencing + accounting + sales)
|
|
50
|
+
- **Legacy v1/v2** — contacts-v1, companies-v2, deals-v1, owners-v2, engagements-v1, properties-legacy, reports-v2, calling-v1, channels, broadcast, appinstalls, marketing-emails-v1
|
|
51
|
+
- **Niche** — email events, email events per-recipient stream, submissions, visitor-identification, scheduler, tax, appinstalls, marketing-extras, owners-extras
|
|
52
|
+
- **Raw API** command with path-scope controls + OAuth flow support
|
|
53
|
+
- **Built-in MCP server** over stdio (140+ tools) for Claude Desktop, Cursor, Claude Code, any MCP client
|
|
54
|
+
|
|
55
|
+
Enterprise-grade from day one: `--dry-run`, `--force`, policy files, change tickets, capability probing, rate-limit intelligence, token redaction, path scope allowlisting, idempotency keys.
|
|
56
|
+
|
|
57
|
+
</details>
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## How it compares
|
|
61
|
+
|
|
62
|
+
The HubSpot CLI + MCP space is crowded:
|
|
63
|
+
|
|
64
|
+
- **[HubSpot's official CLI](https://github.com/HubSpot/hubspot-cli)** (`@hubspot/cli`, `hs`) — scoped to CMS authoring (themes, serverless, HubDB sync). Complementary, not competing.
|
|
65
|
+
- **[HubSpot's official MCP server](https://github.com/hubspot/mcp-server)** — public repo exists but empty as of writing. Remote MCP service announced.
|
|
66
|
+
- **[Composio](https://composio.dev/toolkits/hubspot)** — hosted SaaS MCP at `connect.composio.dev/mcp`, part of their 850-app adapter platform. Proprietary, they hold your token on their infra (SOC 2 Type 2).
|
|
67
|
+
- **Community OSS MCP servers** — [peakmojo/mcp-hubspot](https://github.com/peakmojo/mcp-hubspot), [lkm1developer/hubspot-mcp-server](https://github.com/lkm1developer/hubspot-mcp-server), [shinzo-labs/hubspot-mcp](https://github.com/shinzo-labs/hubspot-mcp), [CData's hubspot-mcp-server](https://github.com/CDataSoftware/hubspot-mcp-server-by-cdata), and ~15 others on GitHub.
|
|
68
|
+
|
|
69
|
+
hubcli's emphasis:
|
|
70
|
+
|
|
71
|
+
1. **CLI-first with MCP as a peer surface.** Every MCP tool has a matching `hubcli` command — same write gates, same redaction, same capability probing in both.
|
|
72
|
+
2. **Self-hosted and token-sovereign.** Your HubSpot private app token never leaves your machine. Contrast with Composio.
|
|
73
|
+
3. **Enterprise safety gates.** `--dry-run`, `--force`, policy files, change tickets, path scope allowlisting, idempotency keys. Most community MCP servers don't have these.
|
|
74
|
+
4. **HubSpot-native engineering.** Reads HubSpot's `X-HubSpot-RateLimit-*` headers, proactive throttling, capability probing by `portalId + scopes`, offline schema validation, idempotency-key on every write.
|
|
75
|
+
5. **Used in production.** Powers [CRMforge](https://crmforge.ai), the AI HubSpot consultant.
|
|
76
|
+
|
|
77
|
+
Full landscape: [docs/LAUNCH/COMPETITIVE-LANDSCAPE.md](docs/LAUNCH/COMPETITIVE-LANDSCAPE.md).
|
|
78
|
+
|
|
79
|
+
## "100% coverage" — what that means
|
|
80
|
+
|
|
81
|
+
hubcli's coverage claim is precise: **every one of HubSpot's 1,180 documented public API endpoints has a corresponding CLI subcommand.** This is verified against an automated scrape of HubSpot's developer documentation (committed at [docs/TESTING/PORTAL-147975758-COVERAGE.md](docs/TESTING/PORTAL-147975758-COVERAGE.md) and [PORTAL-147975758-WRITES.md](docs/TESTING/PORTAL-147975758-WRITES.md)).
|
|
82
|
+
|
|
83
|
+
It does **not** mean every endpoint returns 2xx on your portal — HubSpot tier-locks hundreds of endpoints behind paid plans:
|
|
84
|
+
|
|
85
|
+
| Portal profile | Reachable endpoints (read + write) |
|
|
86
|
+
|---|---:|
|
|
87
|
+
| Free account | ~550 / 1180 (46.6%) |
|
|
88
|
+
| Starter hubs | ~640 / 1180 (54.2%) |
|
|
89
|
+
| Professional hubs | ~890 / 1180 (75.4%) |
|
|
90
|
+
| Enterprise hubs (all) + Commerce + Ops | ~1140 / 1180 (96.6%) |
|
|
91
|
+
| Developer App OAuth install | adds ~30 app-dev endpoints |
|
|
92
|
+
| Legacy hapikey (pre-June-2023 accounts) | adds ~40 zombie endpoints |
|
|
93
|
+
|
|
94
|
+
See [docs/TIERS.md](docs/TIERS.md) for the exact endpoint → tier mapping.
|
|
95
|
+
|
|
96
|
+
**If an endpoint your portal should access doesn't work**, open an [endpoint issue](https://github.com/Luigi08001/hscli/issues/new?template=endpoint_not_working.md) — we triage these fast.
|
|
97
|
+
|
|
98
|
+
## Install
|
|
99
|
+
|
|
100
|
+
From npm (once published):
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npm install -g @revfleet/hscli
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
From source:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
git clone https://github.com/Luigi08001/hscli.git
|
|
110
|
+
cd hubcli
|
|
111
|
+
npm install
|
|
112
|
+
npm run build
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Quickstart
|
|
116
|
+
|
|
117
|
+
Save a token (recommended — avoids shell history):
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
printf '%s' '<HUBSPOT_PRIVATE_APP_TOKEN>' | hscli auth login --token-stdin
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Inline token (also supported):
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
hscli auth login --token <HUBSPOT_PRIVATE_APP_TOKEN>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Read:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
hscli crm contacts list --limit 5
|
|
133
|
+
hscli marketing emails stats 123456
|
|
134
|
+
hubcli sales sequences list
|
|
135
|
+
hubcli reporting dashboards list
|
|
136
|
+
hscli settings teams list
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Dry-run write:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
hscli --dry-run crm contacts create --data '{"properties":{"email":"test@example.com"}}'
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Live write (explicit):
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
hscli --force crm contacts create --data '{"properties":{"email":"test@example.com"}}'
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Policy-guarded delete with change ticket:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
hscli --force --policy-file docs/POLICY_EXAMPLE.json --change-ticket CHG-123 \
|
|
155
|
+
crm contacts delete 123
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Output modes
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
hscli --json crm companies list --limit 3 # JSON envelope
|
|
162
|
+
hscli --format csv crm contacts list --limit 5 # CSV
|
|
163
|
+
hscli --format yaml crm deals get 123 # YAML
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## MCP: AI agents as first-class consumers
|
|
167
|
+
|
|
168
|
+
hubcli ships a built-in MCP server over stdio with ~125 tools exposing the full surface:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
hscli mcp
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
For Claude Desktop, add to `claude_desktop_config.json`:
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"mcpServers": {
|
|
179
|
+
"hubcli": {
|
|
180
|
+
"command": "hubcli",
|
|
181
|
+
"args": ["mcp"],
|
|
182
|
+
"env": {
|
|
183
|
+
"HUBCLI_MCP_PROFILE": "default"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Restart Claude. Now Claude can list contacts, search deals, inspect workflows, and — with `--force` passed at tool-call time — perform safe writes. All CLI safety rails apply to MCP calls. Secrets are redacted from every tool response. `HUBCLI_MCP_PROFILE` locks the stdio server to one auth profile to prevent cross-tenant access.
|
|
191
|
+
|
|
192
|
+
See [docs/MCP.md](docs/MCP.md) for the full tool catalog.
|
|
193
|
+
|
|
194
|
+
## Capability / tier awareness
|
|
195
|
+
|
|
196
|
+
Probe portal capabilities and cache them by `portalId + scopes`:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
hubcli doctor capabilities --refresh
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Fail fast when a command hits an unsupported endpoint:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
hscli --strict-capabilities marketing emails list
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Schema introspection + offline validation
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
hscli crm describe contacts --refresh-cache
|
|
212
|
+
hscli crm validate contacts --offline --data '{"properties":{"email":"x@example.com"}}'
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Local schema cache means you can validate payloads without hitting HubSpot.
|
|
216
|
+
|
|
217
|
+
## Runtime safety model
|
|
218
|
+
|
|
219
|
+
- Mutations are **blocked** unless `--force` is passed (or intercepted by `--dry-run`)
|
|
220
|
+
- Write/delete can be constrained by policy (`--policy-file`) and change-ticket enforcement
|
|
221
|
+
- Requests are origin-locked to `https://api.hubapi.com` and restricted to approved API path roots
|
|
222
|
+
- Path segments are hardened against traversal / control characters
|
|
223
|
+
- Output and error payloads are redacted for secrets and token-like strings
|
|
224
|
+
- Transport retries transient failures with exponential backoff
|
|
225
|
+
- Rate-limit controller reads `X-HubSpot-RateLimit-*` headers and throttles proactively
|
|
226
|
+
- All write / batch methods include `Idempotency-Key` for replay-safe retries
|
|
227
|
+
|
|
228
|
+
Full threat model: [SECURITY.md](SECURITY.md).
|
|
229
|
+
|
|
230
|
+
## Caches
|
|
231
|
+
|
|
232
|
+
Under `HUBCLI_HOME` (default: `~/.hubcli`):
|
|
233
|
+
|
|
234
|
+
- `auth.json` — profile tokens (0600 permissions, 0700 directory)
|
|
235
|
+
- `capabilities.json` — portal/tier capability cache
|
|
236
|
+
- `schema-cache.json` — CRM schema cache for describe/validate
|
|
237
|
+
- `auth.enc` — optional encrypted vault (when passphrase is set)
|
|
238
|
+
|
|
239
|
+
## Documentation
|
|
240
|
+
|
|
241
|
+
- [docs/COMMAND_TREE.md](docs/COMMAND_TREE.md) — full command surface
|
|
242
|
+
- [docs/WHY_HOW_WHAT.md](docs/WHY_HOW_WHAT.md) — design philosophy
|
|
243
|
+
- [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
|
|
244
|
+
- [docs/SAFETY_MODEL.md](docs/SAFETY_MODEL.md)
|
|
245
|
+
- [docs/MCP.md](docs/MCP.md) — MCP server tool catalog
|
|
246
|
+
- [docs/TESTING_PLAN.md](docs/TESTING_PLAN.md)
|
|
247
|
+
- [docs/RELEASE_GOVERNANCE.md](docs/RELEASE_GOVERNANCE.md)
|
|
248
|
+
- [docs/PLUGIN_GUIDE.md](docs/PLUGIN_GUIDE.md) — writing plugins
|
|
249
|
+
- [docs/OPERATIONAL_PLAYBOOKS.md](docs/OPERATIONAL_PLAYBOOKS.md)
|
|
250
|
+
- [docs/COOKBOOK.md](docs/COOKBOOK.md) — common recipes
|
|
251
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
252
|
+
- [SECURITY.md](SECURITY.md)
|
|
253
|
+
- [CHANGELOG.md](CHANGELOG.md)
|
|
254
|
+
|
|
255
|
+
### Domain setup guides
|
|
256
|
+
|
|
257
|
+
- [docs/PORTAL_SETUP.md](docs/PORTAL_SETUP.md)
|
|
258
|
+
- [docs/CMS_SETUP.md](docs/CMS_SETUP.md)
|
|
259
|
+
- [docs/COMMERCE_SETUP.md](docs/COMMERCE_SETUP.md)
|
|
260
|
+
- [docs/MARKETING_SETUP.md](docs/MARKETING_SETUP.md)
|
|
261
|
+
- [docs/SALES_SETUP.md](docs/SALES_SETUP.md)
|
|
262
|
+
- [docs/SERVICE_SETUP.md](docs/SERVICE_SETUP.md)
|
|
263
|
+
- [docs/OPERATIONS_SETUP.md](docs/OPERATIONS_SETUP.md)
|
|
264
|
+
- [docs/REPORTING_SETUP.md](docs/REPORTING_SETUP.md)
|
|
265
|
+
- [docs/INTEGRATIONS_NOTIFICATIONS_SETUP.md](docs/INTEGRATIONS_NOTIFICATIONS_SETUP.md)
|
|
266
|
+
|
|
267
|
+
## Verification
|
|
268
|
+
|
|
269
|
+
Full release check:
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
npm run release:verify
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Runs typecheck + lint + tests + audit + build + SHA256 checksum verification.
|
|
276
|
+
|
|
277
|
+
## Contributing
|
|
278
|
+
|
|
279
|
+
Issues and PRs welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for the workflow, coding standards, and how to run contract tests against a sandbox portal.
|
|
280
|
+
|
|
281
|
+
## License
|
|
282
|
+
|
|
283
|
+
MIT — see [LICENSE](LICENSE).
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
**Built as the foundation for [CRMforge](https://crmforge.ai)**, the AI HubSpot consultant. hubcli is open source so the ecosystem can build on it.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# SECURITY
|
|
2
|
+
|
|
3
|
+
> See also: [[SAFETY_MODEL]] · [[RELEASE_GOVERNANCE]] · [[hubspot-rules]]
|
|
4
|
+
|
|
5
|
+
## Security Objectives
|
|
6
|
+
- Prevent credential exposure
|
|
7
|
+
- Prevent unintended or unsafe CRM mutations
|
|
8
|
+
- Maintain auditable, deterministic CLI behavior
|
|
9
|
+
|
|
10
|
+
## Data Handling Policy
|
|
11
|
+
- Only required data for command execution is processed.
|
|
12
|
+
- Sensitive values (tokens, authorization-like fields) must never be logged in plaintext.
|
|
13
|
+
- Output and error payloads are redacted before serialization.
|
|
14
|
+
- JSON mode is preferred for machine handling to avoid ad-hoc parsing leaks.
|
|
15
|
+
|
|
16
|
+
## Secret Storage Policy
|
|
17
|
+
- Tokens are stored in profile-based auth file under `HUBCLI_HOME` or default `~/.hubcli`.
|
|
18
|
+
- File permissions are locked to owner-only (`0700` dir, `0600` auth file).
|
|
19
|
+
- Prefer `auth login --token-stdin` over inline `--token` to reduce shell-history/process-list exposure.
|
|
20
|
+
- No token echo in CLI responses.
|
|
21
|
+
- Roadmap item: optional encrypted keychain-backed storage.
|
|
22
|
+
|
|
23
|
+
## Auth Scope Minimization
|
|
24
|
+
- Use HubSpot private app tokens with minimum scopes required for the operation set.
|
|
25
|
+
- Separate profiles by environment (sandbox/prod) to reduce blast radius.
|
|
26
|
+
- Prefer read-only tokens for non-mutation workflows.
|
|
27
|
+
|
|
28
|
+
## Write Safety Policy
|
|
29
|
+
- All mutating commands must pass through centralized write gate.
|
|
30
|
+
- `--dry-run`: always available and non-mutating.
|
|
31
|
+
- `--force`: mandatory to execute actual writes.
|
|
32
|
+
- Missing `--force` blocks execution with explicit error code.
|
|
33
|
+
- Optional policy file gate:
|
|
34
|
+
- `--policy-file <path>` to enforce profile-level write/delete rules
|
|
35
|
+
- `--change-ticket <id>` required when policy mandates ticketed changes
|
|
36
|
+
- Dynamic path segments are validated/encoded and transport rejects paths escaping approved HubSpot API scopes.
|
|
37
|
+
- Dynamic `objectType` inputs are allowlisted (strict mode) with per-command-family scopes.
|
|
38
|
+
|
|
39
|
+
## Threat Model
|
|
40
|
+
- **Token theft:** local secret file compromise, output leak, or copied logs.
|
|
41
|
+
- **Replay/misuse:** stolen token used across environments.
|
|
42
|
+
- **Injection/malformed payload:** malformed or malicious JSON payloads.
|
|
43
|
+
- **Unsafe writes:** accidental execution of destructive changes.
|
|
44
|
+
- **Supply-chain compromise:** malicious dependency or tampered release artifact.
|
|
45
|
+
|
|
46
|
+
## Incident Response Checklist
|
|
47
|
+
1. Revoke affected HubSpot token(s) immediately.
|
|
48
|
+
2. Rotate credentials and recreate scopes minimally.
|
|
49
|
+
3. Audit recent command history and API activity.
|
|
50
|
+
4. Validate no plaintext secret leakage in logs/artifacts.
|
|
51
|
+
5. Patch root cause and add regression tests.
|
|
52
|
+
6. Re-run sandbox validation before production re-enable.
|
|
53
|
+
|
|
54
|
+
## Supply-Chain Hygiene Baseline
|
|
55
|
+
- Run `npm audit` regularly (pre-release required).
|
|
56
|
+
- Keep lockfile committed; pin direct dependencies intentionally.
|
|
57
|
+
- Review dependency upgrades (especially transitive risk hotspots).
|
|
58
|
+
- Generate deterministic SHA256 checksums for distributables: `npm run release:checksums`.
|
|
59
|
+
|
|
60
|
+
## Release Integrity Workflow (Baseline)
|
|
61
|
+
1. Build release artifacts: `npm run build`.
|
|
62
|
+
2. Generate checksum manifest: `npm run release:checksums`.
|
|
63
|
+
3. Review `release/checksums.sha256` and commit it with the release changes.
|
|
64
|
+
4. Verify checksums before publishing or installing from local artifacts:
|
|
65
|
+
- `shasum -a 256 -c release/checksums.sha256`
|
|
66
|
+
5. If any verification fails, stop release and rebuild from a trusted commit.
|
|
67
|
+
|
|
68
|
+
This baseline ensures release artifacts in `dist/` are tamper-evident between build and distribution.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { type CliContext } from "./core/output.js";
|
|
4
|
+
export declare function createProgram(): {
|
|
5
|
+
program: Command;
|
|
6
|
+
getCtx: () => CliContext;
|
|
7
|
+
};
|
|
8
|
+
export declare function run(argv?: string[]): Promise<void>;
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
import { registerAuth } from "./commands/auth/index.js";
|
|
5
|
+
import { registerDoctor } from "./commands/doctor/index.js";
|
|
6
|
+
import { registerCrm } from "./commands/crm/index.js";
|
|
7
|
+
import { registerMcp } from "./commands/mcp.js";
|
|
8
|
+
import { registerApi } from "./commands/api/index.js";
|
|
9
|
+
import { registerMarketing } from "./commands/marketing/index.js";
|
|
10
|
+
import { registerFiles } from "./commands/files/index.js";
|
|
11
|
+
import { registerForms } from "./commands/forms/index.js";
|
|
12
|
+
import { registerCms } from "./commands/cms/index.js";
|
|
13
|
+
import { registerWorkflows } from "./commands/workflows/index.js";
|
|
14
|
+
import { registerService } from "./commands/service/index.js";
|
|
15
|
+
import { registerWebhooks } from "./commands/webhooks/index.js";
|
|
16
|
+
import { registerSeed } from "./commands/seed/index.js";
|
|
17
|
+
import { registerLists } from "./commands/lists/index.js";
|
|
18
|
+
import { registerSales } from "./commands/sales/index.js";
|
|
19
|
+
import { registerReporting } from "./commands/reporting/index.js";
|
|
20
|
+
import { registerExports } from "./commands/exports/index.js";
|
|
21
|
+
import { registerSiteSearch } from "./commands/site-search/index.js";
|
|
22
|
+
import { registerTimeline } from "./commands/timeline/index.js";
|
|
23
|
+
import { registerConversations } from "./commands/conversations/index.js";
|
|
24
|
+
import { registerAutomation } from "./commands/automation/index.js";
|
|
25
|
+
import { registerSettings } from "./commands/settings/index.js";
|
|
26
|
+
import { registerAccount } from "./commands/account/index.js";
|
|
27
|
+
import { registerCommunicationPreferences } from "./commands/communication-preferences/index.js";
|
|
28
|
+
import { registerEvents } from "./commands/events/index.js";
|
|
29
|
+
import { registerEmailEvents } from "./commands/email-events/index.js";
|
|
30
|
+
import { registerMediaBridge } from "./commands/media-bridge/index.js";
|
|
31
|
+
import { registerFeatureFlags } from "./commands/feature-flags/index.js";
|
|
32
|
+
import { registerMarketingEmailsV1 } from "./commands/marketing-emails-v1/index.js";
|
|
33
|
+
import { registerIntegrators } from "./commands/integrators/index.js";
|
|
34
|
+
import { registerIntegrations } from "./commands/integrations/index.js";
|
|
35
|
+
import { registerExtensions } from "./commands/extensions/index.js";
|
|
36
|
+
import { registerBroadcast, registerVisitorIdentification, registerSubmissions, registerScheduler, registerTax, registerAppinstalls, registerMarketingExtras, registerOwnersExtras, registerBusinessUnits, registerBroadcastsRoot, registerFormIntegrations, } from "./commands/legacy/index.js";
|
|
37
|
+
import { registerContactsV1, registerCompaniesV2, registerDealsV1, registerOwnersV2, registerEngagementsV1, registerPropertiesLegacy, registerReportsV2, registerPaymentsSubscriptions, registerContentV2, registerSalesExtensions, registerComments, registerCallingV1, registerChannels, } from "./commands/legacy-v1/index.js";
|
|
38
|
+
import { CliError, printError } from "./core/output.js";
|
|
39
|
+
import { loadPlugins } from "./core/plugins.js";
|
|
40
|
+
import pkg from "../package.json" with { type: "json" };
|
|
41
|
+
export function createProgram() {
|
|
42
|
+
const program = new Command();
|
|
43
|
+
let ctx = { profile: "default", json: false, dryRun: false, force: false, strictCapabilities: false, format: "table" };
|
|
44
|
+
const runId = randomUUID();
|
|
45
|
+
program
|
|
46
|
+
.name("hubcli")
|
|
47
|
+
.description("HubSpot CLI")
|
|
48
|
+
.version(pkg.version)
|
|
49
|
+
.option("--profile <name>", "Auth profile", "default")
|
|
50
|
+
.option("--json", "JSON output")
|
|
51
|
+
.option("--format <mode>", "Output format: json|table|csv|yaml")
|
|
52
|
+
.option("--dry-run", "Simulate writes")
|
|
53
|
+
.option("--force", "Confirm write operations")
|
|
54
|
+
.option("--strict-capabilities", "Fail fast when endpoint capability status is unknown")
|
|
55
|
+
.option("--policy-file <path>", "Policy file controlling write/delete permissions")
|
|
56
|
+
.option("--change-ticket <id>", "Change ticket reference for guarded writes")
|
|
57
|
+
.option("--telemetry-file <path>", "Append request telemetry JSON lines to a local file")
|
|
58
|
+
.hook("preAction", (cmd) => {
|
|
59
|
+
const opts = cmd.optsWithGlobals();
|
|
60
|
+
const telemetryFile = opts.telemetryFile ? String(opts.telemetryFile).trim() : undefined;
|
|
61
|
+
ctx = {
|
|
62
|
+
profile: opts.profile ?? "default",
|
|
63
|
+
json: Boolean(opts.json),
|
|
64
|
+
format: resolveOutputFormat(opts.format, Boolean(opts.json)),
|
|
65
|
+
dryRun: Boolean(opts.dryRun),
|
|
66
|
+
force: Boolean(opts.force),
|
|
67
|
+
strictCapabilities: Boolean(opts.strictCapabilities),
|
|
68
|
+
policyFile: opts.policyFile ? String(opts.policyFile).trim() : undefined,
|
|
69
|
+
changeTicket: opts.changeTicket ? String(opts.changeTicket).trim() : undefined,
|
|
70
|
+
runId,
|
|
71
|
+
telemetryFile,
|
|
72
|
+
};
|
|
73
|
+
process.env.HSCLI_PROFILE = ctx.profile;
|
|
74
|
+
process.env.HSCLI_STRICT_CAPABILITIES = ctx.strictCapabilities ? "1" : "0";
|
|
75
|
+
process.env.HSCLI_REQUEST_ID = runId;
|
|
76
|
+
if (telemetryFile)
|
|
77
|
+
process.env.HSCLI_TELEMETRY_FILE = telemetryFile;
|
|
78
|
+
});
|
|
79
|
+
registerAuth(program, () => ctx);
|
|
80
|
+
registerDoctor(program, () => ctx);
|
|
81
|
+
registerCrm(program, () => ctx);
|
|
82
|
+
registerMarketing(program, () => ctx);
|
|
83
|
+
registerForms(program, () => ctx);
|
|
84
|
+
registerFiles(program, () => ctx);
|
|
85
|
+
registerCms(program, () => ctx);
|
|
86
|
+
registerWorkflows(program, () => ctx);
|
|
87
|
+
registerService(program, () => ctx);
|
|
88
|
+
registerWebhooks(program, () => ctx);
|
|
89
|
+
registerApi(program, () => ctx);
|
|
90
|
+
registerSeed(program, () => ctx);
|
|
91
|
+
registerLists(program, () => ctx);
|
|
92
|
+
registerSales(program, () => ctx);
|
|
93
|
+
registerReporting(program, () => ctx);
|
|
94
|
+
registerExports(program, () => ctx);
|
|
95
|
+
registerSiteSearch(program, () => ctx);
|
|
96
|
+
registerTimeline(program, () => ctx);
|
|
97
|
+
registerConversations(program, () => ctx);
|
|
98
|
+
registerAutomation(program, () => ctx);
|
|
99
|
+
registerSettings(program, () => ctx);
|
|
100
|
+
registerAccount(program, () => ctx);
|
|
101
|
+
registerCommunicationPreferences(program, () => ctx);
|
|
102
|
+
registerEvents(program, () => ctx);
|
|
103
|
+
registerEmailEvents(program, () => ctx);
|
|
104
|
+
registerMediaBridge(program, () => ctx);
|
|
105
|
+
registerFeatureFlags(program, () => ctx);
|
|
106
|
+
registerMarketingEmailsV1(program, () => ctx);
|
|
107
|
+
registerIntegrators(program, () => ctx);
|
|
108
|
+
registerIntegrations(program, () => ctx);
|
|
109
|
+
registerExtensions(program, () => ctx);
|
|
110
|
+
registerBroadcast(program, () => ctx);
|
|
111
|
+
registerVisitorIdentification(program, () => ctx);
|
|
112
|
+
registerSubmissions(program, () => ctx);
|
|
113
|
+
registerScheduler(program, () => ctx);
|
|
114
|
+
registerTax(program, () => ctx);
|
|
115
|
+
registerAppinstalls(program, () => ctx);
|
|
116
|
+
registerMarketingExtras(program, () => ctx);
|
|
117
|
+
registerOwnersExtras(program, () => ctx);
|
|
118
|
+
registerContactsV1(program, () => ctx);
|
|
119
|
+
registerCompaniesV2(program, () => ctx);
|
|
120
|
+
registerDealsV1(program, () => ctx);
|
|
121
|
+
registerOwnersV2(program, () => ctx);
|
|
122
|
+
registerEngagementsV1(program, () => ctx);
|
|
123
|
+
registerPropertiesLegacy(program, () => ctx);
|
|
124
|
+
registerReportsV2(program, () => ctx);
|
|
125
|
+
registerPaymentsSubscriptions(program, () => ctx);
|
|
126
|
+
registerContentV2(program, () => ctx);
|
|
127
|
+
registerSalesExtensions(program, () => ctx);
|
|
128
|
+
registerComments(program, () => ctx);
|
|
129
|
+
registerCallingV1(program, () => ctx);
|
|
130
|
+
registerChannels(program, () => ctx);
|
|
131
|
+
registerBusinessUnits(program, () => ctx);
|
|
132
|
+
registerBroadcastsRoot(program, () => ctx);
|
|
133
|
+
registerFormIntegrations(program, () => ctx);
|
|
134
|
+
registerMcp(program);
|
|
135
|
+
program.configureOutput({
|
|
136
|
+
outputError: (str, write) => {
|
|
137
|
+
const msg = str.trim();
|
|
138
|
+
printError(ctx, new CliError("CLI_PARSE_ERROR", msg));
|
|
139
|
+
write("");
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
return { program, getCtx: () => ctx };
|
|
143
|
+
}
|
|
144
|
+
export async function run(argv = process.argv) {
|
|
145
|
+
const { program, getCtx } = createProgram();
|
|
146
|
+
await loadPlugins(program, getCtx);
|
|
147
|
+
try {
|
|
148
|
+
await program.parseAsync(argv);
|
|
149
|
+
}
|
|
150
|
+
catch (err) {
|
|
151
|
+
const opts = program.opts();
|
|
152
|
+
let format;
|
|
153
|
+
try {
|
|
154
|
+
format = resolveOutputFormat(opts.format, Boolean(opts.json));
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
format = opts.json ? "json" : "table";
|
|
158
|
+
}
|
|
159
|
+
const ctx = {
|
|
160
|
+
profile: opts.profile ?? "default",
|
|
161
|
+
json: Boolean(opts.json),
|
|
162
|
+
format,
|
|
163
|
+
dryRun: Boolean(opts.dryRun),
|
|
164
|
+
force: Boolean(opts.force),
|
|
165
|
+
strictCapabilities: Boolean(opts.strictCapabilities),
|
|
166
|
+
policyFile: opts.policyFile ? String(opts.policyFile).trim() : undefined,
|
|
167
|
+
changeTicket: opts.changeTicket ? String(opts.changeTicket).trim() : undefined,
|
|
168
|
+
runId: process.env.HSCLI_REQUEST_ID,
|
|
169
|
+
telemetryFile: opts.telemetryFile ? String(opts.telemetryFile).trim() : undefined,
|
|
170
|
+
};
|
|
171
|
+
printError(ctx, err);
|
|
172
|
+
process.exitCode = 1;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
import { pathToFileURL } from "node:url";
|
|
176
|
+
import { resolve } from "node:path";
|
|
177
|
+
if (import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
|
|
178
|
+
void run();
|
|
179
|
+
}
|
|
180
|
+
function resolveOutputFormat(raw, jsonFlag) {
|
|
181
|
+
const fallback = "table";
|
|
182
|
+
const value = (raw === undefined || raw === null) ? fallback : String(raw).trim().toLowerCase();
|
|
183
|
+
const allowed = new Set(["json", "table", "csv", "yaml"]);
|
|
184
|
+
if (!allowed.has(value)) {
|
|
185
|
+
throw new CliError("INVALID_FORMAT", "format must be one of: json, table, csv, yaml");
|
|
186
|
+
}
|
|
187
|
+
if (jsonFlag && value !== "json" && raw !== undefined && raw !== null) {
|
|
188
|
+
throw new CliError("INVALID_FORMAT", "--json cannot be combined with --format != json");
|
|
189
|
+
}
|
|
190
|
+
return jsonFlag ? "json" : value;
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,aAA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CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACrE,KAAK,GAAG,EAAE,CAAC;AACb,CAAC;AAED,SAAS,mBAAmB,CAAC,GAAY,EAAE,QAAiB;IAC1D,MAAM,QAAQ,GAAG,OAAO,CAAC;IACzB,MAAM,KAAK,GAAG,CAAC,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAChG,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,QAAQ,CAAC,gBAAgB,EAAE,+CAA+C,CAAC,CAAC;IACxF,CAAC;IACD,IAAI,QAAQ,IAAI,KAAK,KAAK,MAAM,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACtE,MAAM,IAAI,QAAQ,CAAC,gBAAgB,EAAE,iDAAiD,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAE,KAA2C,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getToken } from "../../core/auth.js";
|
|
2
|
+
import { HubSpotClient } from "../../core/http.js";
|
|
3
|
+
import { printResult } from "../../core/output.js";
|
|
4
|
+
import { parseNumberFlag } from "../crm/shared.js";
|
|
5
|
+
export function registerAccount(program, getCtx) {
|
|
6
|
+
const account = program.command("account").description("HubSpot account information and audit");
|
|
7
|
+
account
|
|
8
|
+
.command("info")
|
|
9
|
+
.description("Get account details and usage")
|
|
10
|
+
.action(async () => {
|
|
11
|
+
const ctx = getCtx();
|
|
12
|
+
const client = new HubSpotClient(getToken(ctx.profile));
|
|
13
|
+
const res = await client.request("/account-info/v3/details");
|
|
14
|
+
printResult(ctx, res);
|
|
15
|
+
});
|
|
16
|
+
account
|
|
17
|
+
.command("audit-logs")
|
|
18
|
+
.description("Account activity audit log (Enterprise)")
|
|
19
|
+
.option("--limit <n>", "Max records", "50")
|
|
20
|
+
.option("--after <cursor>", "Paging cursor")
|
|
21
|
+
.option("--user-id <id>", "Filter by user ID")
|
|
22
|
+
.option("--event-type <type>", "Filter by event type")
|
|
23
|
+
.option("--object-type <type>", "Filter by object type")
|
|
24
|
+
.option("--occurred-after <iso>", "Only events after ISO datetime")
|
|
25
|
+
.option("--occurred-before <iso>", "Only events before ISO datetime")
|
|
26
|
+
.action(async (opts) => {
|
|
27
|
+
const ctx = getCtx();
|
|
28
|
+
const client = new HubSpotClient(getToken(ctx.profile));
|
|
29
|
+
const params = new URLSearchParams();
|
|
30
|
+
params.set("limit", String(parseNumberFlag(opts.limit, "--limit")));
|
|
31
|
+
if (opts.after)
|
|
32
|
+
params.set("after", opts.after);
|
|
33
|
+
if (opts.userId)
|
|
34
|
+
params.set("userId", opts.userId);
|
|
35
|
+
if (opts.eventType)
|
|
36
|
+
params.set("eventType", opts.eventType);
|
|
37
|
+
if (opts.objectType)
|
|
38
|
+
params.set("objectType", opts.objectType);
|
|
39
|
+
if (opts.occurredAfter)
|
|
40
|
+
params.set("occurredAfter", opts.occurredAfter);
|
|
41
|
+
if (opts.occurredBefore)
|
|
42
|
+
params.set("occurredBefore", opts.occurredBefore);
|
|
43
|
+
const res = await client.request(`/account-info/v3/activity/audit-logs/list?${params.toString()}`);
|
|
44
|
+
printResult(ctx, res);
|
|
45
|
+
});
|
|
46
|
+
account
|
|
47
|
+
.command("private-apps")
|
|
48
|
+
.description("List private apps installed in the portal (integration audit proxy)")
|
|
49
|
+
.action(async () => {
|
|
50
|
+
const ctx = getCtx();
|
|
51
|
+
const client = new HubSpotClient(getToken(ctx.profile));
|
|
52
|
+
const res = await client.request("/account-info/v3/api-usage/daily/private-apps");
|
|
53
|
+
printResult(ctx, res);
|
|
54
|
+
});
|
|
55
|
+
account
|
|
56
|
+
.command("api-usage")
|
|
57
|
+
.description("Daily API usage totals (portal-wide)")
|
|
58
|
+
.action(async () => {
|
|
59
|
+
const ctx = getCtx();
|
|
60
|
+
const client = new HubSpotClient(getToken(ctx.profile));
|
|
61
|
+
const res = await client.request("/account-info/v3/api-usage/daily");
|
|
62
|
+
printResult(ctx, res);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/account/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,UAAU,eAAe,CAAC,OAAgB,EAAE,MAAwB;IACxE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,uCAAuC,CAAC,CAAC;IAEhG,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,+BAA+B,CAAC;SAC5C,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QACxD,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;QAC7D,WAAW,CAAC,GAAG,EAAE,GA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