- Knowledge Base
- Account & Setup
- Integrations
- Use the HubSpot Agent CLI
Use the HubSpot Agent CLI
Last updated: September 29, 2026
Available with any of the following subscriptions, except where noted:
The HubSpot Agent CLI connects AI coding agents, such as those in the ChatGPT app, Claude app, and Claude Code 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 HubSpot's 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 those in the ChatGPT app, Claude app, Claude Code, 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.
When to use the HubSpot Agent CLI
The Agent CLI is useful for repetitive or recurring operational work that requires reviewing large amounts of CRM data. This includes tasks like running a weekly pipeline review, bulk-updating records, or sending scheduled summaries to your team after a recurring monthly meeting. Review more example use cases.
If you're looking to ask one-off questions or draft content using your HubSpot data, the HubSpot connector for Claude or HubSpot connector for ChatGPT are options that don't require CLI installation.
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.
- Revenue records (read-only): contracts, invoices, orders, payments, quotes, quote templates, and subscriptions (BETA).
- 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.
- When setting up scheduled or recurring tasks, start with a single, narrow use case before expanding to broader automation.
- 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, specific 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.
- Open your AI agent.
- 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.
- When prompted, sign in to your HubSpot account.
- Review the requested permissions.
- Click Connect app.
After authentication is complete, the AI agent can access HubSpot data based on your permissions.
Example use cases
The following examples show how different teams can use AI agents connected through the HubSpot Agent CLI.
Marketing teams
| Task | Example prompt for the AI agent |
| Identify contacts that need follow-up or data cleanup. | 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. |
| Review email campaigns for subject lines and CTAs that do not align with brand voice guidelines. | Review my last 10 email campaigns and flag subject lines or CTAs that don't follow our brand voice guidelines. List each issue with the campaign name, the flagged copy, and a suggested revision. |
| Identify messaging patterns across high-performing landing pages that correlate with stronger conversion rates. | Analyze my top-performing landing pages by conversion rate. Identify common messaging patterns, such as headline structure, CTA phrasing, or offer type, and summarize what they have in common. |
| Create a re-engagement list of contacts who have not opened emails in a nurture sequence. | Find all contacts currently enrolled in a nurture sequence who haven't opened any emails in the last 30 days. Create a segment with their name, company, lifecycle stage, and last activity date. |
| Track the current pipeline status of deals sourced from a webinar campaign. | Find all deals with a lead source of webinar and show their current pipeline stage, owner, amount, and last activity date. Summarize how many are active, stalled, or closed. |
| Identify industry, company size, and lead source patterns among best-fit customers. | Look at my closed-won deals from the last 12 months and summarize the most common industry, company size, and lead source combinations. Highlight any patterns that could help refine our ideal customer profile. |
| Monitor active sequences and flag significant declines in email open rates. | Check all active sequences and compare open rates from the last two weeks to the previous two weeks. Flag any sequences where open rates have dropped by more than 20%, and include the sequence name, current rate, and previous rate. |
Sales and revenue operations teams
| Task | Example prompt for the AI agent |
| Monitor pipeline health and identify deals that need attention. | 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. |
| Find inactive high-value deals that require follow-up and review. | Find all open deals over $[amount] with no activity in the last 14 days. Sort by deal value and include the deal name, owner, close date, and last activity. |
| Prepare for a customer meeting by summarizing deal, support, email, and note history. | I have a meeting with [Company] tomorrow. Summarize their open and recent closed deals, last 5 support tickets, recent email activity, and any notes logged in the last 60 days. |
| Analyze slipped deals to identify the pipeline stages where opportunities stalled the longest. | Look at deals that slipped their close date in the last quarter. For each, show which pipeline stage they spent the most time in, and identify the two or three stages where deals most commonly stall. |
| Generate a daily summary of deals that are approaching close dates but lack recent activity. | Every day at 8am, find deals closing within the next 7 days with no activity in the last 3 days. Send me a summary with the deal name, owner, amount, close date, and last activity type. |
Sales leaders
| Task | Example prompt for the AI agent |
| Analyze call transcripts for coaching and product feedback themes. | 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. |
| Identify reps or teams with unusually high or low talk-time patterns. | Analyze call transcripts from the last 30 days and calculate the average talk-time ratio by rep. Flag anyone with a ratio above 70% or below 30%, and include a sample transcript excerpt for each. |
| Find recurring competitor mentions across recent sales calls. | Review call transcripts from the last 60 days and identify the competitors mentioned most often. For each, show how many calls included a mention, which deal stages they came up in, and a sample quote. |
| Summarize prospect hesitation themes by segment, deal stage, or product area. | Scan recent call transcripts for language that indicates prospect hesitation or objections. Group the themes by deal stage and prospect segment, and summarize the top 5 hesitation patterns with example quotes. |
| Pull transcript examples that support coaching or product feedback themes. | From call transcripts in the last 30 days, find three to five examples of strong discovery questions and three to five examples of missed objection-handling moments. Include the rep name, call date, and a direct quote from each. |
| Create a dashboard that links call insights back to the source records and transcripts. | Create a coaching dashboard summarizing talk-time ratios, competitor mentions, and objection themes from calls in the last 30 days. For each insight, include a link to the source call and the associated deal record. |
RevOps and CRM admins
| Task | Example prompt for the AI agent |
| Clean up CRM properties without breaking downstream assets. | 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. |
| Identify duplicate properties that collect the same information across different objects. | Scan all contact, company, and deal properties and flag any that appear to collect the same information under different names. List the property names, their objects, and a suggested action for each duplicate pair. |
| Find deprecated fields that still appear in workflows, reports, views, or record layouts. | Find all CRM properties that have not been updated in the last 12 months but still appear in active workflows, saved reports, list views, or record card layouts. Show where each is used before any changes are made. |
| Preview the impact of removing or replacing a CRM property before making changes. | I want to remove the property [Property Name]. Before making any changes, show me every workflow, report, list, and record layout that uses it, and preview what would break or need to be updated. |
| Reorder record fields so admins and reps see the most important information first. | For the contact record layout, move these fields to the top of the properties sidebar: [Field 1], [Field 2], [Field 3]. Preview before applying changes. |
| Generate a cleanup summary that shows what changed and what still needs review. | After completing the CRM property cleanup, generate a summary of every property that was removed, replaced, or renamed, which assets were updated, and a list of any fields that still need manual review. |
Operations teams
| Task | Example prompt for the AI agent |
| Consolidate related support tickets and preserve cleanup history. | 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. |
| Find duplicate or related support tickets across the same customer or issue type. | Find all open support tickets from the same company that were created within 30 days of each other. Group them by company and issue type, and flag any that appear to be duplicates. |
| Merge ticket context into a parent record while preserving source details. | For the duplicate tickets identified above, merge the description, contact history, and notes from each source ticket into the parent record's notes before closing the duplicates. |
| Route consolidated tickets to the correct pipeline stage based on current status. | For each consolidated parent ticket, check its current status and move it to the correct pipeline stage: open issues to In Progress, tickets awaiting a response to Waiting on Customer, and resolved issues to Closed. |
| Flag tickets that need human review before consolidation. | Before consolidating any tickets, flag records that have an open payment dispute, an active SLA clock, or a note marked as escalation. Do not merge these. List them for manual review instead. |
| Send a cleanup summary with merged records, open questions, and follow-up owners. | After ticket consolidation is complete, send the support team lead a summary listing every parent ticket created, which source tickets were merged into it, any open questions that need follow-up, and who owns each next step. |
Support teams
| Task | Example prompt for the AI agent |
| Review customer history without manually opening multiple records. | Pull the last 5 tickets from this contact, summarize each resolution, and flag any recurring issue patterns. |
| Review recent ticket history and identify recurring customer issues before opening a new case. | Before I create a new ticket for [Contact], pull their last 10 tickets, summarize each resolution, and flag any issues that appear more than once. Include the ticket subject, status, and resolution date. |
| Prioritize tickets that have exceeded response time expectations. | Find all open tickets that have not received a response within the expected SLA window. Sort them by how overdue they are and include the ticket owner, contact name, and last activity date. |
| Analyze billing-related tickets to identify the most common reasons customers contact support. | Review all tickets tagged with a billing-related category from the last 90 days. Summarize the top 5 reasons customers contacted support, ranked by volume, and include the average time to resolution for each. |
| Prepare ticket responses with relevant deal, subscription, and escalation history. | For ticket [Ticket ID], pull the contact's associated deal history, current subscription details, and any previous escalation notes. Summarize the context and draft a response that addresses the customer's issue. |
Customer Success teams
| Task | Example prompt for the AI agent |
| Prepare account reviews using information from multiple HubSpot tools. | For my account review this week, summarize open deals, recent support activity, and last NPS score for each account in my book of business. |
| Identify customer accounts with indicators of elevated churn risk. | Review accounts in my book of business and flag any with two or more of these signals: declining product login frequency, open support tickets older than 14 days, an NPS score below 7, or no CSM activity in the last 30 days. Rank them by risk level. |
| Find renewal contacts with low product engagement for proactive outreach. | Find all contacts at accounts renewing in the next 60 days who have not logged into the product in the last 21 days. Create a prioritized outreach list with the contact name, account, renewal date, and last login date. |
| Prepare account reviews by summarizing recent sales, support, and customer feedback activity. | For [Account Name], summarize all deal activity from the last 6 months, open and recently closed support tickets, and any NPS or CSAT responses. Format this as a pre-QBR brief I can share with the account team. |
| Identify expansion opportunities by comparing account growth trends with historical deal size. | Look at accounts in my book of business that have grown in headcount or revenue in the last year. Compare their current deal size to what similar accounts have expanded to, and flag the top 10 as potential expansion opportunities. |
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 ChatGPT.
Manage access to the HubSpot Agent CLI
Super Admins can manage who is allowed to connect the HubSpot Agent CLI. If a user doesn't have permission to connect the HubSpot Agent CLI, they must request approval from a Super Admin before connecting it.
Learn more about managing which apps can be installed in your HubSpot account.
