@hubspot/cli 8.18.0 → 8.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/commands/account/auth.js +2 -2
  2. package/commands/account/createOverride.js +2 -0
  3. package/commands/account/removeOverride.js +2 -0
  4. package/commands/app/secret/add.js +1 -1
  5. package/commands/app/secret/delete.js +1 -1
  6. package/commands/app/secret/list.js +1 -1
  7. package/commands/app/secret/update.js +1 -1
  8. package/commands/app/secret.js +1 -1
  9. package/commands/auth.js +3 -2
  10. package/commands/cms/function/create.js +5 -37
  11. package/commands/cms/function/deploy.js +8 -1
  12. package/commands/cms/function/list.js +4 -0
  13. package/commands/cms/function/logs.js +2 -0
  14. package/commands/cms/function/server.js +6 -0
  15. package/commands/cms/upload.js +6 -0
  16. package/commands/cms/watch.js +2 -0
  17. package/commands/cms/webpack/create.js +5 -32
  18. package/commands/customObject.js +2 -2
  19. package/commands/getStarted.js +4 -4
  20. package/commands/hubdb/list.js +2 -2
  21. package/commands/init.js +3 -2
  22. package/commands/mcp/setup.js +3 -2
  23. package/commands/project/dev/index.js +2 -2
  24. package/commands/project/logs.js +2 -2
  25. package/commands/project/upload.js +6 -2
  26. package/commands/project/watch.js +2 -2
  27. package/commands/sandbox/create.js +3 -3
  28. package/commands/sandbox/delete.js +1 -1
  29. package/commands/sandbox.js +1 -1
  30. package/lang/en.d.ts +26 -0
  31. package/lang/en.js +85 -43
  32. package/lib/accountAuth.js +12 -0
  33. package/lib/app/logSystemTypes.d.ts +4 -0
  34. package/lib/app/logSystemTypes.js +17 -0
  35. package/lib/app/logs.d.ts +2 -4
  36. package/lib/app/logs.js +2 -17
  37. package/lib/app/migrate.js +3 -3
  38. package/lib/constants.d.ts +2 -0
  39. package/lib/constants.js +4 -0
  40. package/lib/crossPlatformSpawn/escape.d.ts +2 -0
  41. package/lib/crossPlatformSpawn/escape.js +38 -0
  42. package/lib/crossPlatformSpawn/index.d.ts +7 -0
  43. package/lib/crossPlatformSpawn/index.js +43 -0
  44. package/lib/crossPlatformSpawn/resolveCommand.d.ts +1 -0
  45. package/lib/crossPlatformSpawn/resolveCommand.js +69 -0
  46. package/lib/errorHandlers/suppressError.js +3 -3
  47. package/lib/hints/hints.d.ts +9 -0
  48. package/lib/hints/hints.js +30 -0
  49. package/lib/hints/throttle.d.ts +4 -0
  50. package/lib/hints/throttle.js +9 -0
  51. package/lib/jsonOutput/projectUpload.d.ts +1 -0
  52. package/lib/jsonOutput/projectUpload.js +1 -0
  53. package/lib/mcp/promotion.js +15 -30
  54. package/lib/mcp/setup.d.ts +6 -1
  55. package/lib/mcp/setup.js +1 -1
  56. package/lib/middleware/deprecationWarningMiddleware.js +4 -9
  57. package/lib/projects/localDev/AppDevModeInterface.js +3 -3
  58. package/lib/projects/localDev/LocalDevLogger.js +5 -5
  59. package/lib/projects/localDev/helpers/project.js +3 -3
  60. package/lib/projects/pollProjectBuildAndDeploy.js +4 -4
  61. package/lib/projects/projectInfo.js +4 -4
  62. package/lib/projects/projectProfiles.js +3 -3
  63. package/lib/projects/ui.js +3 -3
  64. package/lib/projects/upload.d.ts +3 -1
  65. package/lib/projects/upload.js +23 -6
  66. package/lib/projects/watch.js +4 -2
  67. package/lib/projects/workspaces.js +4 -4
  68. package/lib/prompts/personalAccessKeyPrompt.js +2 -2
  69. package/lib/prompts/selectPublicAppForMigrationPrompt.js +3 -3
  70. package/lib/serverlessSunset.d.ts +6 -0
  71. package/lib/serverlessSunset.js +32 -0
  72. package/lib/ui/appLogs.js +4 -4
  73. package/lib/ui/formatting.d.ts +13 -0
  74. package/lib/ui/formatting.js +39 -0
  75. package/lib/ui/git.js +3 -3
  76. package/lib/ui/index.d.ts +9 -23
  77. package/lib/ui/index.js +36 -69
  78. package/lib/ui/logger.d.ts +1 -0
  79. package/lib/ui/logger.js +2 -1
  80. package/lib/ui/uiMessages.js +1 -1
  81. package/mcp-server/server.js +13 -5
  82. package/mcp-server/tools/cms/HsFunctionLogsTool.js +2 -2
  83. package/mcp-server/tools/cms/HsListFunctionsTool.js +1 -1
  84. package/mcp-server/tools/cms/HsListTool.js +4 -1
  85. package/mcp-server/tools/index.js +0 -2
  86. package/mcp-server/utils/command.js +16 -5
  87. package/package.json +9 -9
  88. package/mcp-server/tools/cms/HsCreateFunctionTool.d.ts +0 -26
  89. package/mcp-server/tools/cms/HsCreateFunctionTool.js +0 -100
package/lang/en.d.ts CHANGED
@@ -122,6 +122,7 @@ export declare const commands: {
122
122
  };
