Skip to content

Use the HubSpot Agent CLI

Last updated: June 23, 2026

Available with any of the following subscriptions, except where noted:

The HubSpot Agent CLI connects AI coding agents, such as Claude Code, Claude Cowork, and OpenAI Codex, to your HubSpot account. After connecting the Agent CLI to HubSpot, you can ask an AI agent to complete repetitive CRM tasks, analyze data, generate summaries, and help manage processes across your account. When you delegate tasks to AI agents, they can use the Agent CLI to automate routine work on your behalf, helping your team spend more time on strategic initiatives.

For example, instead of manually reviewing records each week, you can ask an AI agent to identify incomplete records, summarize pipeline activity, or prepare account reviews using information from HubSpot.

If you're a developer looking to write custom scripts or use the HubSpot Agent CLI manually in your terminal, refer to our developer documentation.

Before you get started

Before you begin using the HubSpot Agent CLI, ensure that you have access to an AI coding agent. Supported agents include Claude Code, Claude Cowork, OpenAI Codex, and many other compatible AI coding agents.

Please note: if you’re using Claude Cowork in a Team or Enterprise account, your organization’s admin may need to allowlist api.hubapi.com before the CLI can install or run. Learn more about allowlisting in Claude Cowork.

What AI agents can access with HubSpot Agent CLI

The HubSpot Agent CLI can perform actions using the permissions of the connected HubSpot user. Depending on your user permissions, this could include creating, updating, or deleting records in your account.

After connecting the HubSpot Agent CLI, AI agents can work with information across your HubSpot account, including:

  • Contacts, companies, deals, tickets, custom objects, and other CRM records.
  • Workflows.
  • Pipelines and pipeline stages.
  • Properties and custom properties.
  • Associations between records.
  • Activity history.

Please note: always review AI -generated recommendations and proposed actions before applying changes to your CRM data.

Best practices

When working with AI agents connected to HubSpot:

  • Start with reporting, summaries, and analysis tasks before using actions that modify data.
  • Review generated recommendations and large-scale updates before applying changes.
  • Some actions can delete or overwrite HubSpot data. Where available, use the --dry-run option to preview changes before applying them.
  • Use clear prompts that describe the desired outcome.
  • Follow your organization's data governance and security policies.

Connect the HubSpot Agent CLI

Follow the steps below to instruct your agent to install the HubSpot Agent CLI. If you’re a developer, learn more about installing the HubSpot Agent CLI manually.

  1. Open your AI agent, such as Cowork or Codex.
  2. Paste the following prompt into your agent workspace to install the Agent CLI.

Install the HubSpot Agent CLI in this agent workspace. If this workspace uses a POSIX shell (macOS, Linux, WSL, or Bash), run `curl -fsSL https://api.hubapi.com/hub/cli/backend/hub-cli/latest/install.sh | sh`. If it uses Windows PowerShell, run `irm https://api.hubapi.com/hub/cli/backend/hub-cli/latest/install.ps1 | iex`. Then authenticate with `hubspot auth login`, install HubSpot Agent CLI Skills with `npx skills add hubspot/agent-cli-skills`, and use `hubspot --help` to explore what's available.

  1. When prompted, sign in to your HubSpot account.
  2. Review the requested permissions.
  3. Click Connect app.

After authentication is complete, the AI agent can access HubSpot data based on your permissions.

To get started, use one of the sample prompts below.

Example use cases

The following examples show how different teams can use AI agents connected through the HubSpot Agent CLI. The agent is especially useful for recurring operational work that requires reviewing large amounts of CRM data.

Marketing teams

Task: identify contacts that need follow-up or data cleanup.

Example prompt for the AI agent: Every Monday at 8am, find high-fit contacts with no associated deal, no recent sales activity, or missing key enrichment fields, then send RevOps a prioritized cleanup list with suggested next actions.

Additional examples include:

  • Review email campaigns for subject lines and CTAs that do not align with brand voice guidelines.
  • Identify messaging patterns across high-performing landing pages that correlate with stronger conversion rates.
  • Create a re-engagement list of contacts who have not opened emails in a nurture sequence.
  • Track the current pipeline status of deals sourced from a webinar campaign.
  • Identify industry, company size, and lead source patterns among best-fit customers.
  • Monitor active sequences and flag significant declines in email open rates.

