HubSpot CLI
$ hs Official Med RiskHubSpot CLI (hs) connects local developer workflows to HubSpot CMS Hub themes, serverless functions, and developer projects. It supports multiple named accounts and sandboxes via hubspot.config.yml, though many commands target human terminal output rather than strict JSON.
npm install -g @hubspot/cli Use hs CLI for HubSpot CMS file sync and hs project builds/deploys; use HubSpot MCP for conversational CRM object search and deal/contact inspection.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --account and CI env vars, but lacks universal --json output across cms and project subcommands.
- Human-formatted logs/tables are the default output
- Init and auth flows default to interactive prompts unless env vars are configured
Explicit --account selection and personal access keys isolate portals, though cms delete is destructive.
- Named account profiles in
hubspot.config.ymlseparate sandbox vs prod - Environment-variable auth avoids storing keys in repo files
Standard Node.js package installable globally or via npx @hubspot/cli across all major OSes.
- Published on npm as
@hubspot/cli
Solid for HubSpot CMS themes and projects, though CRM object CRUD is outside its scope.
- Focused on CMS Hub assets, HubDB, and Developer Projects
Official HubSpot tool (HubSpot/hubspot-cli) actively maintained under Apache-2.0.
- Official HubSpot GitHub repository
Well-documented CMS and Developer Projects CLI guides in HubSpot Developer Docs.
- Official reference on developers.hubspot.com
Security, Auth & Guardrails
Stores personal access keys and portal IDs in hubspot.config.yml or reads HUBSPOT_PERSONAL_ACCESS_KEY / HUBSPOT_PORTAL_ID environment variables.
CLI is free (Apache-2.0); HubSpot Developer Sandbox accounts are free for testing.
# HubSpot CLI Agent Rules - Always pass `--account=<sandbox>` explicitly so operations never default to a production portal. - Never run `hs cms delete` or `hs filemanager delete` without explicit human confirmation. - Keep `hubspot.config.yml` out of version control and prefer `HUBSPOT_PERSONAL_ACCESS_KEY` in CI.
Agent-Ready Command Recipes
Safe Read-Only Queries
hs account list
Displays configured portal IDs, account names, and default account settings from hubspot.config.yml.
hs cms list --account=sandbox
Lists remote Design Manager paths inside the named sandbox account without modifying files.
Controlled Writes & Previews
hs project upload --account=sandbox
Uploads a HubSpot Developer Project to the designated sandbox portal for preview.
Strengths for Agents
- + Multi-account configuration (
--account) makes targeting HubSpot developer sandboxes straightforward. - + Clean CI support via
HUBSPOT_PERSONAL_ACCESS_KEYandHUBSPOT_PORTAL_ID. - + Direct integration with HubSpot Developer Projects and CMS Design Manager.
Caveats & Pitfalls
- ! Lacks universal
--jsonoutput across most subcommands, requiring text parsing by agents. - ! Scoped to CMS/developer projects rather than general CRM contact or deal queries.