diff --git a/packages/nx/src/command-line/connect/connect-to-nx-cloud.ts b/packages/nx/src/command-line/connect/connect-to-nx-cloud.ts index 1dd4528338c86..6b1f79741fbbd 100644 --- a/packages/nx/src/command-line/connect/connect-to-nx-cloud.ts +++ b/packages/nx/src/command-line/connect/connect-to-nx-cloud.ts @@ -71,6 +71,10 @@ export async function connectToNxCloudCommand( ): Promise { const nxJson = readNxJson(); + const installationSource = process.env.NX_CONSOLE + ? 'nx-console' + : 'nx-connect'; + if (isNxCloudUsed(nxJson)) { const token = process.env.NX_CLOUD_ACCESS_TOKEN || nxJson.nxCloudAccessToken; @@ -80,7 +84,7 @@ export async function connectToNxCloudCommand( ); } const connectCloudUrl = await createNxCloudOnboardingURL( - 'nx-connect', + installationSource, token ); output.log({ @@ -96,7 +100,7 @@ export async function connectToNxCloudCommand( return false; } const token = await connectWorkspaceToCloud({ - installationSource: command ?? 'nx-connect', + installationSource: command ?? installationSource, }); const connectCloudUrl = await createNxCloudOnboardingURL('nx-connect', token); diff --git a/packages/nx/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.ts b/packages/nx/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.ts index a7c9fd1876957..8e1eb8aa2afc6 100644 --- a/packages/nx/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.ts +++ b/packages/nx/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.ts @@ -146,7 +146,13 @@ export async function connectToNxCloud( // do NOT create Nx Cloud token (createNxCloudWorkspace) // if user is using github and is running nx-connect - if (!(usesGithub && schema.installationSource === 'nx-connect')) { + if ( + !( + usesGithub && + (schema.installationSource === 'nx-connect' || + schema.installationSource === 'nx-console') + ) + ) { responseFromCreateNxCloudWorkspace = await createNxCloudWorkspace( getRootPackageName(tree), schema.installationSource,