123
123
  errors: {
124
124
  invalidAccountIdProvided: string;
125
+ accountNameContainsSpaces: (accountName: string, suggestedName?: string) => string;
125
126
  failedToUpdateConfig: string;
126
127
  migrationNotConfirmed: string;
127
128
  mergeNotConfirmed: string;
@@ -278,6 +279,9 @@ export declare const commands: {
278
279
  };
279
280
  removeOverride: {
280
281
  describe: (overrideFile: string) => string;
282
+ logs: {
283
+ deprecated: string;
284
+ };
281
285
  accountOverride: (overrideFilePath: string, accountOverride: string) => string;
282
286
  prompts: {
283
287
  deleteOverrideFile: string;
@@ -341,6 +345,9 @@ export declare const commands: {
341
345
  };
342
346
  createOverride: {
343
347
  describe: (hsAccountFileName: string) => string;
348
+ logs: {
349
+ deprecated: string;
350
+ };
344
351
  success: (overrideFilePath: string) => string;
345
352
  accountOverride: (overrideFilePath: string, accountOverride: string) => string;
346
353
  prompts: {
@@ -366,6 +373,9 @@ export declare const commands: {
366
373
  auth: {
367
374
  describe: string;
368
375
  verboseDescribe: (configName: string, authMethod: string) => string;
376
+ logs: {
377
+ deprecated: string;
378
+ };
369
379
  errors: {
370
380
  invalidAccountIdProvided: string;
371
381
  globalConfigFileExists: (accountAuthCommand: string) => string;
@@ -1305,6 +1315,7 @@ export declare const commands: {
1305
1315
  configFileUpdated: (authType: string, account: string | number) => string;
1306
1316
  };
1307
1317
  logs: {
1318
+ deprecated: string;
1308
1319
  updateConfig: string;
1309
1320
  };
1310
1321
  errors: {
@@ -3426,6 +3437,12 @@ export declare const lib: {
3426
3437
  process: {
3427
3438
  exitDebug: (signal: string) => string;
3428
3439
  };
3440
+ hubSpotCommand: {
3441
+ argStartsWithDash: (arg: string) => string;
3442
+ };
3443
+ crossPlatformSpawn: {
3444
+ unsafeArg: (arg: string) => string;
3445
+ };
3429
3446
  handlerLogFile: {
3430
3447
  saved: (filePath: string) => string;
3431
3448
  };
@@ -3615,6 +3632,13 @@ export declare const lib: {
3615
3632
  declineDefaultAccountExplanation: string;
3616
3633
  };
3617
3634
  };
3635
+ serverlessSunset: {
3636
+ deprecationNotice: (command: string) => string;
3637
+ creationBlocked: (command: string) => string;
3638
+ editingDisabled: (command: string) => string;
3639
+ uploadEditingBlockedHint: string;
3640
+ uploadBlockedHint: string;
3641
+ };
3618
3642
  middleware: {
3619
3643
  updateNotification: {
3620
3644
  notifyTitle: string;
@@ -3711,6 +3735,7 @@ export declare const lib: {
3711
3735
  warning: (files: string[]) => string;
3712
3736
  uploadWarning: (files: string[]) => string;
3713
3737
  prompt: string;
3738
+ jsonRequiresForce: (files: string[]) => string;
3714
3739
  };
3715
3740
  components: {
3716
3741
  unableToGetUidFromHsmeta: string;
@@ -3752,6 +3777,7 @@ export declare const lib: {
3752
3777
  };
3753
3778
  handleProjectUpload: {
3754
3779
  emptySource: (srcDir: string) => string;
3780
+ noFilesToUpload: (srcDir: string) => string;
3755
3781
  compressed: (byteCount: number) => string;
3756
3782
  compressing: (path: string) => string;
3757
3783
  fileFiltered: (filename: string) => string;
package/lang/en.js CHANGED
@@ -2,13 +2,27 @@ import chalk from 'chalk';
2
2
  import { mapToUserFriendlyName } from '@hubspot/project-parsing-lib/transform';
3
3
  import { PLATFORM_VERSIONS } from '@hubspot/project-parsing-lib/constants';
4
4
  import { PERSONAL_ACCESS_KEY_AUTH_METHOD } from '@hubspot/local-dev-lib/constants/auth';
5
- import { APP_AUTH_TYPES, APP_DISTRIBUTION_TYPES, CLI_SUPPORT_GUIDELINES_URL, FEEDBACK_SOURCE_ENV_VAR, LEGACY_PUBLIC_APP_FILE, LOCAL_DEV_DEFAULT_PORT, MAX_FEEDBACK_LENGTH, PROJECT_CONFIG_FILE, PROJECT_WITH_APP, } from '../lib/constants.js';
5
+ import { APP_AUTH_TYPES, APP_DISTRIBUTION_TYPES, CLI_SUPPORT_GUIDELINES_URL, FEEDBACK_SOURCE_ENV_VAR, LEGACY_PUBLIC_APP_FILE, LOCAL_DEV_DEFAULT_PORT, MAX_FEEDBACK_LENGTH, PROJECT_CONFIG_FILE, PROJECT_WITH_APP, SERVERLESS_SUNSET_CHANGELOG_URL, } from '../lib/constants.js';
6
6
  import { ARCHIVED_HUBSPOT_CONFIG_YAML_FILE_NAME, DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME, GLOBAL_CONFIG_PATH, } from '@hubspot/local-dev-lib/constants/config';
7
7
  import { indent, UI_COLORS, uiAccountDescription, uiAuthCommandReference, uiBetaTag, uiCommandReference, uiDeprecatedTag, uiLink, } from '../lib/ui/index.js';
8
8
  import { getLocalDevUiUrl, getProjectDetailUrl, getProjectSettingsUrl, } from '../lib/projects/urls.js';
9
9
  import { getProductUpdatesUrl } from '../lib/links.js';
10
10
  const AGENT_HELP_EXIT_CODES = '0 means success. 1 means an error. 2 means a warning, for example a validation issue or JSON output that does not match its schema.';
11
11
  const MIGRATION_SUPPORT_CUTOFF_NOTICE = 'Automated platform version migrations beyond 2026.09 will not be supported.';
12
+ const SERVERLESS_SUNSET_NOTICE = 'CMS serverless functions are being sunset. Creating them has ended, editing ends on November 17, 2026, and existing functions stop running on February 1, 2027.';
13
+ const SERVERLESS_CREATION_BLOCKED_NOTICE = 'Serverless functions can no longer be created in the Design Manager. Build new serverless functions in Developer Projects instead.';
14
+ const SERVERLESS_CREATION_ENDED_NOTICE = 'Creating serverless functions has ended.';
15
+ const SERVERLESS_CHANGELOG_LINK_TEXT = 'Read more on the announcement and how to migrate your serverless functions to Developer Projects in the Developer Changelog.';
16
+ const LEGACY_CONFIG_REPLACEMENTS = [
17
+ ['hs account auth', 'Create the global config file and add accounts'],
18
+ ['hs account link', 'Link accounts to a project directory'],
19
+ ['hs config migrate', 'Migrate your existing config'],
20
+ ];
21
+ function getLegacyConfigDeprecationMessage(command) {
22
+ const columnWidth = Math.max(...LEGACY_CONFIG_REPLACEMENTS.map(([name]) => name.length)) + 3;
23
+ const replacements = LEGACY_CONFIG_REPLACEMENTS.map(([name, description]) => `${indent(1)}${uiCommandReference(name, false)}${' '.repeat(columnWidth - name.length)}${description}`);
24
+ return `${uiCommandReference(command)} is being replaced as we move to global config.\n\n${replacements.join('\n')}`;
25
+ }
12
26
  export const commands = {
13
27
  generalErrors: {
14
28
  srcIsProject: (src, command) => `"${src}" is in a project folder. Did you mean "hs project ${command}"?`,
@@ -126,11 +140,14 @@ export const commands = {
126
140
  account: 'HubSpot account to authenticate',
127
141
  personalAccessKey: 'Enter existing personal access key',
128
142
  default: 'Set the authenticated account as the default account',
129
- name: 'Set a name for the account in the CLI config',
143
+ name: 'Set a name for the account in the CLI config (cannot contain spaces)',
130
144
  useDefaultName: 'Use the account name derived from the HubSpot portal name',
131
145
  },
132
146
  errors: {
133
147
  invalidAccountIdProvided: `--account must be a number.`,
148
+ accountNameContainsSpaces: (accountName, suggestedName) => suggestedName
149
+ ? `The account name "${accountName}" cannot contain spaces. Try ${uiCommandReference(`--name ${suggestedName}`)}.`
150
+ : `The account name "${accountName}" cannot contain spaces. Provide a name without spaces.`,
134
151
  failedToUpdateConfig: 'Failed to update the configuration file. Please try again.',
135
152
  migrationNotConfirmed: `Did not migrate your configuration file. Run ${uiAuthCommandReference()} to update your existing config, or use ${uiCommandReference('hs config migrate')} to switch to the new global configuration.`,
136
153
  mergeNotConfirmed: `Did not merge configuration files. When you are ready to merge the deprecated config file with the global config file, run ${uiCommandReference('hs config migrate')}.`,
@@ -286,7 +303,10 @@ export const commands = {
286
303
  },
287
304
  },
288
305
  removeOverride: {
289
- describe: (overrideFile) => `Remove the default account override file (${overrideFile}) from the current working directory.`,
306
+ describe: (overrideFile) => uiDeprecatedTag(`Remove the default account override file (${overrideFile}) from the current working directory. Replaced by ${uiCommandReference('hs account unlink')}.`),
307
+ logs: {
308
+ deprecated: `${uiCommandReference('hs account remove-override')} is being replaced by ${uiCommandReference('hs account unlink')}.\nUse ${uiCommandReference('hs account unlink')} to unlink accounts from a project directory.`,
309
+ },
290
310
  accountOverride: (overrideFilePath, accountOverride) => `There is an account override file at ${overrideFilePath} associated with account "${accountOverride}".`,
291
311
  prompts: {
292
312
  deleteOverrideFile: 'Delete account override file?',
@@ -349,7 +369,10 @@ export const commands = {
349
369
  defaultAccountOverride: (overrideFilePath) => `\n(This will also delete the default account override file at ${overrideFilePath})`,
350
370
  },
351
371
  createOverride: {
352
- describe: (hsAccountFileName) => `Create a new default account override file (${hsAccountFileName}) in the current working directory.`,
372
+ describe: (hsAccountFileName) => uiDeprecatedTag(`Create a new default account override file (${hsAccountFileName}) in the current working directory. Replaced by ${uiCommandReference('hs account link')}.`),
373
+ logs: {
374
+ deprecated: `${uiCommandReference('hs account create-override')} is being replaced by ${uiCommandReference('hs account link')}.\nUse ${uiCommandReference('hs account link')} to link accounts to a project directory.`,
375
+ },
353
376
  success: (overrideFilePath) => `Default account override file created at ${overrideFilePath}`,
354
377
  accountOverride: (overrideFilePath, accountOverride) => `An account override file already exists at ${overrideFilePath} associated with account "${accountOverride}".`,
355
378
  prompts: {
@@ -373,8 +396,11 @@ export const commands = {
373
396
  },
374
397
  },
375
398
  auth: {
376
- describe: 'Configure authentication for your HubSpot account.',
377
- verboseDescribe: (configName, authMethod) => `Configure authentication for a HubSpot account. This will update the ${configName} file that stores your account information.\n\nThe recommended authentication method is ${chalk.bold(authMethod)}, which uses an access token tied to a specific user account.`,
399
+ describe: uiDeprecatedTag(`Configure authentication for your HubSpot account. Replaced by ${uiCommandReference('hs account auth')}.`),
400
+ verboseDescribe: (configName, authMethod) => uiDeprecatedTag(`Configure authentication for a HubSpot account. This will update the ${configName} file that stores your account information.\n\nThe recommended authentication method is ${chalk.bold(authMethod)}, which uses an access token tied to a specific user account.\n\nThis command is deprecated because we are moving to global config, and the legacy config format will be replaced. Use ${uiCommandReference('hs account auth')} to create the global config file and add accounts to it, and ${uiCommandReference('hs account link')} to link accounts to a project directory. Run ${uiCommandReference('hs config migrate')} to migrate your existing config.`),
401
+ logs: {
402
+ deprecated: getLegacyConfigDeprecationMessage('hs auth'),
403
+ },
378
404
  errors: {
379
405
  invalidAccountIdProvided: `--account must be a number.`,
380
406
  globalConfigFileExists: (accountAuthCommand) => `You are using our new global configuration for account management, which is not compatible with this command. Please use ${uiCommandReference(accountAuthCommand)} instead.`,
@@ -467,15 +493,15 @@ export const commands = {
467
493
  },
468
494
  },
469
495
  webpack: {
470
- describe: 'Commands for managing webpack.',
496
+ describe: uiDeprecatedTag('Commands for managing webpack.'),
471
497
  subcommands: {
472
498
  create: {
473
- describe: 'Create a new webpack bundle.',
499
+ describe: uiDeprecatedTag(`Create a new webpack bundle. ${SERVERLESS_CREATION_ENDED_NOTICE}`),
474
500
  errors: {
475
501
  unusablePath: (path) => `The "${path}" is not a usable path to a directory.`,
476
502
  },
477
503
  positionals: {
478
- dest: 'Destination folder for the new webpack bundle.',
504
+ dest: uiDeprecatedTag('Destination folder for the new webpack bundle.'),
479
505
  },
480
506
  },
481
507
  },
@@ -790,26 +816,26 @@ export const commands = {
790
816
  },
791
817
  },
792
818
  function: {
793
- describe: 'Commands for managing CMS serverless functions.',
819
+ describe: uiDeprecatedTag(`Commands for managing CMS serverless functions. ${SERVERLESS_SUNSET_NOTICE}`),
794
820
  subcommands: {
795
821
  create: {
796
- describe: 'Create a new CMS serverless function.',
822
+ describe: uiDeprecatedTag(`Create a new CMS serverless function. ${SERVERLESS_CREATION_ENDED_NOTICE}`),
797
823
  errors: {
798
824
  unusablePath: (path) => `The "${path}" is not a usable path to a directory.`,
799
825
  },
800
826
  positionals: {
801
- name: 'Name of the function',
802
- dest: 'Destination folder for the function',
827
+ name: uiDeprecatedTag('Name of the function'),
828
+ dest: uiDeprecatedTag('Destination folder for the function'),
803
829
  },
804
830
  options: {
805
- functionsFolder: 'Folder to create functions in',
806
- filename: 'Filename for the function',
807
- endpointMethod: 'HTTP method for the function endpoint',
808
- endpointPath: 'API endpoint path for the function',
831
+ functionsFolder: uiDeprecatedTag('Folder to create functions in'),
832
+ filename: uiDeprecatedTag('Filename for the function'),
833
+ endpointMethod: uiDeprecatedTag('HTTP method for the function endpoint'),
834
+ endpointPath: uiDeprecatedTag('API endpoint path for the function'),
809
835
  },
810
836
  },
811
837
  logs: {
812
- describe: 'View logs for a CMS serverless function.',
838
+ describe: uiDeprecatedTag('View logs for a CMS serverless function.'),
813
839
  errors: {
814
840
  noLogsFound: (functionPath, accountId) => `No logs were found for the function path "${functionPath}" in account "${accountId}".`,
815
841
  },
@@ -822,21 +848,21 @@ export const commands = {
822
848
  gettingLogs: (latest, functionPath) => `Getting ${latest ? 'latest ' : ''}logs for function with path: ${functionPath}.`,
823
849
  options: {
824
850
  compact: {
825
- describe: 'output compact logs',
851
+ describe: uiDeprecatedTag('output compact logs'),
826
852
  },
827
853
  follow: {
828
- describe: 'follow logs',
854
+ describe: uiDeprecatedTag('follow logs'),
829
855
  },
830
856
  latest: {
831
- describe: 'retrieve most recent log only',
857
+ describe: uiDeprecatedTag('retrieve most recent log only'),
832
858
  },
833
859
  limit: {
834
- describe: 'limit the number of logs to output',
860
+ describe: uiDeprecatedTag('limit the number of logs to output'),
835
861
  },
836
862
  },
837
863
  positionals: {
838
864
  endpoint: {
839
- describe: 'Serverless function endpoint',
865
+ describe: uiDeprecatedTag('Serverless function endpoint'),
840
866
  },
841
867
  },
842
868
  tailLogs: (functionPath, accountId) => `Waiting for log entries for "${functionPath}" on account "${accountId}".\n`,
@@ -857,7 +883,7 @@ export const commands = {
857
883
  loadingFailed: (functionPath, account) => `Failed to build and deploy bundle for "${functionPath}" on ${account}`,
858
884
  positionals: {
859
885
  path: {
860
- describe: 'Path to the ".functions" folder',
886
+ describe: uiDeprecatedTag('Path to the ".functions" folder'),
861
887
  },
862
888
  },
863
889
  success: {
@@ -868,13 +894,13 @@ export const commands = {
868
894
  debug: {
869
895
  gettingFunctions: 'Getting currently deployed functions',
870
896
  },
871
- describe: 'List the currently deployed CMS serverless functions.',
897
+ describe: uiDeprecatedTag('List the currently deployed CMS serverless functions.'),
872
898
  info: {
873
899
  noFunctions: 'No functions found',
874
900
  },
875
901
  options: {
876
902
  json: {
877
- describe: 'output raw json data',
903
+ describe: uiDeprecatedTag('output raw json data'),
878
904
  },
879
905
  },
880
906
  },
@@ -887,21 +913,21 @@ export const commands = {
887
913
  },
888
914
  options: {
889
915
  contact: {
890
- describe: 'Pass contact data to the test function',
916
+ describe: uiDeprecatedTag('Pass contact data to the test function'),
891
917
  },
892
918
  logOutput: {
893
- describe: 'Output the response body from the serverless function execution (It is suggested not to use this in production environments as it can reveal any secure data returned by the function in logs)',
919
+ describe: uiDeprecatedTag('Output the response body from the serverless function execution (It is suggested not to use this in production environments as it can reveal any secure data returned by the function in logs)'),
894
920
  },
895
921
  port: {
896
- describe: 'Port to run the test server on',
922
+ describe: uiDeprecatedTag('Port to run the test server on'),
897
923
  },
898
924
  watch: {
899
- describe: 'Watch the specified .functions folder for changes and restart the server',
925
+ describe: uiDeprecatedTag('Watch the specified .functions folder for changes and restart the server'),
900
926
  },
901
927
  },
902
928
  positionals: {
903
929
  path: {
904
- describe: 'Path to local .functions folder',
930
+ describe: uiDeprecatedTag('Path to local .functions folder'),
905
931
  },
906
932
  },
907
933
  },
@@ -1297,8 +1323,8 @@ export const commands = {
1297
1323
  },
1298
1324
  },
1299
1325
  init: {
1300
- describe: 'Create a CLI config file and configure authentication for your HubSpot account.',
1301
- verboseDescribe: (configName, command, authMethod) => `Configure authentication for a HubSpot account. This will create a ${configName} file to store your account information. To configure authentication for additional accounts, run ${command}.\n\nThe recommended authentication method is ${chalk.bold(authMethod)}, which uses an access token tied to a specific user account.`,
1326
+ describe: uiDeprecatedTag(`Create a CLI config file and configure authentication for your HubSpot account. Replaced by ${uiCommandReference('hs account auth')}.`),
1327
+ verboseDescribe: (configName, command, authMethod) => uiDeprecatedTag(`Configure authentication for a HubSpot account. This will create a ${configName} file to store your account information. To configure authentication for additional accounts, run ${command}.\n\nThe recommended authentication method is ${chalk.bold(authMethod)}, which uses an access token tied to a specific user account.\n\nThis command is deprecated because we are moving to global config, and the legacy config format will be replaced. Use ${uiCommandReference('hs account auth')} to create the global config file and add accounts to it, and ${uiCommandReference('hs account link')} to link accounts to a project directory. Run ${uiCommandReference('hs config migrate')} to migrate your existing config.`),
1302
1328
  options: {
1303
1329
  authType: {
1304
1330
  describe: 'Authentication mechanism',
@@ -1316,6 +1342,7 @@ export const commands = {
1316
1342
  configFileUpdated: (authType, account) => `Connected account "${account}" using "${authType}" and set it as the default account`,
1317
1343
  },
1318
1344
  logs: {
1345
+ deprecated: getLegacyConfigDeprecationMessage('hs init'),
1319
1346
  updateConfig: `To update an existing config file, use the ${uiAuthCommandReference()} command.`,
1320
1347
  },
1321
1348
  errors: {
@@ -1623,8 +1650,8 @@ export const commands = {
1623
1650
  },
1624
1651
  },
1625
1652
  migrateApp: {
1626
- describe: uiDeprecatedTag(`Migrate a public app to the projects framework. ${MIGRATION_SUPPORT_CUTOFF_NOTICE}`, false),
1627
- verboseDescribe: uiDeprecatedTag(`Migrate a public app to the projects framework. This command walks you through the fields required to complete the migration and downloads the project source code into a directory of your choosing.\n\n${chalk.bold.yellow(MIGRATION_SUPPORT_CUTOFF_NOTICE)}`, false),
1653
+ describe: uiDeprecatedTag(`Migrate a public app to the projects framework. ${MIGRATION_SUPPORT_CUTOFF_NOTICE}`),
1654
+ verboseDescribe: uiDeprecatedTag(`Migrate a public app to the projects framework. This command walks you through the fields required to complete the migration and downloads the project source code into a directory of your choosing.\n\n${chalk.bold.yellow(MIGRATION_SUPPORT_CUTOFF_NOTICE)}`),
1628
1655
  examples: {
1629
1656
  default: 'Migrate a public app to the projects framework',
1630
1657
  },
@@ -1668,8 +1695,8 @@ export const commands = {
1668
1695
  },
1669
1696
  migrate: {
1670
1697
  preamble: (platformVersion) => `This command will migrate an existing project to platformVersion ${platformVersion}. It will walk you through the fields required to complete the migration and download the new project source code into the project source directory. It will also copy all of your existing files to a new directory (archive) in case you need access to your old files later.`,
1671
- describe: uiDeprecatedTag(`Migrate an existing project to the new version of the projects framework. ${MIGRATION_SUPPORT_CUTOFF_NOTICE}`, false),
1672
- verboseDescribe: uiDeprecatedTag(`Migrate an existing project to a newer platform version. This command walks you through the fields required to complete the migration and downloads the new project source code into the project source directory. Your existing files are copied to a new directory (archive) in case you need access to them later.\n\n${chalk.bold.yellow(MIGRATION_SUPPORT_CUTOFF_NOTICE)}`, false),
1698
+ describe: uiDeprecatedTag(`Migrate an existing project to the new version of the projects framework. ${MIGRATION_SUPPORT_CUTOFF_NOTICE}`),
1699
+ verboseDescribe: uiDeprecatedTag(`Migrate an existing project to a newer platform version. This command walks you through the fields required to complete the migration and downloads the new project source code into the project source directory. Your existing files are copied to a new directory (archive) in case you need access to them later.\n\n${chalk.bold.yellow(MIGRATION_SUPPORT_CUTOFF_NOTICE)}`),
1673
1700
  errors: {
1674
1701
  noProjectConfig: (command) => `No project detected. Please run this command again from a project directory. If you are trying to migrate an app, run ${command}`,
1675
1702
  },
@@ -1852,7 +1879,7 @@ export const commands = {
1852
1879
  uploadPrompt: (projectName) => `No successful builds for project ${chalk.bold(projectName)}. Would you like to upload it?`,
1853
1880
  errors: {
1854
1881
  targetRequired: `${uiCommandReference('--target=<portalId>')} is required to specify the portal to preview on.`,
1855
- previewFailed: 'The preview failed. You can try again or preview this build from the project UI.',
1882
+ previewFailed: 'The preview failed.',
1856
1883
  },
1857
1884
  options: {
1858
1885
  build: 'Build ID to preview. Defaults to the latest build.',
@@ -1967,7 +1994,7 @@ export const commands = {
1967
1994
  describe: 'Skip confirmation prompts and force the upload.',
1968
1995
  },
1969
1996
  forceCreate: {
1970
- describe: uiDeprecatedTag(`Automatically create project if it does not exist. Use ${uiCommandReference('--force')} instead.`, false),
1997
+ describe: uiDeprecatedTag(`Automatically create project if it does not exist. Use ${uiCommandReference('--force')} instead.`),
1971
1998
  },
1972
1999
  message: {
1973
2000
  describe: 'Add a message when you upload your project and create a build',
@@ -3462,6 +3489,12 @@ export const lib = {
3462
3489
  process: {
3463
3490
  exitDebug: (signal) => `Attempting to gracefully exit. Triggered by ${signal}`,
3464
3491
  },
3492
+ hubSpotCommand: {
3493
+ argStartsWithDash: (arg) => `Cannot pass ${JSON.stringify(arg)} as a positional argument because it starts with a dash and would be read as a flag. Remove the leading dash and try again.`,
3494
+ },
3495
+ crossPlatformSpawn: {
3496
+ unsafeArg: (arg) => `Cannot run this command on Windows because an argument contains a line break, contains one of these characters: " % ^ & | < >, or ends with two or more backslashes. Remove or rephrase them and try again. Argument: ${JSON.stringify(arg)}`,
3497
+ },
3465
3498
  handlerLogFile: {
3466
3499
  saved: (filePath) => `Debug logs can be viewed at ${filePath}`,
3467
3500
  },
@@ -3482,7 +3515,7 @@ export const lib = {
3482
3515
  'JSON output: Commands that support `--json` print one JSON object to stdout when they finish. Errors and warnings print to stderr.',
3483
3516
  'JSON schemas: To print the JSON Schema for the output of a command, run the command with `--json-schema`.',
3484
3517
  'Prompts: Commands prompt for values that you do not pass as flags. To run a command without prompts, pass each value as a flag.',
3485
- 'Long-running commands: `hs project dev` runs until it is stopped and prompts for input. Ask the user to run it in their own terminal.',
3518
+ 'Long-running commands: `hs project dev`, `hs project watch`, `hs cms watch`, and `hs cms theme preview` run until they are stopped and can prompt for input. Do not run them from your shell, even in the background. Ask the user to run them in a separate terminal window.',
3486
3519
  'Accounts: Commands use the default account in the CLI config. To use a different account, pass `--account <name or ID>`. To see the configured accounts, run `hs account list`.',
3487
3520
  'Environment variables: To read the account from `HUBSPOT_ACCOUNT_ID` and `HUBSPOT_PERSONAL_ACCESS_KEY` instead of the config file, pass `--use-env`.',
3488
3521
  'Config file: The global config file is `~/.hscli/config.yml`. To use a different file, pass `--config <path>`.',
@@ -3556,7 +3589,7 @@ export const lib = {
3556
3589
  },
3557
3590
  {
3558
3591
  command: 'hs project dev',
3559
- description: 'Ask the user to run this command in their own terminal. It starts local development and runs until it is stopped. Changes upload from the Local Dev Panel, or as you edit with `--auto-upload`. To test on a test account, also pass `--testing-account <test account ID>` and `--project-account <developer account ID>`.',
3592
+ description: 'Ask the user to run this command in a separate terminal window. It starts local development and runs until it is stopped. Changes upload from the Local Dev Panel, or as you edit with `--auto-upload`. To test on a test account, also pass `--testing-account <test account ID>` and `--project-account <developer account ID>`.',
3560
3593
  },
3561
3594
  {
3562
3595
  command: 'hs project list-builds --limit 1 --json',
@@ -3758,6 +3791,13 @@ export const lib = {
3758
3791
  declineDefaultAccountExplanation: `To develop on a different account, run ${uiCommandReference('hs account use')} to change your default account, then re-run ${uiCommandReference('hs project dev')}.`,
3759
3792
  },
3760
3793
  },
3794
+ serverlessSunset: {
3795
+ deprecationNotice: (command) => `The ${uiCommandReference(command)} command is deprecated. ${SERVERLESS_SUNSET_NOTICE} ${uiLink(SERVERLESS_CHANGELOG_LINK_TEXT, SERVERLESS_SUNSET_CHANGELOG_URL)}`,
3796
+ creationBlocked: (command) => `The ${uiCommandReference(command)} command is disabled. ${SERVERLESS_CREATION_BLOCKED_NOTICE} Existing functions can no longer be edited from November 17, 2026 and stop running on February 1, 2027. ${uiLink(SERVERLESS_CHANGELOG_LINK_TEXT, SERVERLESS_SUNSET_CHANGELOG_URL)}`,
3797
+ editingDisabled: (command) => `The ${uiCommandReference(command)} command is disabled. Serverless functions can no longer be created or edited in the Design Manager. Existing functions stop running on February 1, 2027. Build your serverless functions in Developer Projects instead. ${uiLink(SERVERLESS_CHANGELOG_LINK_TEXT, SERVERLESS_SUNSET_CHANGELOG_URL)}`,
3798
+ uploadEditingBlockedHint: `If this upload was rejected, it is because serverless functions can no longer be created or edited in the Design Manager. Build your serverless functions in Developer Projects instead. ${uiLink(SERVERLESS_CHANGELOG_LINK_TEXT, SERVERLESS_SUNSET_CHANGELOG_URL)}`,
3799
+ uploadBlockedHint: `If this upload was rejected, it is because serverless functions can no longer be created in the Design Manager, so new function folders can't be uploaded. Build new serverless functions in Developer Projects instead. ${uiLink(SERVERLESS_CHANGELOG_LINK_TEXT, SERVERLESS_SUNSET_CHANGELOG_URL)}`,
3800
+ },
3761
3801
  middleware: {
3762
3802
  updateNotification: {
3763
3803
  notifyTitle: chalk.bold('Update available'),
@@ -3854,6 +3894,7 @@ export const lib = {
3854
3894
  warning: (files) => `The following *-hsmeta.json files will be skipped.\nThis CLI version doesn't support the features they require:\n${files.map(f => ` ${chalk.bold(f)}`).join('\n')}\nRun ${uiCommandReference('hs upgrade')} to update the CLI, which may add support for these features.`,
3855
3895
  uploadWarning: (files) => `The following *-hsmeta.json files will be skipped during upload.\nThis CLI version doesn't support the features they require:\n${files.map(f => ` ${chalk.bold(f)}`).join('\n')}\nRun ${uiCommandReference('hs upgrade')} to update the CLI, which may add support for these features.`,
3856
3896
  prompt: '[--force] Continue anyway?',
3897
+ jsonRequiresForce: (files) => `The following *-hsmeta.json files would be skipped during upload:\n${files.map(f => ` ${chalk.bold(f)}`).join('\n')}\nRe-run with ${uiCommandReference('--force')} to upload anyway.`,
3857
3898
  },
3858
3899
  components: {
3859
3900
  unableToGetUidFromHsmeta: 'Unable to get UID from hsmeta',
@@ -3895,6 +3936,7 @@ export const lib = {
3895
3936
  },
3896
3937
  handleProjectUpload: {
3897
3938
  emptySource: (srcDir) => `Source directory "${srcDir}" is empty. Add files to your project and rerun ${uiCommandReference('hs project upload')} to upload them to HubSpot.`,
3939
+ noFilesToUpload: (srcDir) => `No files in source directory "${srcDir}" were included in the upload because every file was ignored. Rerun ${uiCommandReference('hs project upload --debug')} to see which files were ignored and why.`,
3898
3940
  compressed: (byteCount) => `Project files compressed: ${byteCount} bytes`,
3899
3941
  compressing: (path) => `Compressing build files to "${path}"`,
3900
3942
  fileFiltered: (filename) => `Ignore rule triggered for "${filename}"`,
@@ -3924,7 +3966,7 @@ export const lib = {
3924
3966
  succeeded: (releaseTag, targetPortalId) => `Previewed ${chalk.bold(releaseTag)} on ${uiAccountDescription(targetPortalId)}`,
3925
3967
  triggerFailed: 'Failed to trigger preview',
3926
3968
  pollFailed: 'Failed to poll preview status',
3927
- warning: 'The build succeeded but the preview failed. You can manually preview this build from the project UI.',
3969
+ warning: 'The build succeeded but the preview failed.',
3928
3970
  missingProjectId: 'Unable to preview: could not resolve the project ID.',
3929
3971
  },
3930
3972
  importData: {
@@ -4688,7 +4730,7 @@ export const lib = {
4688
4730
  legacyCrmCardMigrationDocs: () => `For more information on migrating legacy-crm-card components, follow ${uiLink('these docs', 'https://developers.hubspot.com/docs/apps/developer-platform/build-apps/migrate-an-app/migrate-legacy-crm-cards-to-app-cards')}`,
4689
4731
  sourceContentsMoved: (newLocation) => `The contents of your old source directory have been moved to ${newLocation}, move any required files to the new source directory.`,
4690
4732
  projectMigrationWarningTitle: (platformVersion) => `Important: Migrating to platformVersion ${platformVersion} is irreversible`,
4691
- projectMigrationWarning: (platformVersion) => uiBetaTag(`Running the ${uiCommandReference('hs project migrate')} command will permanently upgrade your project to platformVersion ${platformVersion}. This action cannot be undone. To ensure you have access to your original files, they will be copied to a new directory (archive) for safekeeping.\n\nThis command will guide you through the process, prompting you to enter the required fields and will download the new project source code into your project source directory.`, false),
4733
+ projectMigrationWarning: (platformVersion) => uiBetaTag(`Running the ${uiCommandReference('hs project migrate')} command will permanently upgrade your project to platformVersion ${platformVersion}. This action cannot be undone. To ensure you have access to your original files, they will be copied to a new directory (archive) for safekeeping.\n\nThis command will guide you through the process, prompting you to enter the required fields and will download the new project source code into your project source directory.`),
4692
4734
  exitWithoutMigrating: 'Exiting without migrating',
4693
4735
  success: {
4694
4736
  downloadedProject: (projectName, projectDest) => `Saved ${projectName} to ${projectDest}`,
@@ -10,6 +10,13 @@ import { setAsDefaultAccountPrompt } from './prompts/setAsDefaultAccountPrompt.j
10
10
  import { awaitPersonalAccessKeyOverWebsocket } from './auth/awaitPersonalAccessKeyOverWebsocket.js';
11
11
  import { commands } from '../lang/en.js';
12
12
  import { uiLogger } from './ui/logger.js';
13
+ const WHITESPACE_PATTERN = /\s/;
14
+ function getAccountNameError(accountName) {
15
+ if (!accountName || !WHITESPACE_PATTERN.test(accountName)) {
16
+ return undefined;
17
+ }
18
+ return commands.account.subcommands.auth.errors.accountNameContainsSpaces(accountName, toKebabCase(accountName) || undefined);
19
+ }
13
20
  async function getPersonalAccessKey(env, accountId) {
14
21
  if (process.env.BROWSER !== 'none') {
15
22
  try {
@@ -109,6 +116,11 @@ export function getCurrentDefaultAccount() {
109
116
  }
110
117
  }
111
118
  export async function authenticateNewAccount({ env, providedPersonalAccessKey, accountId, setAsDefaultAccount, accountName: providedAccountName, useDefaultAccountName, }) {
119
+ const accountNameError = getAccountNameError(providedAccountName);
120
+ if (accountNameError) {
121
+ uiLogger.error(accountNameError);
122
+ return null;
123
+ }
112
124
  const configMigrationSuccess = await handleConfigMigration();
113
125
  if (!configMigrationSuccess) {
114
126
  return null;
@@ -0,0 +1,4 @@
1
+ export declare const SYSTEM_TYPE_DISPLAY_NAMES: {
2
+ [key: string]: string;
3
+ };
4
+ export declare function toTypeChoice(systemType: string): string;
@@ -0,0 +1,17 @@
1
+ export const SYSTEM_TYPE_DISPLAY_NAMES = {
2
+ WEBHOOKS: 'Webhooks',
3
+ API_CALL: 'API Call',
4
+ SERVERLESS_EXECUTION: 'Serverless Function',
5
+ CRM_EXTENSIBILITY_CARD: 'CRM Card',
6
+ CRM_LEGACY_CARD: 'CRM Legacy Card',
7
+ EXTENSION_LOG: 'Extension Log',
8
+ EXTENSION_RENDER: 'Extension Render',
9
+ APP_SETTINGS: 'App Settings',
10
+ PROXY_EXECUTION: 'Proxy Execution',
11
+ SERVERLESS_GATEWAY_EXECUTION: 'Serverless Gateway Execution',
12
+ ACCEPTANCE_TEST: 'Acceptance Test',
13
+ OAUTH_AUTHORIZATION: 'OAuth Authorization',
14
+ };
15
+ export function toTypeChoice(systemType) {
16
+ return systemType.toLowerCase().replaceAll('_', '-');
17
+ }
package/lib/app/logs.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { AppLogEntry as ApiAppLogEntry, SystemType } from '@hubspot/local-dev-lib/types/AppLogs';
2
- export declare const SYSTEM_TYPE_DISPLAY_NAMES: {
3
- [key: string]: string;
4
- };
2
+ import { SYSTEM_TYPE_DISPLAY_NAMES, toTypeChoice } from './logSystemTypes.js';
3
+ export { SYSTEM_TYPE_DISPLAY_NAMES, toTypeChoice };
5
4
  export declare const SYSTEM_TYPE_CHOICES: string[];
6
5
  export declare function parseSinceTime(sinceInput: string): {
7
6
  startTime: number;
@@ -24,7 +23,6 @@ export type AppLogsOptions = {
24
23
  limit?: number;
25
24
  errorsOnly?: boolean;
26
25
  };
27
- export declare function toTypeChoice(systemType: string): string;
28
26
  export declare function toSystemType(choice: string): string;
29
27
  export declare function getTypeChoices(): {
30
28
  name: string;
package/lib/app/logs.js CHANGED
@@ -5,20 +5,8 @@ import { uiLogger } from '../ui/logger.js';
5
5
  import SpinniesManager from '../ui/SpinniesManager.js';
6
6
  import { handleExit, handleKeypress } from '../process.js';
7
7
  import { commands } from '../../lang/en.js';
8
- export const SYSTEM_TYPE_DISPLAY_NAMES = {
9
- WEBHOOKS: 'Webhooks',
10
- API_CALL: 'API Call',
11
- SERVERLESS_EXECUTION: 'Serverless Function',
12
- CRM_EXTENSIBILITY_CARD: 'CRM Card',
13
- CRM_LEGACY_CARD: 'CRM Legacy Card',
14
- EXTENSION_LOG: 'Extension Log',
15
- EXTENSION_RENDER: 'Extension Render',
16
- APP_SETTINGS: 'App Settings',
17
- PROXY_EXECUTION: 'Proxy Execution',
18
- SERVERLESS_GATEWAY_EXECUTION: 'Serverless Gateway Execution',
19
- ACCEPTANCE_TEST: 'Acceptance Test',
20
- OAUTH_AUTHORIZATION: 'OAuth Authorization',
21
- };
8
+ import { SYSTEM_TYPE_DISPLAY_NAMES, toTypeChoice } from './logSystemTypes.js';
9
+ export { SYSTEM_TYPE_DISPLAY_NAMES, toTypeChoice };
22
10
  export const SYSTEM_TYPE_CHOICES = Object.keys(SYSTEM_TYPE_DISPLAY_NAMES).map(toTypeChoice);
23
11
  export function parseSinceTime(sinceInput) {
24
12
  const now = moment();
@@ -68,9 +56,6 @@ export function transformApiLogEntry(apiLog) {
68
56
  };
69
57
  }
70
58
  const TAIL_DELAY = 5000;
71
- export function toTypeChoice(systemType) {
72
- return systemType.toLowerCase().replaceAll('_', '-');
73
- }
74
59
  export function toSystemType(choice) {
75
60
  return choice.toUpperCase().replaceAll('-', '_');
76
61
  }
@@ -10,7 +10,7 @@ import { MIGRATION_STATUS } from '@hubspot/local-dev-lib/types/Migration';
10
10
  import { downloadProject, fetchProjectComponentsMetadata, } from '@hubspot/local-dev-lib/api/projects';
11
11
  import { Separator } from '@inquirer/prompts';
12
12
  import { confirmPrompt, inputPrompt, listPrompt, } from '../prompts/promptUtils.js';
13
- import { uiAccountDescription, uiCommandReference, uiLine, uiLink, } from '../ui/index.js';
13
+ import { uiAccountDescription, uiCommandReference, logUiLine, uiLink, } from '../ui/index.js';
14
14
  import { archiveProjectSource } from '../projects/archive.js';
15
15
  import { ensureProjectExists } from '../projects/ensureProjectExists.js';
16
16
  import SpinniesManager from '../ui/SpinniesManager.js';
@@ -385,8 +385,8 @@ export async function migrateApp(derivedAccountId, options, projectConfig) {
385
385
  uiLogger.log(uiLink('Build Details', getProjectBuildDetailUrl(projectName, buildId, derivedAccountId)));
386
386
  }
387
387
  export function logInvalidAccountError() {
388
- uiLine();
388
+ logUiLine();
389
389
  uiLogger.error(lib.migrate.errors.invalidAccountTypeTitle);
390
390
  uiLogger.log(lib.migrate.errors.invalidAccountTypeDescription(uiCommandReference('hs account use')));
391
- uiLine();
391
+ logUiLine();
392
392
  }
@@ -8,6 +8,8 @@ export declare const ONE_DAY_IN_MILLISECONDS: number;
8
8
  export declare const CLI_DEPRECATED_MAJOR_VERSION = 7;
9
9
  export declare const CLI_DEPRECATED_MAJOR_VERSION_DEPRECATION_DATE = "2026-09-02";
10
10
  export declare const CLI_DEPRECATED_MAJOR_VERSION_EOL_DATE = "2027-03-01";
11
+ export declare const SERVERLESS_SUNSET_EDITING_DISABLED_DATE = "2026-11-17";
12
+ export declare const SERVERLESS_SUNSET_CHANGELOG_URL: "https://developers.hubspot.com/changelog/sunsetting-design-manager-serverless-functions-and-older-node.js-runtimes-for-custom-code-actions";
11
13
  export declare const CLI_SUPPORT_GUIDELINES_URL: "https://developers.hubspot.com/docs/developer-tooling/local-development/hubspot-cli/version-support";
12
14
  export declare const DEFAULT_POLLING_DELAY = 2000;
13
15
  export declare const PREVIEW_POLL_TIMEOUT: number;
package/lib/constants.js CHANGED
@@ -12,6 +12,10 @@ export const CLI_DEPRECATED_MAJOR_VERSION = 7;
12
12
  export const CLI_DEPRECATED_MAJOR_VERSION_DEPRECATION_DATE = '2026-09-02';
13
13
  // The date CLI_DEPRECATED_MAJOR_VERSION reaches end of life
14
14
  export const CLI_DEPRECATED_MAJOR_VERSION_EOL_DATE = '2027-03-01';
15
+ // The date, in UTC, that editing CMS serverless functions stops. The commands
16
+ // that deploy or serve functions are disabled on and after this date.
17
+ export const SERVERLESS_SUNSET_EDITING_DISABLED_DATE = '2026-11-17';
18
+ export const SERVERLESS_SUNSET_CHANGELOG_URL = 'https://developers.hubspot.com/changelog/sunsetting-design-manager-serverless-functions-and-older-node.js-runtimes-for-custom-code-actions';
15
19
  export const CLI_SUPPORT_GUIDELINES_URL = 'https://developers.hubspot.com/docs/developer-tooling/local-development/hubspot-cli/version-support';
16
20
  export const DEFAULT_POLLING_DELAY = 2000;
17
21
  export const PREVIEW_POLL_TIMEOUT = 5 * 60 * 1000;
@@ -0,0 +1,2 @@
1
+ export declare function escapeMetaCharacters(value: string): string;
2
+ export declare function escapeArgument(arg: string, doubleEscapeMetaChars: boolean): string;