@revfleet/hscli 0.8.11 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +186 -0
- package/README.md +223 -10
- package/dist/cli.js +29 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/agent/contracts.d.ts +3 -0
- package/dist/commands/agent/contracts.js +139 -0
- package/dist/commands/agent/contracts.js.map +1 -0
- package/dist/commands/agent/index.d.ts +3 -0
- package/dist/commands/agent/index.js +188 -0
- package/dist/commands/agent/index.js.map +1 -0
- package/dist/commands/agent/recipes.d.ts +13 -0
- package/dist/commands/agent/recipes.js +108 -0
- package/dist/commands/agent/recipes.js.map +1 -0
- package/dist/commands/agent/runner.d.ts +16 -0
- package/dist/commands/agent/runner.js +165 -0
- package/dist/commands/agent/runner.js.map +1 -0
- package/dist/commands/auth/index.js +64 -7
- package/dist/commands/auth/index.js.map +1 -1
- package/dist/commands/automation/index.js +30 -0
- package/dist/commands/automation/index.js.map +1 -1
- package/dist/commands/backup/index.d.ts +12 -0
- package/dist/commands/backup/index.js +459 -0
- package/dist/commands/backup/index.js.map +1 -0
- package/dist/commands/cms/content-ops.js +1 -1
- package/dist/commands/cms/content-ops.js.map +1 -1
- package/dist/commands/communication-preferences/index.js +207 -7
- package/dist/commands/communication-preferences/index.js.map +1 -1
- package/dist/commands/content-permissions/index.d.ts +22 -0
- package/dist/commands/content-permissions/index.js +141 -0
- package/dist/commands/content-permissions/index.js.map +1 -0
- package/dist/commands/context/index.d.ts +3 -0
- package/dist/commands/context/index.js +182 -0
- package/dist/commands/context/index.js.map +1 -0
- package/dist/commands/crm/associations.js +38 -0
- package/dist/commands/crm/associations.js.map +1 -1
- package/dist/commands/crm/custom-objects.js +39 -2
- package/dist/commands/crm/custom-objects.js.map +1 -1
- package/dist/commands/crm/dated.js +3 -3
- package/dist/commands/crm/dated.js.map +1 -1
- package/dist/commands/crm/migration.js +210 -2
- package/dist/commands/crm/migration.js.map +1 -1
- package/dist/commands/crm/properties.js +2 -1
- package/dist/commands/crm/properties.js.map +1 -1
- package/dist/commands/crm/property-batch.d.ts +1 -0
- package/dist/commands/crm/property-batch.js +44 -5
- package/dist/commands/crm/property-batch.js.map +1 -1
- package/dist/commands/crm/shared.js +21 -2
- package/dist/commands/crm/shared.js.map +1 -1
- package/dist/commands/crm/sync.js +1 -1
- package/dist/commands/crm/sync.js.map +1 -1
- package/dist/commands/doctor/index.js +193 -0
- package/dist/commands/doctor/index.js.map +1 -1
- package/dist/commands/email-tracking/index.d.ts +16 -0
- package/dist/commands/email-tracking/index.js +314 -0
- package/dist/commands/email-tracking/index.js.map +1 -0
- package/dist/commands/extensions/index.js +1 -1
- package/dist/commands/extensions/index.js.map +1 -1
- package/dist/commands/forms/index.js +15 -2
- package/dist/commands/forms/index.js.map +1 -1
- package/dist/commands/forms/legacy-v2.d.ts +7 -2
- package/dist/commands/forms/legacy-v2.js +103 -7
- package/dist/commands/forms/legacy-v2.js.map +1 -1
- package/dist/commands/guide/index.d.ts +3 -0
- package/dist/commands/guide/index.js +75 -16
- package/dist/commands/guide/index.js.map +1 -1
- package/dist/commands/internal/catalog.d.ts +1 -0
- package/dist/commands/internal/catalog.js +2 -0
- package/dist/commands/internal/catalog.js.map +1 -0
- package/dist/commands/internal/index.d.ts +26 -0
- package/dist/commands/internal/index.js +823 -0
- package/dist/commands/internal/index.js.map +1 -0
- package/dist/commands/internal-session.d.ts +15 -0
- package/dist/commands/internal-session.js +152 -0
- package/dist/commands/internal-session.js.map +1 -0
- package/dist/commands/lists/index.js +1 -1
- package/dist/commands/lists/index.js.map +1 -1
- package/dist/commands/marketing/email-audit.d.ts +32 -0
- package/dist/commands/marketing/email-audit.js +121 -0
- package/dist/commands/marketing/email-audit.js.map +1 -0
- package/dist/commands/marketing/index.js +2 -0
- package/dist/commands/marketing/index.js.map +1 -1
- package/dist/commands/mcp.js +5 -3
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/playbooks/index.d.ts +3 -0
- package/dist/commands/playbooks/index.js +228 -0
- package/dist/commands/playbooks/index.js.map +1 -0
- package/dist/commands/portals/index.d.ts +3 -0
- package/dist/commands/portals/index.js +132 -0
- package/dist/commands/portals/index.js.map +1 -0
- package/dist/commands/reports/index.d.ts +3 -0
- package/dist/commands/reports/index.js +479 -0
- package/dist/commands/reports/index.js.map +1 -0
- package/dist/commands/sales-content/index.d.ts +13 -0
- package/dist/commands/sales-content/index.js +59 -0
- package/dist/commands/sales-content/index.js.map +1 -0
- package/dist/commands/sales-templates/index.d.ts +3 -0
- package/dist/commands/sales-templates/index.js +88 -0
- package/dist/commands/sales-templates/index.js.map +1 -0
- package/dist/commands/seed/cms.js +28 -45
- package/dist/commands/seed/cms.js.map +1 -1
- package/dist/commands/sequences/index.d.ts +18 -0
- package/dist/commands/sequences/index.js +263 -0
- package/dist/commands/sequences/index.js.map +1 -0
- package/dist/commands/settings/index.js +450 -102
- package/dist/commands/settings/index.js.map +1 -1
- package/dist/commands/settings/site-settings.d.ts +3 -0
- package/dist/commands/settings/site-settings.js +106 -0
- package/dist/commands/settings/site-settings.js.map +1 -0
- package/dist/commands/ui/index.d.ts +3 -0
- package/dist/commands/ui/index.js +422 -0
- package/dist/commands/ui/index.js.map +1 -0
- package/dist/commands/workflows/index.js +2 -0
- package/dist/commands/workflows/index.js.map +1 -1
- package/dist/commands/workflows/preflight.d.ts +23 -0
- package/dist/commands/workflows/preflight.js +295 -0
- package/dist/commands/workflows/preflight.js.map +1 -0
- package/dist/core/action-contract.d.ts +43 -0
- package/dist/core/action-contract.js +207 -0
- package/dist/core/action-contract.js.map +1 -0
- package/dist/core/auth.d.ts +6 -0
- package/dist/core/auth.js +85 -0
- package/dist/core/auth.js.map +1 -1
- package/dist/core/http.d.ts +8 -0
- package/dist/core/http.js +37 -5
- package/dist/core/http.js.map +1 -1
- package/dist/core/id-maps.d.ts +27 -0
- package/dist/core/id-maps.js +204 -0
- package/dist/core/id-maps.js.map +1 -0
- package/dist/core/output.d.ts +2 -1
- package/dist/core/output.js +34 -0
- package/dist/core/output.js.map +1 -1
- package/dist/mcp/profiles.d.ts +14 -0
- package/dist/mcp/profiles.js +68 -0
- package/dist/mcp/profiles.js.map +1 -0
- package/dist/mcp/server.d.ts +5 -3
- package/dist/mcp/server.js +22 -5
- package/dist/mcp/server.js.map +1 -1
- package/docs/CAPABILITY_LIBRARY.md +29 -8
- package/docs/COMMAND_TREE.md +98 -17
- package/docs/COMPARISON.md +8 -5
- package/docs/COOKBOOK.md +127 -5
- package/docs/INTERNAL-ENDPOINTS-DISCOVERY.md +813 -0
- package/docs/INTERNAL-ENDPOINTS.md +371 -0
- package/docs/INTERNAL_ENDPOINTS.md +243 -0
- package/docs/MARKETING_SETUP.md +21 -1
- package/docs/MCP.md +28 -89
- package/docs/MCP_TOOL_CATALOG.md +192 -0
- package/docs/MIGRATION_ADAPTERS.md +115 -0
- package/docs/PORTAL_BACKUP.md +212 -0
- package/docs/PUBLISHING.md +1 -1
- package/docs/SALES_CONTENT_INTERNAL_PUNCH_LIST.md +504 -0
- package/docs/TUTORIALS/secure-agent-writes.md +49 -0
- package/docs/WHY_HOW_WHAT.md +10 -4
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,191 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.9.0 - 2026-07-09
|
|
6
|
+
|
|
7
|
+
**Agent-safe operator release.** hscli now wraps its broad HubSpot command
|
|
8
|
+
surface in deterministic execution primitives suitable for consultants,
|
|
9
|
+
scheduled operations, Codex, Claude, and other MCP clients. The CLI remains the
|
|
10
|
+
only operation layer; agents receive scoped tools and verifiable plans instead
|
|
11
|
+
of a second implementation of HubSpot writes.
|
|
12
|
+
|
|
13
|
+
### Added — streamable agent output
|
|
14
|
+
|
|
15
|
+
- Added `--format jsonl`. Arrays and HubSpot result pages emit one compact,
|
|
16
|
+
redacted envelope per item, with paging metadata repeated on each line.
|
|
17
|
+
- Errors use the same one-line envelope contract, making long reads and
|
|
18
|
+
scheduled runs safe to stream into shell pipelines and evidence stores.
|
|
19
|
+
|
|
20
|
+
### Added — action contracts and evidence runbooks
|
|
21
|
+
|
|
22
|
+
- Added versioned `hscli.action-contract/v1` action contracts. Contracts bind
|
|
23
|
+
exact argument arrays to profile, portal, expiry, optional change ticket,
|
|
24
|
+
verification command, deterministic ID, and SHA-256 digest.
|
|
25
|
+
- Added `agent contract create|inspect|verify|apply`. Apply is plan-only unless
|
|
26
|
+
both `--execute` and global `--force` are present; execution uses
|
|
27
|
+
`shell:false` and runs the contract's read-only verification command.
|
|
28
|
+
- Added `agent run <recipe>` with `--resume` and `--continue-on-error`.
|
|
29
|
+
Runbooks write a manifest, checkpoint, JSONL event ledger, per-step output,
|
|
30
|
+
and request telemetry, so interrupted diagnostics resume without repeating
|
|
31
|
+
completed work.
|
|
32
|
+
- Schedule renderers now invoke the evidence-producing runbook path rather than
|
|
33
|
+
printing a plan and calling that execution.
|
|
34
|
+
- Added `portal-baseline`, a one-command read-only activation runbook covering
|
|
35
|
+
portal identity, API reachability, users, teams, deal pipelines, CRM data
|
|
36
|
+
readiness, workflows, and request evidence. `--continue-on-error` preserves
|
|
37
|
+
a useful bundle when a token lacks one optional scope.
|
|
38
|
+
|
|
39
|
+
### Added — MCP surface profiles
|
|
40
|
+
|
|
41
|
+
- Added `minimal`, `crm`, `migration`, and `full` MCP surface profiles. New
|
|
42
|
+
servers default to `minimal`; raw `hub_api_request` is registered only on
|
|
43
|
+
`full`.
|
|
44
|
+
- Added `hscli mcp --surface <profile>` and `HSCLI_MCP_SURFACE`, plus a generated
|
|
45
|
+
tool catalog documenting each tool's domain, operation class, and surfaces.
|
|
46
|
+
- Registration-time filtering reduces agent context, accidental capability
|
|
47
|
+
exposure, and cross-purpose tool selection while preserving the complete
|
|
48
|
+
surface for explicit operator use.
|
|
49
|
+
|
|
50
|
+
### Added — production OAuth profiles
|
|
51
|
+
|
|
52
|
+
- OAuth code exchange and refresh now use HubSpot's `/oauth/2026-03/token`
|
|
53
|
+
endpoint and support the current `scopes[]`, `hub_id`, and `user_id` response
|
|
54
|
+
fields while retaining legacy scope-response compatibility.
|
|
55
|
+
- OAuth access tokens refresh automatically before expiry. Concurrent requests
|
|
56
|
+
share one refresh, rotated credentials are persisted atomically, and failed
|
|
57
|
+
refreshes leave the previous profile untouched.
|
|
58
|
+
- Client secrets remain in a named environment variable; only the variable
|
|
59
|
+
name is persisted. `auth whoami` reports identity/routing/expiry without
|
|
60
|
+
tokens, and `auth refresh` provides an explicit diagnostic rotation.
|
|
61
|
+
|
|
62
|
+
### Changed — product contract
|
|
63
|
+
|
|
64
|
+
- Positioned hscli as a HubSpot operations and migration control plane with
|
|
65
|
+
evidence, rather than leading only with endpoint count.
|
|
66
|
+
- Replaced universal idempotency claims with the implemented model:
|
|
67
|
+
endpoint-aware retries reuse a correlation key, while action contracts and
|
|
68
|
+
read-only verification protect broader approved write workflows.
|
|
69
|
+
- Added package-contract tests that keep install instructions, output formats,
|
|
70
|
+
OAuth commands, nested documentation, generated MCP catalog, and product
|
|
71
|
+
claims aligned with the shipped binary.
|
|
72
|
+
|
|
73
|
+
### Added — internal capture catalogue
|
|
74
|
+
|
|
75
|
+
- Added a versioned allowlist module for HubSpot browser-session internal
|
|
76
|
+
capture surfaces, with validation that every POST endpoint is explicitly
|
|
77
|
+
tagged as a read-like search, preview, batch-read, async resolve, or Chirp RPC
|
|
78
|
+
read.
|
|
79
|
+
- Added `hscli internal coverage`, a plan-only JSON control sheet that connects
|
|
80
|
+
the full internal endpoint docs, discovery log, allowlisted capture module,
|
|
81
|
+
surface counts, parameterized endpoints, and promotion policy for future
|
|
82
|
+
guarded write/replay adapters.
|
|
83
|
+
- Added the account/security internal capture surface for account metadata,
|
|
84
|
+
security settings, installed apps, and sync-bridge inventory.
|
|
85
|
+
- Expanded allowlisted internal capture coverage for report favorites/template
|
|
86
|
+
discovery, async report-result polling, workflow editor helpers
|
|
87
|
+
(permission checks, filter descriptions, card positions), and sales-content
|
|
88
|
+
detail reads for sequences, sales templates, and playbooks.
|
|
89
|
+
- Documented how `backup plan` orchestrates HubSpot 360 backups while
|
|
90
|
+
`internal capture` performs the allowlisted read-only browser-session pulls.
|
|
91
|
+
|
|
92
|
+
### Fixed — internal-adapter safety + dependency audit
|
|
93
|
+
|
|
94
|
+
- Browser-session/internal adapters now share one hardened session resolver:
|
|
95
|
+
`--ui-domain` is allowlisted to HubSpot app hosts only
|
|
96
|
+
(`app.hubspot.com`, `app-eu1.hubspot.com`, etc.), and cookie exports are
|
|
97
|
+
filtered to the selected HubSpot domain before use.
|
|
98
|
+
- `reports pull email-recipients` always requests `email` internally when
|
|
99
|
+
enriching recipients via contact batch-read, but only emits the contact
|
|
100
|
+
properties explicitly requested by the operator.
|
|
101
|
+
- `seed` no longer revises or pushes live arbitrary existing CMS pages; CMS
|
|
102
|
+
revision/publish attempts are limited to pages created by the current seed
|
|
103
|
+
run.
|
|
104
|
+
- `scripts/test-portal-writes.mjs` now requires `HSCLI_ALLOW_WRITE_PROBE=1`
|
|
105
|
+
before running, skips existing-resource mutation by default, and keeps
|
|
106
|
+
publish endpoints behind a separate opt-in.
|
|
107
|
+
- Refreshed `package-lock.json` to clear current npm/Dependabot advisories for
|
|
108
|
+
`fast-uri`, `hono`, `ip-address`, and `express-rate-limit`.
|
|
109
|
+
- Tightened the tracked Python demo-capture dependencies to published current
|
|
110
|
+
lower bounds (`pillow>=11.3.0`, `playwright>=1.59.0`) so GitHub does not keep
|
|
111
|
+
alerting on broad/invalid vulnerable ranges.
|
|
112
|
+
|
|
113
|
+
### Added — reusable report pulls
|
|
114
|
+
|
|
115
|
+
- Added `hscli reports pull object-fill-rate` for CRM object property fill-rate
|
|
116
|
+
audits, with optional all-property schema discovery.
|
|
117
|
+
- Added `hscli reports pull property-distribution` for one-property value
|
|
118
|
+
distributions and blank-rate checks.
|
|
119
|
+
- Added `hscli reports pull email-recipients` for per-recipient marketing email
|
|
120
|
+
event pulls across selected campaign IDs (`SENT`, `DELIVERED`, `BOUNCE`,
|
|
121
|
+
`OPEN`, `CLICK`, `DROPPED`, `SUPPRESSED`, `DEFERRED`) with optional contact
|
|
122
|
+
property enrichment.
|
|
123
|
+
- Added `hscli reports pull source-target-parity` to compare object counts
|
|
124
|
+
between source and sandbox profiles.
|
|
125
|
+
|
|
126
|
+
### Fixed — communication preferences v4 paths
|
|
127
|
+
|
|
128
|
+
- Corrected `communication-preferences v4` endpoints to use HubSpot's
|
|
129
|
+
documented `/communication-preferences/v4/...` path. `subscriptions-list`
|
|
130
|
+
now reads `/communication-preferences/v4/definitions`.
|
|
131
|
+
|
|
132
|
+
### Discovered — subscription definition migration
|
|
133
|
+
|
|
134
|
+
- Public subscription definition reads work via
|
|
135
|
+
`GET /communication-preferences/v3/definitions` and
|
|
136
|
+
`GET /communication-preferences/v4/definitions`, but public creates return
|
|
137
|
+
HTTP 405 on `/communication-preferences/v3/definitions` and
|
|
138
|
+
`/communication-preferences/v4/definitions`.
|
|
139
|
+
- Browser-session replay for Email > Subscription Types uses the internal
|
|
140
|
+
endpoint `/api/subscriptions/v1/definitions?portalId=<portalId>`.
|
|
141
|
+
Migration tooling must match definitions by
|
|
142
|
+
`name + purpose/process + communicationMethod/channel + businessUnitId`, not
|
|
143
|
+
by name alone, and remap business-unit IDs before write.
|
|
144
|
+
- `communication-preferences definitions create --skip-existing` now uses that
|
|
145
|
+
composite match instead of skipping by name alone.
|
|
146
|
+
- Added `communication-preferences definitions create-internal`, an explicit
|
|
147
|
+
browser-session migration adapter for Email > Subscription Types creation via
|
|
148
|
+
`/api/subscriptions/v1/definitions?portalId=<id>`.
|
|
149
|
+
- Added `doctor internal-adapters` to list supported/planned internal
|
|
150
|
+
setup/migration adapters and keep them separate from generic raw API access.
|
|
151
|
+
|
|
152
|
+
## 0.8.12 - 2026-04-24
|
|
153
|
+
|
|
154
|
+
**Terminal operator home + `/fetch` alias.** Two incremental adds on
|
|
155
|
+
top of 0.8.11's operator surface.
|
|
156
|
+
|
|
157
|
+
### Added — terminal operator home
|
|
158
|
+
|
|
159
|
+
- `hscli ui` / `hscli home` — opens a terminal home screen showing
|
|
160
|
+
the current profile's role, read/write safety state, policy + trace
|
|
161
|
+
status, API-usage guidance, and a recommended next command. Works
|
|
162
|
+
as a landing surface for "what should I do next on this portal?".
|
|
163
|
+
|
|
164
|
+
### Added — `/fetch` (`/get`) slash command
|
|
165
|
+
|
|
166
|
+
- Added to the Claude-style operator set (now `/setup`, `/migration`,
|
|
167
|
+
`/read`, `/fetch` / `/get`, `/write`, `/guardrails`). Thin alias
|
|
168
|
+
over read-shaped commands so agents can pick up HubSpot records
|
|
169
|
+
with the same grammar they use to read vault state.
|
|
170
|
+
|
|
171
|
+
### Added — migration replay hardening
|
|
172
|
+
|
|
173
|
+
- Legacy forms/v2 consent replay now extracts `metaData[].legalConsentOptions`,
|
|
174
|
+
preserves `submitButtonText`, and requires target subscription remaps via
|
|
175
|
+
`--subscription-type-map` unless `--allow-unmapped-consent` is passed.
|
|
176
|
+
- `communication-preferences definitions list|create` can replay subscription
|
|
177
|
+
definitions with business-unit remapping (`--business-unit-map`,
|
|
178
|
+
`--business-unit-mode strict|drop|preserve`) and `--skip-existing`.
|
|
179
|
+
- `settings business-units capture` reads the internal
|
|
180
|
+
`/api/business-units/v1/business-units` browser-session endpoint and can emit
|
|
181
|
+
a source-ID keyed id-map seed for subscription-definition BU remapping.
|
|
182
|
+
- `workflows preflight` checks workflow exports against migration id-maps before
|
|
183
|
+
replay, including actions, enrollment criteria, suppression lists, custom
|
|
184
|
+
objects, association labels, users/owners, sequences, lists, subscriptions,
|
|
185
|
+
campaigns, marketing emails, and pipeline/stage IDs.
|
|
186
|
+
|
|
187
|
+
Migration replay regression tests added.
|
|
188
|
+
|
|
3
189
|
## 0.8.11 - 2026-04-24
|
|
4
190
|
|
|
5
191
|
**Migration operator surface + shared rate-limit enforcement.** Ships
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<strong>
|
|
6
|
+
<strong>The agent-safe HubSpot operator.</strong>
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
@@ -24,10 +24,21 @@
|
|
|
24
24
|
|
|
25
25
|
## Why
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
`hscli` is a HubSpot operations and migration control plane for humans and
|
|
28
|
+
agents. Every write is blocked unless you explicitly `--force` it. Every
|
|
29
|
+
request can produce local audit evidence. Tokens stay on your machine. The same
|
|
30
|
+
operation layer serves the CLI, deterministic runbooks, and scoped MCP tools.
|
|
28
31
|
|
|
29
32
|
No SaaS middleman, no proprietary dashboard, no "download the CLI, then also install the desktop app". Just a CLI that respects production.
|
|
30
33
|
|
|
34
|
+
HubSpot is moving toward an agent-ready platform: APIs, MCP, CLI, and open
|
|
35
|
+
connectors so agents can run on HubSpot and run HubSpot. `hscli` is the
|
|
36
|
+
operator layer for that world: public API first, MCP-compatible, scheduled
|
|
37
|
+
runbooks, deterministic scoring, trace/audit evidence, migration adapters, and
|
|
38
|
+
explicit write guardrails. It is not a generic internal API tunnel; internal
|
|
39
|
+
browser-session surfaces stay allowlisted and task-specific for backup,
|
|
40
|
+
migration, and setup work.
|
|
41
|
+
|
|
31
42
|
## Install & auth
|
|
32
43
|
|
|
33
44
|
```bash
|
|
@@ -45,25 +56,204 @@ printf '%s' "$HUBSPOT_TOKEN" | hscli auth login --profile live --token-stdin --h
|
|
|
45
56
|
hscli auth set-hublet live eu1
|
|
46
57
|
```
|
|
47
58
|
|
|
59
|
+
OAuth developer-app profiles use HubSpot's date-based token endpoint and
|
|
60
|
+
refresh automatically before expiry. Store the client secret in an environment
|
|
61
|
+
variable; hscli persists only the variable name:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
export HSCLI_OAUTH_CLIENT_SECRET="..."
|
|
65
|
+
hscli auth oauth-url --client-id "$CLIENT_ID" --redirect-uri "$REDIRECT_URI" \
|
|
66
|
+
--scopes "crm.objects.contacts.read"
|
|
67
|
+
hscli auth oauth-exchange --client-id "$CLIENT_ID" --code "$AUTH_CODE" \
|
|
68
|
+
--redirect-uri "$REDIRECT_URI" --profile oauth-prod
|
|
69
|
+
hscli --profile oauth-prod auth whoami
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## First proof in one command
|
|
73
|
+
|
|
74
|
+
Run the read-only portal baseline before learning the full command tree. It
|
|
75
|
+
captures portal identity and API reachability, users and teams, deal pipelines,
|
|
76
|
+
data readiness for contacts/companies/deals, and workflow exposure:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
hscli --profile client-readonly agent run portal-baseline \
|
|
80
|
+
--output ./evidence/portal-baseline \
|
|
81
|
+
--continue-on-error
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The output is a portable evidence bundle, not an AI summary: `manifest.json`
|
|
85
|
+
records the exact steps and completion state, `requests.jsonl` records redacted
|
|
86
|
+
HubSpot request telemetry, `events.jsonl` records runbook progress, and
|
|
87
|
+
`steps/*.stdout.jsonl` preserves every deterministic result. Missing scopes are
|
|
88
|
+
kept as explicit failed steps while the rest of the baseline continues.
|
|
89
|
+
|
|
48
90
|
## Operator workflows
|
|
49
91
|
|
|
50
92
|
Start from intent instead of memorizing the whole command tree:
|
|
51
93
|
|
|
52
94
|
```bash
|
|
95
|
+
hscli ui # terminal home: profiles, safety, next action, workflows
|
|
53
96
|
hscli /setup # auth, hublet routing, scopes, capabilities
|
|
54
97
|
hscli /migration # portal/schema migration sequence
|
|
55
98
|
hscli /read # source-portal read workflow
|
|
99
|
+
hscli /fetch # get records or metadata without mutation
|
|
100
|
+
hscli /get # alias for /fetch
|
|
56
101
|
hscli /write # target-portal write workflow
|
|
57
102
|
hscli /guardrails # read-only, policy, trace, scope checks
|
|
103
|
+
hscli /backup # 360-degree portal backup workflow
|
|
58
104
|
```
|
|
59
105
|
|
|
106
|
+
Agent-safe operator runbooks give Codex/Claude/Cursor deterministic plans
|
|
107
|
+
instead of open-ended portal access:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
hscli agent list
|
|
111
|
+
hscli agent plan portal-baseline --json
|
|
112
|
+
hscli agent plan automation-risk --json
|
|
113
|
+
hscli --profile sandbox agent run automation-risk --output ./evidence/automation-risk
|
|
114
|
+
hscli --profile sandbox agent run automation-risk --output ./evidence/automation-risk --resume
|
|
115
|
+
hscli --profile sandbox --policy-file ./policy.json --change-ticket CHG-123 \
|
|
116
|
+
agent plan data-cleanup --json
|
|
117
|
+
hscli --profile live agent schedule render pipeline-risk \
|
|
118
|
+
--target cron --cron "0 8 * * 1"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Runbooks are public-API-first, MCP-compatible, schedule-renderable, and
|
|
122
|
+
auditable. `agent plan` never calls HubSpot; it prints the exact read/report
|
|
123
|
+
commands. `agent run` executes those argument arrays with `shell:false` and
|
|
124
|
+
writes a manifest, checkpoint, per-step output, request telemetry, and JSONL
|
|
125
|
+
event ledger. `--resume` skips completed steps; `--continue-on-error` preserves
|
|
126
|
+
partial evidence while finishing the remaining diagnostics.
|
|
127
|
+
|
|
128
|
+
For approved fixes, seal the exact hscli argv in a versioned action contract.
|
|
129
|
+
Contracts are offline-verifiable and bind execution to one profile, portal,
|
|
130
|
+
expiry, and optional change ticket. They never contain tokens or shell text:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
hscli --json agent contract create --input ./action-draft.json | jq '.data' > ./action-contract.json
|
|
134
|
+
hscli --json --profile sandbox agent contract verify ./action-contract.json
|
|
135
|
+
hscli --json --profile sandbox agent contract apply ./action-contract.json
|
|
136
|
+
hscli --json --profile sandbox --force agent contract apply ./action-contract.json --execute
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
`apply` remains plan-only unless both `--execute` and global `--force` are
|
|
140
|
+
present. Approved operations use argument arrays with `shell:false`, then run
|
|
141
|
+
the contract's read-only verification command.
|
|
142
|
+
|
|
60
143
|
Scope checks are built in:
|
|
61
144
|
|
|
62
145
|
```bash
|
|
63
146
|
hscli doctor scopes diff --required real-mirror-read
|
|
64
147
|
hscli doctor scopes explain sales-email-read
|
|
148
|
+
hscli doctor parity
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Multi-portal management stays local and plan-only by default. Use it when you
|
|
152
|
+
manage source/sandbox/live profiles, global + regional portals, or many client
|
|
153
|
+
tenants and want every command to keep an explicit profile boundary:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
hscli --json portals list
|
|
157
|
+
hscli --json portals plan \
|
|
158
|
+
--profiles live,sandbox \
|
|
159
|
+
--runbook automation-risk \
|
|
160
|
+
--include-context \
|
|
161
|
+
--sample-limit 25
|
|
65
162
|
```
|
|
66
163
|
|
|
164
|
+
`portals plan` does not call HubSpot. It renders one `context build` and one
|
|
165
|
+
`agent plan` command per profile so Codex/Claude/scheduled workers can operate
|
|
166
|
+
without cross-tenant ambiguity.
|
|
167
|
+
|
|
168
|
+
Reusable reporting pulls are built in for audits, migration checks, and
|
|
169
|
+
matchback files:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
hscli reports pull object-fill-rate --object contacts --limit 5000
|
|
173
|
+
hscli reports pull property-distribution --object contacts --property lifecyclestage
|
|
174
|
+
hscli reports pull email-recipients \
|
|
175
|
+
--campaign-ids 407801550,407801857 \
|
|
176
|
+
--event-types sent,delivered,bounce,open,click,dropped,suppressed,deferred \
|
|
177
|
+
--contact-properties email,firstname,lastname,company,lifecyclestage,hs_all_assigned_business_unit_ids
|
|
178
|
+
hscli reports pull source-target-parity \
|
|
179
|
+
--source-profile live-readonly --target-profile sandbox-read --objects contacts,companies,deals
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Full-portal backup planning is available for downgrade, migration, and forensic
|
|
183
|
+
archive work. It is designed as a HubSpot 360 capture model: CRM, engagements,
|
|
184
|
+
marketing, sales, service, CMS, commerce, automation, reporting, settings,
|
|
185
|
+
integrations, files, and governance. It renders the public API capture runbook
|
|
186
|
+
plus the explicit internal/browser-session brief without making HubSpot calls.
|
|
187
|
+
The allowlisted internal endpoint catalogue lives in
|
|
188
|
+
[`docs/INTERNAL_ENDPOINTS.md`](docs/INTERNAL_ENDPOINTS.md), with the full
|
|
189
|
+
discovery archive in [`docs/INTERNAL-ENDPOINTS.md`](docs/INTERNAL-ENDPOINTS.md)
|
|
190
|
+
and [`docs/INTERNAL-ENDPOINTS-DISCOVERY.md`](docs/INTERNAL-ENDPOINTS-DISCOVERY.md):
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
hscli --profile source-readonly backup plan \
|
|
194
|
+
--portal-id "$PORTAL_ID" \
|
|
195
|
+
--out-dir "$HOME/client-migration-assets/portal-$PORTAL_ID-full-backup" \
|
|
196
|
+
--include-internal \
|
|
197
|
+
--json
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
When the operator has an authenticated HubSpot browser session, the catalogue
|
|
201
|
+
can be turned into a read-only allowlisted capture. Placeholder-heavy endpoints
|
|
202
|
+
are skipped into the manifest instead of guessed:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
hscli --json internal surfaces
|
|
206
|
+
hscli --profile source-readonly --json internal coverage \
|
|
207
|
+
> "$HOME/client-migration-assets/portal-$PORTAL_ID-full-backup/internal-coverage.json"
|
|
208
|
+
hscli --profile source-readonly --json internal capture \
|
|
209
|
+
--surface business-units \
|
|
210
|
+
--portal-id "$PORTAL_ID" \
|
|
211
|
+
--cookie-file "$HUBSPOT_COOKIE_FILE" \
|
|
212
|
+
--out-dir "$HOME/client-migration-assets/portal-$PORTAL_ID-full-backup/internal-api"
|
|
213
|
+
hscli --profile source-readonly --json internal capture \
|
|
214
|
+
--all \
|
|
215
|
+
--portal-id "$PORTAL_ID" \
|
|
216
|
+
--cookie-file "$HUBSPOT_COOKIE_FILE" \
|
|
217
|
+
--out-dir "$HOME/client-migration-assets/portal-$PORTAL_ID-full-backup/internal-api/allowlisted-capture"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
For internal read-like POST/RPC endpoints that need an exact payload, capture a
|
|
221
|
+
single allowlisted endpoint with a JSON body file. hscli stores a redacted
|
|
222
|
+
`<endpoint>.request.json` proof file and a request-body SHA-256 in the manifest:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
hscli --profile source-readonly --json internal capture \
|
|
226
|
+
--surface permission-access \
|
|
227
|
+
--endpoint app-users-batch \
|
|
228
|
+
--portal-id "$PORTAL_ID" \
|
|
229
|
+
--cookie-file "$HUBSPOT_COOKIE_FILE" \
|
|
230
|
+
--body-file app-users-batch=./bodies/app-users-batch.json \
|
|
231
|
+
--out-dir "$HOME/client-migration-assets/portal-$PORTAL_ID-full-backup/internal-api/permission-access"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Migration/setup adapters stay explicit instead of becoming a generic internal
|
|
235
|
+
API passthrough. The capture allowlist is versioned in
|
|
236
|
+
`src/commands/internal/catalog.ts`; write-like internal adapters stay named,
|
|
237
|
+
auditable, and guarded by `--force`, while generic POST capture remains limited
|
|
238
|
+
to read-like HubSpot operations such as search, preview, batch hydration,
|
|
239
|
+
async resolve, or Chirp RPC reads:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
hscli settings business-units capture --portal-id 12345 --cookie-file ./session.cookie
|
|
243
|
+
hscli settings business-units create-internal --portal-id 12345 --data '{"name":"Example Business Unit"}' --skip-existing
|
|
244
|
+
hscli settings permission-sets roles list --portal-id 12345 --cookie-file ./session.cookie
|
|
245
|
+
hscli settings permission-sets assignments list --portal-id 12345 --cookie-file ./session.cookie
|
|
246
|
+
hscli settings flp property 0-1 email --portal-id 12345 --cookie-file ./session.cookie
|
|
247
|
+
hscli settings permission-sets users assign user-1 --portal-id 12345 --permission-set-id 70 --cookie-file ./session.cookie --force
|
|
248
|
+
hscli settings permission-sets users assign user-1 --portal-id 12345 --permission-set-ids 70,71 --cookie-file ./session.cookie --force
|
|
249
|
+
hscli settings permission-sets users assign-batch --portal-id 12345 --data '{"assignments":[{"userId":"user-1","permissionSetIds":["70","71"]}]}' --cookie-file ./session.cookie --force
|
|
250
|
+
hscli settings users create --data '{"email":"user@example.com"}' # invite email suppressed by default
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Browser-session adapters only send cookies to allowlisted HubSpot app hosts
|
|
254
|
+
(`app.hubspot.com`, `app-eu1.hubspot.com`, etc.). Netscape/JSON cookie exports
|
|
255
|
+
are filtered to the selected HubSpot domain before the request is made.
|
|
256
|
+
|
|
67
257
|
## Write safely
|
|
68
258
|
|
|
69
259
|
```bash
|
|
@@ -74,10 +264,15 @@ hscli crm contacts create --data '{"properties":{"email":"jane@acme.com"}}'
|
|
|
74
264
|
# Preview what the call would look like
|
|
75
265
|
hscli --dry-run crm contacts create --data '{"properties":{"email":"jane@acme.com"}}'
|
|
76
266
|
|
|
77
|
-
# Execute — with an
|
|
267
|
+
# Execute — with an operation correlation key generated automatically
|
|
78
268
|
hscli --force crm contacts create --data '{"properties":{"email":"jane@acme.com"}}'
|
|
79
269
|
```
|
|
80
270
|
|
|
271
|
+
hscli reuses the same correlation key across retries and honors native
|
|
272
|
+
idempotency semantics on endpoints that support them. It never assumes every
|
|
273
|
+
HubSpot mutation is replay-safe; deterministic action contracts and read-only
|
|
274
|
+
verification are the stronger boundary for approved agent writes.
|
|
275
|
+
|
|
81
276
|
Policy file + change-ticket enforcement for ops teams:
|
|
82
277
|
|
|
83
278
|
```bash
|
|
@@ -90,7 +285,10 @@ hscli --force --policy-file ./policy.json --change-ticket CHG-123 \
|
|
|
90
285
|
Drop `hscli` into any MCP client — Claude Desktop, Cursor, Claude Code, or your own agent runtime.
|
|
91
286
|
|
|
92
287
|
```bash
|
|
93
|
-
hscli mcp
|
|
288
|
+
hscli mcp # 29 essential read tools (default)
|
|
289
|
+
hscli mcp --surface crm # curated CRM read/write tools
|
|
290
|
+
hscli mcp --surface migration # curated cross-product migration tools
|
|
291
|
+
hscli mcp --surface full # all 180 tools, including raw API
|
|
94
292
|
```
|
|
95
293
|
|
|
96
294
|
For Claude Desktop, add to `claude_desktop_config.json`:
|
|
@@ -100,19 +298,23 @@ For Claude Desktop, add to `claude_desktop_config.json`:
|
|
|
100
298
|
"mcpServers": {
|
|
101
299
|
"hscli": {
|
|
102
300
|
"command": "hscli",
|
|
103
|
-
"args": ["mcp"],
|
|
301
|
+
"args": ["mcp", "--surface", "minimal"],
|
|
104
302
|
"env": { "HSCLI_MCP_PROFILE": "default" }
|
|
105
303
|
}
|
|
106
304
|
}
|
|
107
305
|
}
|
|
108
306
|
```
|
|
109
307
|
|
|
110
|
-
The MCP server exposes three tool families:
|
|
308
|
+
The MCP server exposes three tool families across explicit surfaces:
|
|
111
309
|
|
|
112
310
|
- **Per-object tools** — `crm_contacts_list`, `crm_deals_create`, `crm_custom_records_search`, …
|
|
113
311
|
- **HubSpot Remote MCP compat** — same tool names as `mcp.hubspot.com` (`search_crm_objects`, `manage_crm_objects`, …) so agents built for HubSpot's hosted MCP drop in without changes
|
|
114
312
|
- **Extension surface** — workflows, files, forms, webhooks, HubDB, conversations, and more, all with the same `--force` + policy gates as the CLI
|
|
115
313
|
|
|
314
|
+
`minimal` is intentionally the default so an agent does not pay the context
|
|
315
|
+
and security cost of 180 tools for a simple CRM read. The raw `hub_api_request`
|
|
316
|
+
tool exists only in `full`. See the generated [tool catalog](docs/MCP_TOOL_CATALOG.md).
|
|
317
|
+
|
|
116
318
|
Every MCP tool call goes through the same safety rails as the CLI. Token redaction is enforced on every response. `HSCLI_MCP_PROFILE` locks the stdio server to one auth profile to prevent cross-tenant access.
|
|
117
319
|
|
|
118
320
|
## Observability
|
|
@@ -147,7 +349,9 @@ Every request hscli makes is append-only JSONL. Pair `trace` with `audit` for fu
|
|
|
147
349
|
- **Legacy v1/v2** — every pre-v3 surface preserved for portals that still need them
|
|
148
350
|
- **Raw API** command with path-scope controls + full OAuth flow support
|
|
149
351
|
|
|
150
|
-
Enterprise defaults: `--dry-run`, `--force`, policy files, change tickets,
|
|
352
|
+
Enterprise defaults: `--dry-run`, `--force`, policy files, change tickets,
|
|
353
|
+
capability probing, shared rate-limit enforcement, token redaction, path scope
|
|
354
|
+
allowlisting, endpoint-aware retries, and correlation keys on writes.
|
|
151
355
|
|
|
152
356
|
</details>
|
|
153
357
|
|
|
@@ -177,19 +381,27 @@ Exact endpoint → tier mapping in [docs/TIERS.md](docs/TIERS.md).
|
|
|
177
381
|
## Design principles
|
|
178
382
|
|
|
179
383
|
1. **CLI-first, MCP as a peer.** Every MCP tool has a matching `hscli` command — same write gates, same redaction, same capability probing in both.
|
|
180
|
-
2. **
|
|
181
|
-
3. **
|
|
182
|
-
4. **
|
|
384
|
+
2. **Agent-safe operator layer.** Deterministic context, plans, reports, traces, and policy checks happen before AI writes or summaries.
|
|
385
|
+
3. **Self-hosted, token-sovereign.** Your HubSpot private app token stays on your machine. No telemetry, no phone-home.
|
|
386
|
+
4. **Safe by default.** Mutations are blocked unless `--force` is explicit. `--dry-run` previews every write. Approved actions bind exact arguments to verification steps; endpoint-aware retries reuse one correlation key.
|
|
387
|
+
5. **Multi-portal explicitness.** Every plan and command keeps `--profile` visible so source, sandbox, and production portals cannot blur together.
|
|
388
|
+
6. **HubSpot-native.** Reads `X-HubSpot-RateLimit-*` headers, throttles proactively across clients, stops on daily hard-limit exhaustion, caches capabilities by `portalId + scopes`, validates payloads offline.
|
|
183
389
|
|
|
184
390
|
## Output modes
|
|
185
391
|
|
|
186
392
|
```bash
|
|
187
393
|
hscli --json crm companies list --limit 3 # JSON envelope
|
|
394
|
+
hscli --format jsonl crm contacts list --limit 100 # one compact envelope per result
|
|
188
395
|
hscli --format csv crm contacts list --limit 5 # CSV
|
|
189
396
|
hscli --format yaml crm deals get 123 # YAML
|
|
190
397
|
hscli --format table crm contacts list --limit 5 # table (default)
|
|
191
398
|
```
|
|
192
399
|
|
|
400
|
+
`jsonl` is the streaming format for agents and shell pipelines. Top-level
|
|
401
|
+
arrays and HubSpot `results` pages produce one redacted JSON envelope per
|
|
402
|
+
record; page metadata is repeated under `meta` so each line remains
|
|
403
|
+
self-describing.
|
|
404
|
+
|
|
193
405
|
## Terminal session
|
|
194
406
|
|
|
195
407
|
The HubSpot-UI recording at the top shows the *outcome*. Here's the *cause* — the same fixture built and torn down entirely from the shell:
|
|
@@ -217,6 +429,7 @@ Under `HSCLI_HOME` (default: `~/.revfleet`):
|
|
|
217
429
|
- [docs/MCP.md](docs/MCP.md) — MCP server tool catalog
|
|
218
430
|
- [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) · [docs/SAFETY_MODEL.md](docs/SAFETY_MODEL.md) · [docs/WHY_HOW_WHAT.md](docs/WHY_HOW_WHAT.md)
|
|
219
431
|
- [docs/ROADMAP-DATE-BASED-API.md](docs/ROADMAP-DATE-BASED-API.md) — HubSpot's `/YYYY-MM/` migration plan
|
|
432
|
+
- [docs/PORTAL_BACKUP.md](docs/PORTAL_BACKUP.md) — full-portal downgrade/migration backup runbook
|
|
220
433
|
- [docs/PLUGIN_GUIDE.md](docs/PLUGIN_GUIDE.md) — writing plugins
|
|
221
434
|
- [docs/COOKBOOK.md](docs/COOKBOOK.md) — recipes
|
|
222
435
|
- [docs/PUBLISHING.md](docs/PUBLISHING.md) — release runbook (maintainers)
|
package/dist/cli.js
CHANGED
|
@@ -20,6 +20,7 @@ import { registerAudit } from "./commands/audit/index.js";
|
|
|
20
20
|
import { registerLists } from "./commands/lists/index.js";
|
|
21
21
|
import { registerSales } from "./commands/sales/index.js";
|
|
22
22
|
import { registerReporting } from "./commands/reporting/index.js";
|
|
23
|
+
import { registerReports } from "./commands/reports/index.js";
|
|
23
24
|
import { registerExports } from "./commands/exports/index.js";
|
|
24
25
|
import { registerSiteSearch } from "./commands/site-search/index.js";
|
|
25
26
|
import { registerTimeline } from "./commands/timeline/index.js";
|
|
@@ -33,10 +34,22 @@ import { registerEmailEvents } from "./commands/email-events/index.js";
|
|
|
33
34
|
import { registerMediaBridge } from "./commands/media-bridge/index.js";
|
|
34
35
|
import { registerFeatureFlags } from "./commands/feature-flags/index.js";
|
|
35
36
|
import { registerGuide } from "./commands/guide/index.js";
|
|
37
|
+
import { registerAgent } from "./commands/agent/index.js";
|
|
38
|
+
import { registerContext } from "./commands/context/index.js";
|
|
39
|
+
import { registerPortals } from "./commands/portals/index.js";
|
|
40
|
+
import { registerBackup } from "./commands/backup/index.js";
|
|
41
|
+
import { registerSalesContent } from "./commands/sales-content/index.js";
|
|
42
|
+
import { registerSequencesInternal } from "./commands/sequences/index.js";
|
|
43
|
+
import { registerSalesTemplates } from "./commands/sales-templates/index.js";
|
|
44
|
+
import { registerPlaybooks } from "./commands/playbooks/index.js";
|
|
45
|
+
import { registerContentPermissions } from "./commands/content-permissions/index.js";
|
|
46
|
+
import { registerUi } from "./commands/ui/index.js";
|
|
36
47
|
import { registerMarketingEmailsV1 } from "./commands/marketing-emails-v1/index.js";
|
|
48
|
+
import { registerEmailTracking } from "./commands/email-tracking/index.js";
|
|
37
49
|
import { registerIntegrators } from "./commands/integrators/index.js";
|
|
38
50
|
import { registerIntegrations } from "./commands/integrations/index.js";
|
|
39
51
|
import { registerExtensions } from "./commands/extensions/index.js";
|
|
52
|
+
import { registerInternal } from "./commands/internal/index.js";
|
|
40
53
|
import { registerBroadcast, registerVisitorIdentification, registerSubmissions, registerScheduler, registerTax, registerAppinstalls, registerMarketingExtras, registerOwnersExtras, registerBusinessUnits, registerBroadcastsRoot, registerFormIntegrations, } from "./commands/legacy/index.js";
|
|
41
54
|
import { registerContactsV1, registerCompaniesV2, registerDealsV1, registerOwnersV2, registerEngagementsV1, registerPropertiesLegacy, registerReportsV2, registerPaymentsSubscriptions, registerContentV2, registerSalesExtensions, registerComments, registerCallingV1, registerChannels, } from "./commands/legacy-v1/index.js";
|
|
42
55
|
import { CliError, printError } from "./core/output.js";
|
|
@@ -59,7 +72,7 @@ export function createProgram() {
|
|
|
59
72
|
.version(pkg.version)
|
|
60
73
|
.option("--profile <name>", "Auth profile", "default")
|
|
61
74
|
.option("--json", "JSON output")
|
|
62
|
-
.option("--format <mode>", "Output format: json|table|csv|yaml")
|
|
75
|
+
.option("--format <mode>", "Output format: json|jsonl|table|csv|yaml")
|
|
63
76
|
.option("--dry-run", "Simulate writes")
|
|
64
77
|
.option("--force", "Confirm write operations")
|
|
65
78
|
.option("--strict-capabilities", "Fail fast when endpoint capability status is unknown")
|
|
@@ -125,6 +138,7 @@ export function createProgram() {
|
|
|
125
138
|
registerLists(program, () => ctx);
|
|
126
139
|
registerSales(program, () => ctx);
|
|
127
140
|
registerReporting(program, () => ctx);
|
|
141
|
+
registerReports(program, () => ctx);
|
|
128
142
|
registerExports(program, () => ctx);
|
|
129
143
|
registerSiteSearch(program, () => ctx);
|
|
130
144
|
registerTimeline(program, () => ctx);
|
|
@@ -137,11 +151,23 @@ export function createProgram() {
|
|
|
137
151
|
registerEmailEvents(program, () => ctx);
|
|
138
152
|
registerMediaBridge(program, () => ctx);
|
|
139
153
|
registerFeatureFlags(program, () => ctx);
|
|
154
|
+
registerUi(program, () => ctx);
|
|
140
155
|
registerGuide(program, () => ctx);
|
|
156
|
+
registerAgent(program, () => ctx);
|
|
157
|
+
registerContext(program, () => ctx);
|
|
158
|
+
registerPortals(program, () => ctx);
|
|
159
|
+
registerBackup(program, () => ctx);
|
|
160
|
+
registerSalesContent(program, () => ctx);
|
|
161
|
+
registerSequencesInternal(program, () => ctx);
|
|
162
|
+
registerSalesTemplates(program, () => ctx);
|
|
163
|
+
registerPlaybooks(program, () => ctx);
|
|
164
|
+
registerContentPermissions(program, () => ctx);
|
|
141
165
|
registerMarketingEmailsV1(program, () => ctx);
|
|
166
|
+
registerEmailTracking(program, () => ctx);
|
|
142
167
|
registerIntegrators(program, () => ctx);
|
|
143
168
|
registerIntegrations(program, () => ctx);
|
|
144
169
|
registerExtensions(program, () => ctx);
|
|
170
|
+
registerInternal(program, () => ctx);
|
|
145
171
|
registerBroadcast(program, () => ctx);
|
|
146
172
|
registerVisitorIdentification(program, () => ctx);
|
|
147
173
|
registerSubmissions(program, () => ctx);
|
|
@@ -241,9 +267,9 @@ function resolveApiBaseUrlOverride(hublet, rawApiBaseUrl) {
|
|
|
241
267
|
function resolveOutputFormat(raw, jsonFlag) {
|
|
242
268
|
const fallback = "table";
|
|
243
269
|
const value = (raw === undefined || raw === null) ? fallback : String(raw).trim().toLowerCase();
|
|
244
|
-
const allowed = new Set(["json", "table", "csv", "yaml"]);
|
|
270
|
+
const allowed = new Set(["json", "jsonl", "table", "csv", "yaml"]);
|
|
245
271
|
if (!allowed.has(value)) {
|
|
246
|
-
throw new CliError("INVALID_FORMAT", "format must be one of: json, table, csv, yaml");
|
|
272
|
+
throw new CliError("INVALID_FORMAT", "format must be one of: json, jsonl, table, csv, yaml");
|
|
247
273
|
}
|
|
248
274
|
if (jsonFlag && value !== "json" && raw !== undefined && raw !== null) {
|
|
249
275
|
throw new CliError("INVALID_FORMAT", "--json cannot be combined with --format != json");
|