productivity
HubSpot CLI for Shell Scripts
Use the HubSpot CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.
25 functions 12 read 13 write Bearer token auth
HubSpot CLI for Shell Scripts
Call integration functions from shell scripts with stable JSON input and output.
Use shell scripts for small local automations that need one or more integration calls. The HubSpot CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# HubSpot CLI for Shell Scripts
kosmokrator integrations:configure hubspot --set access_token="$HUBSPOT_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call hubspot.hubspot_create_contact '{"first_name":"example_first_name","last_name":"example_last_name","email":"example_email","phone":"example_phone","company":"example_company","properties":"example_properties"}' --json Discovery Before Execution
Agents and scripts can inspect HubSpot docs and schemas before choosing a function.
kosmo integrations:docs hubspot --json
kosmo integrations:docs hubspot.hubspot_create_contact --json
kosmo integrations:schema hubspot.hubspot_create_contact --json
kosmo integrations:search "HubSpot" --json
kosmo integrations:list --json Useful HubSpot CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
hubspot.hubspot_create_contact | Write | first_name, last_name, email, phone, company, properties | Create a new contact in HubSpot CRM. Supports firstname, lastname, email, phone, company, and any additional custom properties. Returns the created contact with its HubSpot ID and properties. |
hubspot.hubspot_get_contact | Read | id, properties | Retrieve a HubSpot contact by its ID. Returns the contact's ID, properties, and associated data. Optionally specify which properties to include. |
hubspot.hubspot_update_contact | Write | id, properties | Update an existing HubSpot contact by ID. Provide a properties object with the fields to update (e.g., {"firstname": "Jane", "phone": "555-0100"}). Returns the updated contact. |
hubspot.hubspot_search_contacts | Read | query, filter_groups, properties, limit, after | Search HubSpot contacts using filter groups and/or a text query. Use filterGroups for structured queries (e.g., email equals "[email protected]"). Use query for full-text search across searchable properties. Supports pagination with limit and after parameters. |
hubspot.hubspot_delete_contact | Write | id | Delete a HubSpot contact by ID. Permanently removes the contact from HubSpot CRM. This action cannot be undone. |
hubspot.hubspot_create_or_update_contact | Write | email, first_name, last_name, phone, company, properties | Create or update a HubSpot contact by email. First searches for an existing contact matching the email. If found, updates it. If not found, creates a new contact. Supports firstname, lastname, phone, company, and any additional custom properties. |
hubspot.hubspot_create_company | Write | name, domain, properties | Create a new company in HubSpot CRM. Supports name, domain, and any additional custom properties. Returns the created company with its HubSpot ID and properties. |
hubspot.hubspot_get_company | Read | id, properties | Retrieve a HubSpot company by its ID. Returns the company's ID, properties, and associated data. Optionally specify which properties to include. |
hubspot.hubspot_update_company | Write | id, properties | Update an existing HubSpot company by ID. Provide a properties object with the fields to update (e.g., {"name": "Acme Corp", "domain": "acme.com"}). Returns the updated company. |
hubspot.hubspot_search_companies | Read | query, filter_groups, properties, limit, after | Search HubSpot companies using filter groups and/or a text query. Use filterGroups for structured queries (e.g., domain equals "acme.com"). Use query for full-text search across searchable properties. Supports pagination with limit and after parameters. |
hubspot.hubspot_create_deal | Write | dealname, amount, pipeline, dealstage, closedate, properties | Create a new deal in HubSpot CRM. Supports dealname, amount, pipeline, dealstage, closedate, and any additional custom properties. Returns the created deal with its HubSpot ID and properties. |
hubspot.hubspot_get_deal | Read | id, properties | Retrieve a HubSpot deal by its ID. Returns the deal's ID, properties, and associated data. Optionally specify which properties to include. |
hubspot.hubspot_update_deal | Write | id, properties | Update an existing HubSpot deal by ID. Provide a properties object with the fields to update (e.g., {"dealstage": "closedwon", "amount": "5000"}). Returns the updated deal. |
hubspot.hubspot_list_deals | Read | limit, after, properties | List deals in HubSpot CRM with cursor-based pagination. Optionally specify properties to include and control page size. Use the "after" cursor from a previous response to fetch the next page. |
hubspot.hubspot_create_ticket | Write | subject, content, hs_pipeline, hs_pipeline_stage, properties | Create a new ticket in HubSpot CRM. Supports subject, content, hs_pipeline, hs_pipeline_stage, and any additional custom properties. Returns the created ticket with its HubSpot ID and properties. |
hubspot.hubspot_get_ticket | Read | id, properties | Retrieve a HubSpot ticket by its ID. Returns the ticket's ID, properties, and associated data. Optionally specify which properties to include. |
hubspot.hubspot_update_ticket | Write | id, properties | Update an existing HubSpot ticket by ID. Provide a properties object with the fields to update (e.g., {"subject": "New subject", "hs_pipeline_stage": "2"}). Returns the updated ticket. |
hubspot.hubspot_create_association | Write | from_type, from_id, to_type, to_id, association_type | Create an association between two HubSpot CRM objects. For example, associate a contact to a company, or a deal to a company. Specify the from/to object types (contacts, companies, deals, tickets), their IDs, and the association type. Common association types: contact_to_company, company_to_contact, deal_to_company, ticket_to_contact. |
hubspot.hubspot_list_associations | Read | from_type, from_id, to_type | List associations from a HubSpot CRM object to another object type. For example, list all companies associated with a specific contact. Returns the associated object IDs and association types. |
hubspot.hubspot_list_owners | Read | limit, after | List HubSpot CRM owners (users). Returns owner IDs, names, and emails. Useful for assigning owners to contacts, deals, and tickets. Supports pagination with limit and after parameters. |
hubspot.hubspot_create_engagement | Write | type, body, timestamp, owner_id, properties | Create an engagement in HubSpot CRM (note, task, or meeting). Specify the type and provide the relevant properties. For notes: body (HTML content). For tasks: hs_task_body, hs_task_subject, hs_task_status. For meetings: hs_meeting_title, hs_meeting_body, hs_meeting_start_time, hs_meeting_end_time. |
hubspot.hubspot_list_pipelines | Read | object_type | List HubSpot CRM pipelines for a given object type. Returns all pipelines and their stages. Commonly used for deals and tickets. Use the object type "deals" or "tickets" to get the respective pipelines. |
hubspot.hubspot_list_properties | Read | object_type | List HubSpot CRM property definitions for a given object type. Returns all properties including their name, label, type, and field type. Useful for discovering available properties for contacts, companies, deals, or tickets. |
hubspot.hubspot_add_contact_to_list | Write | list_id, contact_ids, emails | Add contacts to a HubSpot marketing list. Provide either contact_ids (HubSpot vid IDs) or emails (email addresses), or both. Contacts that are already in the list are silently skipped. |
hubspot.hubspot_list_forms | Read | limit, after | List HubSpot marketing forms. Returns form IDs, names, types, and creation timestamps. Supports pagination with limit and after parameters. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.