The HubSpot Agent CLI is a public-beta command-line interface that lets compatible AI-agent environments work with HubSpot CRM data and operations. HubSpot positions it for repetitive, bulk, recurring, scheduled, and background work. The practical question is not only whether the CLI can retrieve or change a record. It is whether your team can define the trigger, inputs, validation, destination, approval boundary, and exception owner around that command.
HubSpot announced the CLI in private beta on May 27, 2026, and later announced public beta availability on June 23, 2026. Current supported environments and command details belong in HubSpot’s Agent CLI guide and technical reference. Beta commands, permissions, flags, and behavior can change, so treat the current documentation as part of the operating procedure.
This guide focuses on architecture and operating discipline. It does not present HubSpot’s example prompts as downloadable templates or claim that the CLI itself supplies a universal scheduler, retry service, alerting layer, or guaranteed job completion.
What the HubSpot Agent CLI does, and what it does not do
HubSpot documents the Agent CLI for agent environments including OpenAI Codex, Claude Cowork, Claude Code, and the ChatGPT and Claude apps. It gives those environments a command-oriented path to HubSpot data and operations. HubSpot lists CRM actions such as listing, retrieving, searching, creating, updating, merging, upserting, and deleting objects, subject to account access and command-specific restrictions.
A dependable CRM automation is a complete operating chain:
- A person, compatible agent environment, or separately selected runner starts the work.
- The CLI retrieves or changes permitted HubSpot data.
- An agent performs a bounded task, such as summarizing activity or proposing a next action.
- A report, queue, or other destination receives the result.
- A named owner handles failed, ambiguous, inaccessible, or consequential cases.
HubSpot positions the CLI for scheduled and background work, but the reviewed sources do not establish that every workflow receives native scheduling, durable execution, retries, monitoring, notifications, or delivery guarantees. If unattended execution matters, verify the selected runner’s behavior separately. That runner might be Codex, Claude Cowork, an operating-system scheduler, an external job system, or an operator.
Separate the question “what starts the run?” from “what does the CLI do after it starts?” This distinction determines where scheduling, retries, alerts, run history, and failure ownership must be designed.
Choose between Agent CLI, AI Connectors, and MCP
These options are complementary rather than interchangeable. HubSpot positions AI Connectors and its remote MCP server for conversational, human-in-the-loop questions, insights, and real-time actions. It positions the Agent CLI for repeatable, bulk, scheduled, or background operations. Choose according to the operating pattern, not according to a claim that one product replaces the others.
Start with a Connector or MCP
Use a conversational connection when a person is exploring records, asking for insight, or reviewing a real-time action before confirming it.
Consider Agent CLI
Use command-oriented retrieval, filtering, structured output, or bulk processing when a separately verified runner can start and monitor the work.
Use the developer CLI
The traditional HubSpot developer CLI is for building and deploying HubSpot projects and themes. It is separate from Agent CLI.
Agent CLI support in the ChatGPT app is also a different connection path from HubSpot’s separate ChatGPT connector. Do not transfer connector limits or controls to Agent CLI. For example, the ChatGPT connector documentation limits bulk create and update actions to 10 records at a time and says custom validation rules are not applied to those connector operations. Those statements describe the connector, not Agent CLI.
What the CLI can operate on and how it returns data
The technical reference lists command areas for CRM objects, properties, associations, pipelines, owners, custom-object schemas, workflows, activities, reports, segments, imports, conversations, sequences, analytics, and other HubSpot surfaces. The list of command groups is not a promise that every operation is available for every account, plan, object, permission set, or authentication mode. Confirm the exact command and access requirements before building around it.
Output defaults to JSONL, which is useful for streaming, filtering, piping, and bulk operations. JSON and human-readable table formats are also documented. For a controlled bulk update, define the input contract before asking an agent to produce records. This is an editorial example, not a HubSpot-published schema:
{
"record_id": "12345",
"object_type": "contacts",
"proposed_property_changes": {
"jobtitle": "Operations Manager"
},
"change_reason": "Approved enrichment from the reviewed source",
"source_record_ids": [
"12345"
]
}
For actual JSONL input, serialize one object per line. Validate identifiers, property names, enumerated values, required fields, and blank-value behavior before passing records to a write command. Every write command supports a dry-run option that previews the proposed change without applying it. Some destructive operations also require a local safety digest and confirmation. A preview is useful evidence for review, but it does not prove semantic correctness or prevent a record from changing before execution.
Design four CRM workflows as complete operating chains
The following patterns adapt HubSpot’s documented use cases into implementation designs. They are not prebuilt HubSpot templates. Use deterministic rules for objective eligibility, then reserve AI for summarization, grouping, or proposed next steps.
| Trigger or source | AI job | Validation and action | Destination and fallback |
|---|---|---|---|
| A selected scheduler, compatible agent environment, or operator starts a data-quality search for records missing named properties. | Prioritize the filtered records, explain the missing fields, and suggest a review action. The missing-field test remains deterministic. | Confirm properties exist and are readable. Verify each record ID and missing-field result. Begin with a report or queue before proposing writes. | Send a cleanup report to RevOps or a CRM data steward. Ambiguous records and inaccessible fields go to manual review. |
| An operator or separately verified runner starts a date-bounded deal search using a defined time zone, close-date window, and activity lookback. | Summarize retrieved context and suggest follow-up priority. Do not ask the model to decide whether a date is inside the reporting window. | Verify date semantics, activity types, associations, and ownership. Keep deal observations separate from run-level totals. Require approval before changing deal fields. | Deliver a structured report to Sales or RevOps. Sales operations investigates missing activity, conflicting dates, or inaccessible history. |
| An operator or runner supplies a defined company list and reporting period for account review. | Summarize open deals and recent support activity, identify themes, and surface follow-up questions without filling in missing data. | Check company grain, association paths, open-deal criteria, support window, and the exact NPS property. Represent an absent score as missing, not zero. | Save an account-review record for the account owner. Customer-success operations resolves association gaps and uncertain customer-facing recommendations. |
| An operator or separately configured event runner supplies a ticket ID and approved related-record scope. | Summarize prior resolutions and recurring themes from permitted records. A proposed reply or follow-up remains a draft. | Verify ticket associations and access to prior tickets, transcripts, or activities. Distinguish no history from inaccessible history. Do not change priority, status, ownership, or customer-facing content without review. | Route an internal analysis to Support. A support lead handles sensitive data, ambiguous themes, and consequential actions. |
For a weekly pipeline scan, define the reporting week, time zone, close-date criteria, activity lookback, and activity sources first. The sequence is: a chosen runner starts the job; the CLI retrieves qualifying deals and permitted activity data; the agent summarizes only ambiguous context; the workflow produces deal-level findings and separate run-level counts; a validator checks IDs, dates, and required fields; the report goes to the selected destination; and a RevOps owner investigates missing or inaccessible activity.
A deal-level result might contain deal_id, last_activity_at, inactivity_rule_matched, summary, and agent_run_id. The total number of stalled deals belongs in a run-level summary, not in a field presented as though it described one deal.
Build the review and writeback boundary before automation
Use ordinary rules for dates, missing values, owners, stages, and associations. Ask AI to summarize activity, group themes, or suggest a next action when the input is ambiguous. This makes the workflow easier to test and keeps objective eligibility out of a probabilistic decision.
For proposed changes, use a structured result that a validator can parse. This is a proposed implementation contract, not a HubSpot schema:
{
"record_id": "12345",
"object_type": "deals",
"source_record_ids": [
"12345",
"67890"
],
"proposed_property_changes": {
"description": "Review activity and confirm next step"
},
"reason": "No qualifying activity was found in the defined window",
"confidence": 0.82,
"approval_required": true,
"generated_at": "2026-10-14T09:00:00Z",
"agent_run_id": "pipeline-scan-2026-10-14-a1b2"
}
Place parsing and policy checks between the agent result and any write command. Reject missing or mismatched record IDs, unsupported object types, properties outside an allowlist, invalid property values, and results that require approval but have not been approved. A confidence score can inform triage, but it is not a substitute for those checks.
Dry-run is a preview, not a transaction. A record can change between preview and execution, so the team must choose how to identify stale proposals and who decides whether to re-run or reject them. New workflows should start in report-only mode and add write access only after the filters, output contract, reviewer, and exception route work on a narrow sample.
Permissions, privacy, and operational ownership
OAuth uses the connected HubSpot user’s permissions and is recommended for most standard agent workflows. Service-key authentication can support some account-level, schema, destructive, or automation operations that OAuth cannot, but it carries broader permissions and does not provide the same per-user audit trail. Select the least-privilege mode that supports the job.
Map the workflow to the exact objects, properties, associations, activities, and transcripts it needs. Confirm the connected identity can read and, if necessary, write each one. Minimize the records and fields sent to the selected agent environment, and verify that environment’s data handling and access controls. Do not assume that sensitive-data restrictions, approval controls, or validation behavior documented for a separate connector apply identically to Agent CLI.
- Identify the OAuth user or service key and document why the selected mode is necessary.
- Test access to every required object, property, association, activity, and transcript.
- Remove sensitive fields that are not needed for the task and limit external run logs to necessary evidence.
- Name an owner for failed runs, ambiguous records, stale proposals, and approval decisions.
- Record workflow version, runner, timestamps, status, run ID, and source record IDs.
Before using a service key, document its owner, enabled operations, storage controls, and independent approval and run-audit process. For Claude Cowork Team or Enterprise, verify any current allowlisting requirements in the relevant HubSpot and Claude documentation. Retest the workflow when beta commands, permissions, or account configuration change.
Measure workflow quality at the right data grain
Keep four kinds of records distinct:
- Run record: one record for each execution, with account, workflow, runner, version, timestamps, status, and a unique run identifier.
- Observation: one record for each CRM record evaluated, including the rule result and evidence identifiers.
- Proposed mutation: one record for each target record and field-level change proposed or applied.
- Aggregate summary: one record for a defined run or reporting period, such as records evaluated, flagged, approved, applied, rejected, and failed.
A useful run identifier can combine account ID, workflow ID, scheduled-run timestamp, and a unique run UUID. Do not use only account ID and calendar date if multiple runs can occur on the same day. Retain source record IDs and timestamps so a reviewer can trace an observation to the CRM data used as evidence.
For an external queue or audit store, an illustrative mutation uniqueness key might be account_id + workflow_id + source_record_id + target_action + source_version. That key identifies one proposed action at a particular source version, not one entire run. If multiple activities or citations produce separate observations, include the activity or citation identifier rather than collapsing them into one row. This is an implementation recommendation, not an official HubSpot field.
Do not rely on lookup-then-create as a concurrency guarantee. Two workers can check at the same time and both insert. If an external system owns the work queue or audit records, use a database-enforced unique constraint and a transactional upsert there. For HubSpot records, verify that the documented Agent CLI upsert operation supports the chosen object and unique property. Do not assume universal idempotency, race protection, or duplicate prevention.
Track records evaluated, flagged, approved, applied, rejected, failed, and manually resolved. These are operational measures, not proof of AI accuracy or business impact. Investigate unexplained differences between proposed and applied counts for each run.
A practical decision rule for adopting the Agent CLI
Start with a read-first pilot: deterministic filters, structured output, a named reviewer, and a clear destination. This tests access, data definitions, output quality, and ownership without immediately changing CRM records. Move to writes only when the business rule is explicit, the output is validated, consequential changes have an approval path, and execution results can be reconciled.
Use Connectors or MCP for interactive work. Consider Agent CLI for repeatable or bulk command-oriented work. Supply a separate, verified orchestration design when the job must start unattended. If you need help assessing CRM permissions, data structure, or operating processes, see HubSpot systems consulting. For bounded agent roles and implementation support, see AI agent implementation support.
For current setup details, use HubSpot’s public beta announcement and technical guide. The CLI supplies useful CRM commands and a documented dry-run preview. Dependable automation still requires a defined trigger, bounded task, validation boundary, responsible owner, and verified failure path.
