From 48ac1d33f7351c1a8be4a546dd2c02bc79307923 Mon Sep 17 00:00:00 2001 From: C <106287207+citruscai@users.noreply.github.com> Date: Mon, 5 Jan 2026 12:23:40 -0600 Subject: [PATCH 1/4] feat: add no spinner flag for function logs --- commands/cms/function/logs.ts | 21 ++++++++++++++++++--- commands/logs.ts | 7 +++++++ lang/en.ts | 3 +++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/commands/cms/function/logs.ts b/commands/cms/function/logs.ts index 4c9ca4a21..751896735 100644 --- a/commands/cms/function/logs.ts +++ b/commands/cms/function/logs.ts @@ -34,6 +34,7 @@ export type LogsArgs = CommonArgs & compact?: boolean; follow?: boolean; limit?: number; + 'no-spinner'?: boolean; }; const handleLogsError = ( @@ -54,9 +55,9 @@ const handleLogsError = ( const endpointLog = async ( accountId: number, functionPath: string, - options: LogsArgs + options: ArgumentsCamelCase ): Promise => { - const { limit, latest, follow, compact } = options; + const { limit, latest, follow, compact, noSpinner } = options; const requestParams: QueryParams = { limit, @@ -86,7 +87,14 @@ const endpointLog = async ( } }; - await tailLogs(accountId, functionPath, fetchLatest, tailCall, compact); + await tailLogs( + accountId, + functionPath, + fetchLatest, + tailCall, + compact, + noSpinner + ); } else if (latest) { try { const { data } = await getLatestFunctionLog(accountId, functionPath); @@ -172,6 +180,13 @@ function logsBuilder(yargs: Argv): Argv { .describe, type: 'boolean', }, + 'no-spinner': { + alias: ['no-animate'], + describe: + commands.cms.subcommands.function.subcommands.logs.options.noSpinner + .describe, + type: 'boolean', + }, limit: { describe: commands.cms.subcommands.function.subcommands.logs.options.limit diff --git a/commands/logs.ts b/commands/logs.ts index 19e837daa..6bb427f12 100644 --- a/commands/logs.ts +++ b/commands/logs.ts @@ -47,6 +47,13 @@ function deprecatedLogsBuilder(yargs: Argv): Argv { .describe, type: 'boolean', }, + 'no-spinner': { + alias: ['no-animate'], + describe: + commands.cms.subcommands.function.subcommands.logs.options.noSpinner + .describe, + type: 'boolean', + }, limit: { describe: commands.cms.subcommands.function.subcommands.logs.options.limit diff --git a/lang/en.ts b/lang/en.ts index 28b04c6aa..d500f9e03 100644 --- a/lang/en.ts +++ b/lang/en.ts @@ -878,6 +878,9 @@ export const commands = { follow: { describe: 'follow logs', }, + noSpinner: { + describe: 'disable spinner animation when following logs', + }, latest: { describe: 'retrieve most recent log only', }, From e9ff8bf5f154f76975ec6e5e102bcfa0f114e715 Mon Sep 17 00:00:00 2001 From: Cairo U Date: Fri, 9 Jan 2026 19:20:50 -0600 Subject: [PATCH 2/4] fix: remove attempt at removing spinner from previous branch --- commands/cms/function/logs.ts | 21 +++------------------ commands/logs.ts | 7 ------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/commands/cms/function/logs.ts b/commands/cms/function/logs.ts index 751896735..4c9ca4a21 100644 --- a/commands/cms/function/logs.ts +++ b/commands/cms/function/logs.ts @@ -34,7 +34,6 @@ export type LogsArgs = CommonArgs & compact?: boolean; follow?: boolean; limit?: number; - 'no-spinner'?: boolean; }; const handleLogsError = ( @@ -55,9 +54,9 @@ const handleLogsError = ( const endpointLog = async ( accountId: number, functionPath: string, - options: ArgumentsCamelCase + options: LogsArgs ): Promise => { - const { limit, latest, follow, compact, noSpinner } = options; + const { limit, latest, follow, compact } = options; const requestParams: QueryParams = { limit, @@ -87,14 +86,7 @@ const endpointLog = async ( } }; - await tailLogs( - accountId, - functionPath, - fetchLatest, - tailCall, - compact, - noSpinner - ); + await tailLogs(accountId, functionPath, fetchLatest, tailCall, compact); } else if (latest) { try { const { data } = await getLatestFunctionLog(accountId, functionPath); @@ -180,13 +172,6 @@ function logsBuilder(yargs: Argv): Argv { .describe, type: 'boolean', }, - 'no-spinner': { - alias: ['no-animate'], - describe: - commands.cms.subcommands.function.subcommands.logs.options.noSpinner - .describe, - type: 'boolean', - }, limit: { describe: commands.cms.subcommands.function.subcommands.logs.options.limit diff --git a/commands/logs.ts b/commands/logs.ts index 6bb427f12..19e837daa 100644 --- a/commands/logs.ts +++ b/commands/logs.ts @@ -47,13 +47,6 @@ function deprecatedLogsBuilder(yargs: Argv): Argv { .describe, type: 'boolean', }, - 'no-spinner': { - alias: ['no-animate'], - describe: - commands.cms.subcommands.function.subcommands.logs.options.noSpinner - .describe, - type: 'boolean', - }, limit: { describe: commands.cms.subcommands.function.subcommands.logs.options.limit From d746168a07368d24eb1ec2f96d331bca8be2eb18 Mon Sep 17 00:00:00 2001 From: Cairo U Date: Fri, 9 Jan 2026 19:22:38 -0600 Subject: [PATCH 3/4] feat: add --quiet option for cms fetch --- commands/cms/fetch.ts | 24 ++++++++++++++++++++++++ commands/fetch.ts | 5 +++++ lang/en.ts | 10 +++++++--- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/commands/cms/fetch.ts b/commands/cms/fetch.ts index dfcf26d26..3d7b38193 100644 --- a/commands/cms/fetch.ts +++ b/commands/cms/fetch.ts @@ -6,6 +6,7 @@ import { addOverwriteOptions, getCmsPublishMode, } from '../../lib/commonOpts.js'; +import { LOG_LEVEL, setLogLevel } from '@hubspot/local-dev-lib/logger'; import { resolveLocalPath } from '../../lib/filesystem.js'; import { validateCmsPublishMode } from '../../lib/validation.js'; import { trackCommandUsage } from '../../lib/usageTracking.js'; @@ -30,6 +31,7 @@ export type FetchCommandArgs = { staging?: boolean; assetVersion?: number; overwrite?: boolean; + quiet?: boolean; } & ConfigArgs & AccountArgs & EnvironmentArgs & @@ -54,6 +56,14 @@ async function handler( const { derivedAccountId } = options; const cmsPublishMode = getCmsPublishMode(options); + const shouldQuiet = options.quiet; + const shouldDebug = + Boolean((options as { debug?: boolean }).debug) || + Boolean((options as { networkDebug?: boolean }).networkDebug); + const logLevelToRestore = shouldDebug ? LOG_LEVEL.DEBUG : LOG_LEVEL.LOG; + if (shouldQuiet) { + setLogLevel(LOG_LEVEL.ERROR); + } trackCommandUsage('fetch', { mode: cmsPublishMode }, derivedAccountId); @@ -72,6 +82,15 @@ async function handler( overwrite, } ); + if (shouldQuiet) { + setLogLevel(logLevelToRestore); + uiLogger.success( + commands.cms.subcommands.fetch.success.completed( + src, + resolveLocalPath(dest) + ) + ); + } } catch (err) { logError(err); process.exit(EXIT_CODES.ERROR); @@ -103,6 +122,11 @@ const fetchBuilder = (yargs: Argv): Argv => { type: 'number', describe: commands.cms.subcommands.fetch.options.assetVersion.describe, }, + quiet: { + type: 'boolean', + describe: commands.cms.subcommands.fetch.options.quiet.describe, + default: false, + }, }); addCmsPublishModeOptions(yargs, { read: true }); diff --git a/commands/fetch.ts b/commands/fetch.ts index dc2ac3e94..349b96c5e 100644 --- a/commands/fetch.ts +++ b/commands/fetch.ts @@ -47,6 +47,11 @@ function deprecatedCmsFetchBuilder(yargs: Argv): Argv { type: 'number', describe: commands.cms.subcommands.fetch.options.assetVersion.describe, }, + quiet: { + type: 'boolean', + describe: commands.cms.subcommands.fetch.options.quiet.describe, + default: false, + }, }); addCmsPublishModeOptions(yargs, { read: true }); diff --git a/lang/en.ts b/lang/en.ts index d500f9e03..9667378a3 100644 --- a/lang/en.ts +++ b/lang/en.ts @@ -718,6 +718,10 @@ export const commands = { errors: { sourceRequired: 'A source to fetch is required.', }, + success: { + completed: (src: string, dest: string) => + `Completed fetch of "${src}" to "${dest}" from the Design Manager`, + }, options: { staging: { describe: 'Retrieve staged changes for project', @@ -725,6 +729,9 @@ export const commands = { assetVersion: { describe: 'Specify what version of a default asset to fetch', }, + quiet: { + describe: 'reduce fetch output to errors only', + }, }, positionals: { dest: { @@ -878,9 +885,6 @@ export const commands = { follow: { describe: 'follow logs', }, - noSpinner: { - describe: 'disable spinner animation when following logs', - }, latest: { describe: 'retrieve most recent log only', }, From 642a6e629209c37a601f96045756f4b398232d7c Mon Sep 17 00:00:00 2001 From: Cairo U Date: Fri, 9 Jan 2026 19:23:16 -0600 Subject: [PATCH 4/4] tests: cover cms fetch quiet option --- commands/cms/__tests__/fetch.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands/cms/__tests__/fetch.test.ts b/commands/cms/__tests__/fetch.test.ts index f84af6fc6..3fe850407 100644 --- a/commands/cms/__tests__/fetch.test.ts +++ b/commands/cms/__tests__/fetch.test.ts @@ -61,6 +61,10 @@ describe('commands/cms/fetch', () => { }); expect(optionsSpy).toHaveBeenCalledWith({ assetVersion: expect.objectContaining({ type: 'number' }), + quiet: expect.objectContaining({ + type: 'boolean', + default: false, + }), }); expect(addConfigOptions).toHaveBeenCalledTimes(1);