Reference · Error codes

CLI error codes.

When a command fails, hs-x prints a stable HSX_E_* code and a link into this reference. Every code below is generated from the same registry the CLI ships, so the page for a code always matches the binary that printed it. Each one covers what the error means, the likely causes, and how to fix it; --json output carries the same code and a docs_url field.

Outcome
You can resolve any HSX_E_* code the CLI prints — or hand the page to your coding agent and let it do the fixing.

All 67 codes

In registry order, which groups codes by family: input parsing, scaffolding, migration, deploy, local dev, accounts and sessions, API calls, credential exchanges, and linking. The exit column is the process exit code hs-x terminates with when the error stops a command.

CodeWhat happenedExit
HSX_E_INPUT_UNKNOWN_COMMANDUnknown command10
HSX_E_INPUT_UNKNOWN_SUBCOMMANDUnknown subcommand10
HSX_E_INPUT_UNKNOWN_FLAGUnknown flag10
HSX_E_INPUT_MISSING_VALUEFlag missing value10
HSX_E_INPUT_MISSING_PATHMissing API path10
HSX_E_INPUT_MISSING_ACCOUNT_IDMissing account id10
HSX_E_INPUT_MISSING_PROJECT_IDMissing project id10
HSX_E_INPUT_INVALID_DEPLOY_PLANInvalid deploy plan input10
HSX_E_INPUT_MISSING_PAKMissing HubSpot PAK10
HSX_E_INPUT_MISSING_CONNECT_FLAGSMissing connect flags10
HSX_E_INPUT_MISSING_API_TOKENMissing Cloudflare API token10
HSX_E_INPUT_NO_HSX_ACCOUNTNo HS-X account exists10
HSX_E_INPUT_BAD_FIELDCannot parse field10
HSX_E_INPUT_BAD_JSONTyped field is not valid JSON10
HSX_E_INPUT_BAD_NAMEInvalid project name10
HSX_E_INIT_DIR_NOT_EMPTYProject directory already exists10
HSX_E_MIGRATE_NOTHING_PORTABLENothing portable to migrate1
HSX_E_CUTOVER_EXECUTE_GATEDCutover execution is human-gated1
HSX_E_DEPLOY_SCHEMA_SCOPESHubSpot token is missing a property-write scope10
HSX_E_DEPLOY_SCHEMA_APPLYPortal schema apply failed1
HSX_E_DEPLOY_HUBSPOT_BUILD_COMPONENTHubSpot build component failed1
HSX_E_LINK_NOT_MEMBERNot a member of the target account1
HSX_E_CUTOVER_EXECUTE_FAILEDCutover execution failed — rolled back1
HSX_E_DEV_NO_WORKERSNo worker modules found1
HSX_E_DEV_UNKNOWN_CAPABILITYUnknown capability id1
HSX_E_DEV_NO_LAST_INVOCATIONNothing to replay1
HSX_E_DEV_WORKER_LOAD_FAILEDWorker module failed to load1
HSX_E_DEV_PORT_IN_USEDev server port already in use1
HSX_E_ACCOUNT_NOT_FOUNDHS-X account not found10
HSX_E_API_NO_CONTROL_PLANENo HS-X control plane configured10
HSX_E_API_NO_HUBSPOT_AUTHNo HubSpot API credential10
HSX_E_API_UNAUTHORIZEDAPI rejected your credentials10
HSX_E_API_NOT_FOUNDAPI resource not found50
HSX_E_API_CONFLICTAPI conflict50
HSX_E_API_RATE_LIMITEDRate limited50
HSX_E_API_BAD_REQUESTBad request to the API50
HSX_E_API_SERVERUpstream server error51
HSX_E_API_NETWORKNetwork error40
HSX_E_API_UNEXPECTEDUnexpected API response50
HSX_E_NOT_LOGGED_INNo HS-X session on this machine10
HSX_E_SESSION_EXPIREDHS-X session expired10
HSX_E_HUBSPOT_PAK_INVALIDHubSpot PAK rejected10
HSX_E_HUBSPOT_PAK_EXCHANGEHubSpot PAK exchange failed10
HSX_E_DEV_SESSION_NO_HUBSPOT_ACCOUNTHubSpot account not in CLI config10
HSX_E_DEV_SESSION_NO_NODESNo matching nodes in project IR10
HSX_E_DEV_SESSION_REGISTERDev session register failed50
HSX_E_CLOUDFLARED_MISSINGcloudflared binary missing50
HSX_E_CLOUDFLARED_SPAWNcloudflared spawn failed50
HSX_E_CLOUDFLARED_EXITEDcloudflared exited before reporting a tunnel URL50
HSX_E_CLOUDFLARED_TIMEOUTcloudflared did not report a tunnel URL in time50
HSX_E_CLOUDFLARE_OAUTH_NOT_CONFIGUREDCloudflare OAuth not configured10
HSX_E_CLOUDFLARE_OAUTH_LISTENEROAuth callback listener failed10
HSX_E_CLOUDFLARE_OAUTH_TIMEOUTOAuth callback timed out10
HSX_E_CLOUDFLARE_OAUTH_AUTHORIZECloudflare denied authorization10
HSX_E_CLOUDFLARE_OAUTH_STATE_MISMATCHOAuth state mismatch10
HSX_E_CLOUDFLARE_OAUTH_EXCHANGEOAuth token exchange failed10
HSX_E_CLOUDFLARE_OAUTH_REFRESHOAuth refresh failed10
HSX_E_CLOUDFLARE_TOKEN_INVALIDCloudflare token rejected10
HSX_E_CLOUDFLARE_TOKEN_VERIFYCloudflare token verify failed10
HSX_E_CLOUDFLARE_TOKEN_PERMISSIONSCloudflare token is missing required permissions10
HSX_E_LINK_REQUIREDCommand requires a linked HS-X account10
HSX_E_LINK_NO_POINTERProject has no Cloudflare pointer yet10
HSX_E_LINK_NOT_CLAIMABLEProject owner is already attached to a different HS-X account10
HSX_E_UPDATE_INSTALL_FAILEDSelf-update install failed1
HSX_E_INTERNALInternal error1
HSX_E_INPUT_INVALIDInvalid input10
HSX_E_LOGS_UNAVAILABLELogs unavailable1

Codes are stable identifiers: scripts and agents can match on them (hs-x <command> --json reports failures as { "code": "HSX_E_…", "docs_url": "…" }). New codes appear here with the release that introduces them. See the CLI reference for the commands themselves.