Sales and revenue operations teams

Task: monitor pipeline health and identify deals that need attention.

Example prompt for the AI agent: Every morning at 7am, check my pipeline for deals closing this week with no activity in the last 5 days and send me a summary.

Additional examples include:

  • Find inactive high-value deals that require follow-up and review.
  • Prepare for a customer meeting by summarizing deal, support, email, and note history.
  • Analyze slipped deals to identify the pipeline stages where opportunities stalled the longest.
  • Generate a daily summary of deals that are approaching close dates but lack recent activity.

Sales leaders

Task: analyze call transcripts for coaching and product feedback themes.

Example prompt for the AI agent: Analyze recent call transcripts for talk time, competitor mentions, customer feedback, and prospect hesitation themes, then create a coaching and product feedback dashboard with transcript examples and links to the source calls.

Additional examples include:

  • Identify reps or teams with unusually high or low talk-time patterns.
  • Find recurring competitor mentions across recent sales calls.
  • Summarize prospect hesitation themes by segment, deal stage, or product area.
  • Pull transcript examples that support coaching or product feedback themes.
  • Create a dashboard that links call insights back to the source records and transcripts.

RevOps and CRM admins

Task: clean up CRM properties without breaking downstream assets.

Example prompt for the AI agent: Find duplicate or deprecated CRM properties, show where they are used across workflows, reports, and views. Then preview a cleanup plan to replace, remove, or reorder fields before applying changes.

Additional examples include:

  • Identify duplicate properties that collect the same information across different objects.
  • Find deprecated fields that still appear in workflows, reports, views, or record layouts.
  • Preview the impact of removing or replacing a CRM property before making changes.
  • Reorder record fields so admins and reps see the most important information first.
  • Generate a cleanup summary that shows what changed and what still needs review.

Operations teams

Task: consolidate related support tickets and preserve cleanup history.

Example prompt for the AI agent: Consolidate duplicate support tickets, preserve the source ticket details, route each parent ticket to the right pipeline stage, and send the team a cleanup summary with any records that still need review.

Additional examples include:

  • Find duplicate or related support tickets across the same customer or issue type.
  • Merge ticket context into a parent record while preserving source details.
  • Route consolidated tickets to the correct pipeline stage based on current status.
  • Flag tickets that need human review before consolidation.
  • Send a cleanup summary with merged records, open questions, and follow-up owners.

Support teams

Task: review customer history without manually opening multiple records.

Example prompt for the AI agent: Pull the last 5 tickets from this contact, summarize each resolution, and flag any recurring issue patterns.

Additional examples include:

  • Review recent ticket history and identify recurring customer issues before opening a new case.
  • Prioritize tickets that have exceeded response time expectations.
  • Analyze billing-related tickets to identify the most common reasons customers contact support.
  • Prepare ticket responses with relevant deal, subscription, and escalation history.

Customer Success teams

Task: prepare account reviews using information from multiple HubSpot tools.

Example prompt for the AI agent: For my account review this week, summarize open deals, recent support activity, and last NPS score for each account in my book of business.

Additional examples include:

  • Identify customer accounts with indicators of elevated churn risk.
  • Find renewal contacts with low product engagement for proactive outreach.
  • Prepare account reviews by summarizing recent sales, support, and customer feedback activity.
  • Identify expansion opportunities by comparing account growth trends with historical deal size.

Keep the skill library updated

HubSpot Agent CLI Skills provide predefined guidance that helps AI agents work with HubSpot data and common HubSpot processes. The skills library includes guidance for CRM searches, bulk operations, data quality tasks, workflows, reporting, and other operational activities.

You can review the skills that’ll be installed in the public GitHub repository.

To update the skills library in your AI agent workspace, run the following prompt:

npx skills update

Learn more about using skills in Claude and in OpenAI Codex.

Manage access to the HubSpot Agent CLI

Super Admins can manage who is allowed to connect the HubSpot Agent CLI by opting into the App Install Governance beta.

If a user doesn't have permission to connect the HubSpot Agent CLI, they must request approval from an admin before connecting it.

Learn more about managing which apps can be installed in your HubSpot account.

Was this article helpful?
This form is used for documentation feedback only. Learn how to get help with HubSpot.