The HubSpot Agent CLI is a command-line tool for AI agents and technical users who need to work directly with HubSpot CRM data from a local or agent workspace.
This repository is the public home for HubSpot Agent CLI releases, version history, issue tracking, and documentation links. The CLI should be installed using the instructions and prompts included below.
Warning
The HubSpot Agent CLI is currently in beta. Commands, flags, and behavior may change without notice. Write operations such as create, update, and delete can modify or permanently delete live CRM data. Test in a sandbox account when possible and use --dry-run before applying mutations.
- Documentation: Install and use the HubSpot Agent CLI
- HubSpot Knowledge Base: Use the HubSpot Agent CLI
- HubSpot Agent CLI Skills
- Releases
- Issues
The Agent CLI is packaged as a single binary with no runtime dependencies. It is supported on macOS, Linux, and Windows.
If you are setting up the CLI for use with an AI agent such as Claude Code, Claude Cowork, or OpenAI Codex, provide the prompt below to your agent:
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.
Agents can discover CLI capabilities with --help at any level of the command tree:
hubspot --help
hubspot objects --help
hubspot objects list --helpInstall the latest Agent CLI binary for your operating system.
macOS and Linux
curl -fsSL https://api.hubapi.com/hub/cli/backend/hub-cli/latest/install.sh | shWindows PowerShell
irm https://api.hubapi.com/hub/cli/backend/hub-cli/latest/install.ps1 | iexThe installer adds the CLI to your PATH. After installation, open a new terminal window or tab so the PATH change takes effect.
Verify the installation:
hubspot --versionIf you installed the CLI for use in an AI-agent workspace, install HubSpot Agent CLI Skills in that same workspace:
npx skills add hubspot/agent-cli-skillsThe skills give compatible agents HubSpot-specific guidance for CRM lookup, bulk operations, data quality, workflow automation, and related tasks. To inspect the skills before installing them, see the hubspot/agent-cli-skills repository.
After installing the CLI, authenticate with your HubSpot account:
hubspot auth loginThis opens a browser window where you can authorize the CLI. The resulting token is scoped to your HubSpot user permissions and is refreshed automatically.
Confirm your authenticated account and token type:
hubspot whoamiTo clear cached credentials:
hubspot auth logoutFor admin or automation workflows that require account-level access, the CLI also supports service key tokens through the HUBSPOT_ACCESS_TOKEN environment variable. See Admin mode via service key token for details on OAuth behavior, service key setup, and auth-sensitive commands.
Choose the update path that matches how you installed the CLI.
Download and install the latest Agent CLI binary:
hubspot upgradeIf you also installed HubSpot Agent CLI Skills in this workspace, update the skills library:
npx skills updateProvide the prompt below to your AI agent:
Use the command `hubspot upgrade` in the workspace you previously installed the HubSpot Agent CLI to get the latest version. Then use `npx skills update` in the same workspace to check for new or updated HubSpot Agent CLI Skills. Confirm when both commands have completed successfully or if there were any errors and the appropriate resolution steps.
Technical users who rely on generated scripts can disable automatic upgrade checks to keep CLI behavior consistent while those scripts are reviewed.
export HUBSPOT_NO_AUTO_UPGRADE=1Confirm the CLI version your scripts will use:
hubspot --versionThis setting applies to automatic upgrade checks for normal commands. You can still install an update explicitly with hubspot upgrade.
The CLI installer, upgrade flow, and commands communicate with HubSpot through api.hubapi.com. If your agent workspace runs in a managed environment with outbound network restrictions, your administrator may need to allowlist api.hubapi.com. For further information and instructions for administrators of Claude and Codex Desktop apps, see Using the CLI with Claude Cowork.
Use GitHub Issues to report bugs, request improvements, or share feedback about the HubSpot Agent CLI. Include the CLI version from hubspot --version, the command you ran, the expected result, and the actual result.
By using the HubSpot Agent CLI beta, you agree to HubSpot's Developer Terms and Developer Beta Terms.
