> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# hubspot CLI in TypeScript

> Supported HubSpot commands for finding and changing CRM records.

Find, create, update and link HubSpot contacts, companies, deals, tickets and activities. The commands follow the CRM part of HubSpot's [Agent CLI](https://developers.hubspot.com/docs/developer-tooling/local-development/agent-cli/guide).

## Setup

Create a service key as [HubSpot setup](https://docs.mirage.strukto.ai/home/setup/cli/hubspot.md) describes.

```typescript theme={null}
import { HUBSPOT, Workspace } from '@struktoai/mirage-node'

const config = { token: 'pat-...' }
const ws = new Workspace({})
ws.registerCli('hubspot', HUBSPOT, config)
```

No service mount is required. For YAML and multiple accounts, see the
[CLI overview](https://docs.mirage.strukto.ai/typescript/cli/index.md#register-a-cli).

## SKILL.md

The [SKILL.md](https://docs.mirage.strukto.ai/home/setup/cli/skill-md.md) an agent reads with `hubspot` installed.

> [tab] Rendered
>
> **Commands**
>
> hubspot
>
> Each entry is one subcommand's complete usage. `--help` shows the same options with longer descriptions.
> `[ ]` optional · `(repeat)` give the flag once per value · `=v` default · `a|b` choices · `json` one quoted JSON value, its keys after the entry when the schema names them.
> Flags are spelled exactly as shown; no abbreviations. Quote a value that contains spaces.
>
> **hubspot**
>
> ```text theme={null}
> hubspot objects types [--format jsonl|json|table]
>   List the object types. --format: How to print the result (default jsonl).
> hubspot objects list --type str [--properties str] [--limit int] [--after str] [--format jsonl|json|table]
>   List records. --type: Object type, such as contacts or deals. --properties: Properties to read, separated by commas. --limit: Most rows to read, up to 100. --after: Cursor of the page to read. --format: How to print the result (default jsonl).
> hubspot objects get [id...] --type str [--properties str] [--format jsonl|json|table]
>   Read records by ID. --type: Object type, such as contacts or deals. --properties: Properties to read, separated by commas. --format: How to print the result (default jsonl).
> … 14 more subcommands left out of this excerpt
> ```

> [tab] Raw
>
> ```markdown theme={null}
> ---
> name: workspace-commands
> description: The CLIs registered in this workspace and how to call them.
> ---
>
> # Commands
>
> hubspot
>
> Each entry is one subcommand's complete usage. `--help` shows the same options with longer descriptions.
> `[ ]` optional · `(repeat)` give the flag once per value · `=v` default · `a|b` choices · `json` one quoted JSON value, its keys after the entry when the schema names them.
> Flags are spelled exactly as shown; no abbreviations. Quote a value that contains spaces.
>
> ## hubspot
> hubspot objects types [--format jsonl|json|table]
>   List the object types. --format: How to print the result (default jsonl).
> hubspot objects list --type str [--properties str] [--limit int] [--after str] [--format jsonl|json|table]
>   List records. --type: Object type, such as contacts or deals. --properties: Properties to read, separated by commas. --limit: Most rows to read, up to 100. --after: Cursor of the page to read. --format: How to print the result (default jsonl).
> hubspot objects get [id...] --type str [--properties str] [--format jsonl|json|table]
>   Read records by ID. --type: Object type, such as contacts or deals. --properties: Properties to read, separated by commas. --format: How to print the result (default jsonl).
> … 14 more subcommands left out of this excerpt
> ```

## Supported commands

Run `hubspot <command> --help` for the supported flags and operands.
This list is generated from Mirage's registered command tree.

| Command | Description |
| - | - |
| `hubspot objects types` | List the object types |
| `hubspot objects list` | List records |
| `hubspot objects get` | Read records by ID |
| `hubspot objects search` | Find records by their properties |
| `hubspot objects count` | Count records |
| `hubspot objects create` | Create records |
| `hubspot objects update` | Change records, after a --dry-run |
| `hubspot properties list` | List properties |
| `hubspot properties get` | Read a property |
| `hubspot properties options-list` | List the values a property allows |
| `hubspot pipelines list` | List pipelines |
| `hubspot pipelines get` | Read a pipeline |
| `hubspot pipelines stages` | List a pipeline's stages |
| `hubspot associations list` | List the records linked to one |
| `hubspot associations create` | Link records |
| `hubspot owners list` | List owners |
| `hubspot activities list` | List a record's activities, newest first |

## Usage

### Find records

```bash theme={null} theme={null}
hubspot objects search --type contacts --filter "lastname~valdez"
hubspot objects search --type deals --filter "amount>1000 AND dealstage=contractsent"
hubspot objects get --type contacts 101 102 --properties email,phone
hubspot associations list --from contacts:101 --to deals
hubspot activities list --contact 101 --limit 10
```

Conditions in one `--filter` are joined by `AND`; a record that meets any one
`--filter` is found.

| Condition | Finds records whose property |
| - | - |
| `name=value`, `name!=value` | is, or is not, the value |
| `name>value`, `>=`, `<`, `<=` | compares that way; dates are `YYYY-MM-DD` |
| `name~word` | holds the whole word |
| `name@=a,b`, `name@!=a,b` | is, or is not, one of the values |
| `name`, `!name` | is set, or is empty |

Rows print as JSONL. `--format json` adds the cursor of the next page at
`meta.next`, for `--after`; `--format table` prints columns.

### Change records

```bash theme={null} theme={null}
hubspot objects create --type notes --property hs_note_body="Keys handed over" --property hs_timestamp=2026-06-10T10:00:00Z
hubspot associations create --from notes:501 --to contacts:101
hubspot objects update --type deals 301 --property dealstage=closedwon --dry-run
hubspot objects update --type deals 301 --property dealstage=closedwon --digest blast-29cfdd48b583 --confirm 301
```

An update needs a `--dry-run` first. Its result holds the `digest` to pass back,
with the record ID, or the number of records, as `--confirm`. The digest stays
valid for at least five minutes and only for the same change.

`create`, `update` and `associations create` also read one JSON object per line
from stdin, and print one result per line.

## Behavior

* The install carries the account, so `hubspot auth`, `whoami` and `upgrade`
  do not exist. Other commands of HubSpot's CLI, such as `delete`, `workflows`
  and `reports`, are not supported.
* Bad flags and malformed input exit 2. A refused call, a missing record and a
  partly failed write exit 1.
* Reads retry `429`, `502`, `503` and `504`; writes retry only `429`, to avoid
  repeating a write that may already have succeeded.

## License

| Project | Role in Mirage | License |
| - | - | - |
| [agent-cli-skills](https://github.com/hubspot/agent-cli-skills) | Command names, filters and result shapes; no text is copied | Apache-2.0 |
| [Mirage](https://github.com/strukto-ai/mirage) | Command implementation | [Apache-2.0](https://github.com/strukto-ai/mirage/blob/main/LICENSE) |

See [compatibility and licenses](https://docs.mirage.strukto.ai/home/setup/clis.md#compatibility-and-licenses).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.