From 96b31d0db364752a114092b159ffa802d7a5ed23 Mon Sep 17 00:00:00 2001 From: Max Kless Date: Mon, 23 Feb 2026 16:49:14 +0100 Subject: [PATCH 1/3] feat(core): add passthrough for nx-cloud apply-locally command --- .../nx-cloud/apply-locally/apply-locally.ts | 15 +++++++++++++++ .../nx-cloud/apply-locally/command-object.ts | 18 ++++++++++++++++++ packages/nx/src/command-line/nx-commands.ts | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 packages/nx/src/command-line/nx-cloud/apply-locally/apply-locally.ts create mode 100644 packages/nx/src/command-line/nx-cloud/apply-locally/command-object.ts diff --git a/packages/nx/src/command-line/nx-cloud/apply-locally/apply-locally.ts b/packages/nx/src/command-line/nx-cloud/apply-locally/apply-locally.ts new file mode 100644 index 00000000000..e3f035cb376 --- /dev/null +++ b/packages/nx/src/command-line/nx-cloud/apply-locally/apply-locally.ts @@ -0,0 +1,15 @@ +import { readNxJson } from '../../../config/nx-json'; +import { isNxCloudUsed } from '../../../utils/nx-cloud-utils'; +import { executeNxCloudCommand, warnNotConnectedToCloud } from '../utils'; + +export interface ApplyLocallyArgs { + verbose?: boolean; +} + +export function applyLocallyHandler(args: ApplyLocallyArgs): Promise { + if (!isNxCloudUsed(readNxJson())) { + warnNotConnectedToCloud(); + return Promise.resolve(0); + } + return executeNxCloudCommand('apply-locally', args.verbose); +} diff --git a/packages/nx/src/command-line/nx-cloud/apply-locally/command-object.ts b/packages/nx/src/command-line/nx-cloud/apply-locally/command-object.ts new file mode 100644 index 00000000000..401bb9f44cf --- /dev/null +++ b/packages/nx/src/command-line/nx-cloud/apply-locally/command-object.ts @@ -0,0 +1,18 @@ +import { CommandModule } from 'yargs'; +import { withVerbose } from '../../yargs-utils/shared-options'; + +export const yargsApplyLocallyCommand: CommandModule = { + command: 'apply-locally [options]', + describe: + 'Applies a self-healing CI fix locally. This command is an alias for `nx-cloud apply-locally`.', + builder: (yargs) => + withVerbose(yargs) + .help(false) + .showHelpOnFail(false) + .option('help', { describe: 'Show help.', type: 'boolean' }), + handler: async (args: any) => { + process.exit( + await (await import('./apply-locally')).applyLocallyHandler(args) + ); + }, +}; diff --git a/packages/nx/src/command-line/nx-commands.ts b/packages/nx/src/command-line/nx-commands.ts index 569ccce6b49..5e44d570cd7 100644 --- a/packages/nx/src/command-line/nx-commands.ts +++ b/packages/nx/src/command-line/nx-commands.ts @@ -46,6 +46,7 @@ import { yargsStartCiRunCommand } from './nx-cloud/start-ci-run/command-object'; import { yargsStartAgentCommand } from './nx-cloud/start-agent/command-object'; import { yargsStopAllAgentsCommand } from './nx-cloud/complete-run/command-object'; import { yargsFixCiCommand } from './nx-cloud/fix-ci/command-object'; +import { yargsApplyLocallyCommand } from './nx-cloud/apply-locally/command-object'; import { yargsDownloadCloudClientCommand } from './nx-cloud/download-cloud-client/command-object'; import { yargsPrintAffectedCommand, @@ -115,6 +116,7 @@ export const commandsObject = yargs .command(yargsStartAgentCommand) .command(yargsStopAllAgentsCommand) .command(yargsFixCiCommand) + .command(yargsApplyLocallyCommand) .command(yargsDownloadCloudClientCommand) .command(yargsMcpCommand) .command(resolveConformanceCommandObject()) From 10648502d2229526513ec251884b3c9af9a5617a Mon Sep 17 00:00:00 2001 From: "nx-cloud[bot]" <71083854+nx-cloud[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:44:33 +0000 Subject: [PATCH 2/3] feat(core): add passthrough for nx-cloud apply-locally command [Self-Healing CI Rerun] From 872c113c08c2894076d09c8be64c0ba72fec03c6 Mon Sep 17 00:00:00 2001 From: "nx-cloud[bot]" <71083854+nx-cloud[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:39:49 +0000 Subject: [PATCH 3/3] feat(core): add passthrough for nx-cloud apply-locally command [Self-Healing CI Rerun]