@cli4ai/hubspot
HubSpot CRM CLI tool for managing contacts, deals, and companies.
Installation
cli4ai add hubspot
Setup
1. Create a HubSpot Private App
- Go to HubSpot → Settings (gear icon) → Integrations → Private Apps
- Or visit:
https://app.hubspot.com/private-apps/{your-hub-id}
- Click Create a private app
- Give it a name (e.g., "cli4ai Integration")
- Go to the Scopes tab and enable:
crm.objects.contacts.read
crm.objects.contacts.write
crm.objects.deals.read
crm.objects.deals.write
crm.objects.companies.read
- Click Create app → Continue Creating
- Copy the Access Token
Note: You must be a super admin in HubSpot to create private apps.
2. Configure the Token
cli4ai secrets set HUBSPOT_ACCESS_TOKEN "pat-na1-xxxxx"
Commands
Contacts
cli4ai run hubspot contacts
cli4ai run hubspot contacts 20
cli4ai run hubspot contact 12345
cli4ai run hubspot contact user@example.com
cli4ai run hubspot contact-create user@example.com John Doe
cli4ai run hubspot contact-update 12345 '{"phone":"+1234567890"}'
cli4ai run hubspot contact-delete 12345
Deals
cli4ai run hubspot deals
cli4ai run hubspot deals 20
cli4ai run hubspot deal 12345
cli4ai run hubspot deal-create "New Deal"
cli4ai run hubspot deal-create "Big Deal" closedwon 50000
cli4ai run hubspot deal-update 12345 '{"amount":"75000"}'
cli4ai run hubspot deal-delete 12345
Companies
cli4ai run hubspot companies
cli4ai run hubspot company 12345
Search
cli4ai run hubspot search contacts "john@example.com"
cli4ai run hubspot search deals "enterprise"
cli4ai run hubspot search companies "acme"
MCP Server
Use HubSpot as an MCP server for AI agents:
cli4ai start hubspot
Configure in Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"hubspot": {
"command": "cli4ai",
"args": ["start", "hubspot"]
}
}
}
Output Format
All commands output JSON for AI consumption:
{
"contacts": [
{
"id": "12345",
"email": "john@example.com",
"name": "John Doe",
"company": "Acme Inc",
"lifecyclestage": "customer"
}
],
"count": 1,
"hasMore": false
}
Links