diff --git a/packages/cli-v3/src/commands/analyze.ts b/packages/cli-v3/src/commands/analyze.ts index e8264f9336..70a8854f4a 100644 --- a/packages/cli-v3/src/commands/analyze.ts +++ b/packages/cli-v3/src/commands/analyze.ts @@ -13,6 +13,7 @@ import { tryCatch } from "@trigger.dev/core"; const AnalyzeOptions = CommonCommandOptions.pick({ logLevel: true, skipTelemetry: true, + profile: true, }).extend({ verbose: z.boolean().optional().default(false), }); @@ -39,7 +40,7 @@ export function configureAnalyzeCommand(program: Command) { export async function analyzeCommand(dir: string | undefined, options: unknown) { return await wrapCommandAction("analyze", AnalyzeOptions, options, async (opts) => { - await printInitialBanner(false); + await printInitialBanner(false, opts.profile); return await analyze(dir, opts); }); } diff --git a/packages/cli-v3/src/commands/deploy.ts b/packages/cli-v3/src/commands/deploy.ts index ce55379267..7821dc71d2 100644 --- a/packages/cli-v3/src/commands/deploy.ts +++ b/packages/cli-v3/src/commands/deploy.ts @@ -145,7 +145,7 @@ export function configureDeployCommand(program: Command) { ) .action(async (path, options) => { await handleTelemetry(async () => { - await printStandloneInitialBanner(true); + await printStandloneInitialBanner(true, options.profile); await deployCommand(path, options); }); }) @@ -676,6 +676,7 @@ async function failDeploy( switch (serverDeployment.status) { case "PENDING": + case "INSTALLING": case "DEPLOYING": case "BUILDING": { await doOutputLogs(); diff --git a/packages/cli-v3/src/commands/dev.ts b/packages/cli-v3/src/commands/dev.ts index 3253fdc573..f1d8f0bc2f 100644 --- a/packages/cli-v3/src/commands/dev.ts +++ b/packages/cli-v3/src/commands/dev.ts @@ -203,7 +203,7 @@ async function startDev(options: StartDevOptions) { logger.loggerLevel = options.logLevel; } - await printStandloneInitialBanner(true); + await printStandloneInitialBanner(true, options.profile); let displayedUpdateMessage = false; diff --git a/packages/cli-v3/src/commands/env.ts b/packages/cli-v3/src/commands/env.ts index 7a21218754..ac9b5f774c 100644 --- a/packages/cli-v3/src/commands/env.ts +++ b/packages/cli-v3/src/commands/env.ts @@ -71,7 +71,7 @@ export function configureEnvCommand(program: Command) { ) ).action(async (options) => { await handleTelemetry(async () => { - await printInitialBanner(false); + await printInitialBanner(false, options.profile); await envListCommand(options); }); }); @@ -95,7 +95,7 @@ export function configureEnvCommand(program: Command) { ).action(async (name, options) => { await handleTelemetry(async () => { if (!options.raw) { - await printInitialBanner(false); + await printInitialBanner(false, options.profile); } await envGetCommand({ ...options, name }); }); @@ -120,7 +120,7 @@ export function configureEnvCommand(program: Command) { .option("--force", "Overwrite the output file if it exists") ).action(async (options) => { await handleTelemetry(async () => { - await printInitialBanner(false); + await printInitialBanner(false, options.profile); await envPullCommand(options); }); }); diff --git a/packages/cli-v3/src/commands/init.ts b/packages/cli-v3/src/commands/init.ts index 9e7ca46697..82c4d0e4e0 100644 --- a/packages/cli-v3/src/commands/init.ts +++ b/packages/cli-v3/src/commands/init.ts @@ -98,7 +98,7 @@ export function configureInitCommand(program: Command) { ) .action(async (path, options) => { await handleTelemetry(async () => { - await printStandloneInitialBanner(true); + await printStandloneInitialBanner(true, options.profile); await initCommand(path, options); }); }); diff --git a/packages/cli-v3/src/commands/login.ts b/packages/cli-v3/src/commands/login.ts index bba0a68804..f3b46405a7 100644 --- a/packages/cli-v3/src/commands/login.ts +++ b/packages/cli-v3/src/commands/login.ts @@ -50,7 +50,7 @@ export function configureLoginCommand(program: Command) { .version(VERSION, "-v, --version", "Display the version number") .action(async (options) => { await handleTelemetry(async () => { - await printInitialBanner(false); + await printInitialBanner(false, options.profile); await loginCommand(options); }); }); diff --git a/packages/cli-v3/src/commands/logout.ts b/packages/cli-v3/src/commands/logout.ts index 6fefa5f634..26cc677500 100644 --- a/packages/cli-v3/src/commands/logout.ts +++ b/packages/cli-v3/src/commands/logout.ts @@ -18,7 +18,7 @@ export function configureLogoutCommand(program: Command) { return commonOptions(program.command("logout").description("Logout of Trigger.dev")).action( async (options) => { await handleTelemetry(async () => { - await printInitialBanner(false); + await printInitialBanner(false, options.profile); await logoutCommand(options); }); } diff --git a/packages/cli-v3/src/commands/preview.ts b/packages/cli-v3/src/commands/preview.ts index 2dab147a51..598d4e9ef6 100644 --- a/packages/cli-v3/src/commands/preview.ts +++ b/packages/cli-v3/src/commands/preview.ts @@ -53,7 +53,7 @@ export function configurePreviewCommand(program: Command) { ) ).action(async (path, options) => { await handleTelemetry(async () => { - await printStandloneInitialBanner(true); + await printStandloneInitialBanner(true, options.profile); await previewArchiveCommand(path, options); }); }); diff --git a/packages/cli-v3/src/commands/promote.ts b/packages/cli-v3/src/commands/promote.ts index 59452c9ec2..3895891922 100644 --- a/packages/cli-v3/src/commands/promote.ts +++ b/packages/cli-v3/src/commands/promote.ts @@ -49,7 +49,7 @@ export function configurePromoteCommand(program: Command) { ) ).action(async (version, options) => { await handleTelemetry(async () => { - await printStandloneInitialBanner(true); + await printStandloneInitialBanner(true, options.profile); await promoteCommand(version, options); }); }); diff --git a/packages/cli-v3/src/commands/trigger.ts b/packages/cli-v3/src/commands/trigger.ts index 1bf6425d6a..c030def80f 100644 --- a/packages/cli-v3/src/commands/trigger.ts +++ b/packages/cli-v3/src/commands/trigger.ts @@ -48,7 +48,7 @@ export function configureTriggerTaskCommand(program: Command) { export async function triggerTaskCommand(taskName: string, options: unknown) { return await wrapCommandAction("trigger", TriggerTaskOptions, options, async (opts) => { - await printInitialBanner(false); + await printInitialBanner(false, opts.profile); return await triggerTask(taskName, opts); }); } diff --git a/packages/cli-v3/src/commands/update.ts b/packages/cli-v3/src/commands/update.ts index f67e9bf7db..db27f7ed5f 100644 --- a/packages/cli-v3/src/commands/update.ts +++ b/packages/cli-v3/src/commands/update.ts @@ -35,7 +35,7 @@ export function configureUpdateCommand(program: Command) { .option("--skip-telemetry", "Opt-out of sending telemetry") .action(async (path, options) => { wrapCommandAction("dev", UpdateCommandOptions, options, async (opts) => { - await printStandloneInitialBanner(true); + await printStandloneInitialBanner(true, options.profile); await updateCommand(path, opts); }); }); diff --git a/packages/cli-v3/src/commands/whoami.ts b/packages/cli-v3/src/commands/whoami.ts index 54c5c1dea0..5f04eb67fb 100644 --- a/packages/cli-v3/src/commands/whoami.ts +++ b/packages/cli-v3/src/commands/whoami.ts @@ -56,7 +56,7 @@ export function configureWhoamiCommand(program: Command) { ) ).action(async (options) => { await handleTelemetry(async () => { - await printInitialBanner(false); + await printInitialBanner(false, options.profile); await whoAmICommand(options); }); }); diff --git a/packages/cli-v3/src/commands/workers/build.ts b/packages/cli-v3/src/commands/workers/build.ts index 960d94cdde..310c9268ec 100644 --- a/packages/cli-v3/src/commands/workers/build.ts +++ b/packages/cli-v3/src/commands/workers/build.ts @@ -121,7 +121,7 @@ export function configureWorkersBuildCommand(program: Command) { .option("--save-logs", "If provided, will save logs even for successful builds") .action(async (path, options) => { await handleTelemetry(async () => { - await printStandloneInitialBanner(true); + await printStandloneInitialBanner(true, options.profile); await workersBuildCommand(path, options); }); }); diff --git a/packages/cli-v3/src/commands/workers/create.ts b/packages/cli-v3/src/commands/workers/create.ts index 9f93c7ad73..dd314439e6 100644 --- a/packages/cli-v3/src/commands/workers/create.ts +++ b/packages/cli-v3/src/commands/workers/create.ts @@ -40,7 +40,7 @@ export function configureWorkersCreateCommand(program: Command) { ) .action(async (path, options) => { await handleTelemetry(async () => { - await printStandloneInitialBanner(true); + await printStandloneInitialBanner(true, options.profile); await workersCreateCommand(path, options); }); }) diff --git a/packages/cli-v3/src/commands/workers/list.ts b/packages/cli-v3/src/commands/workers/list.ts index ae4467a107..e2f89aef5a 100644 --- a/packages/cli-v3/src/commands/workers/list.ts +++ b/packages/cli-v3/src/commands/workers/list.ts @@ -39,7 +39,7 @@ export function configureWorkersListCommand(program: Command) { ) .action(async (path, options) => { await handleTelemetry(async () => { - await printStandloneInitialBanner(true); + await printStandloneInitialBanner(true, options.profile); await workersListCommand(path, options); }); }) diff --git a/packages/cli-v3/src/commands/workers/run.ts b/packages/cli-v3/src/commands/workers/run.ts index f4e9ab7c55..87b7703c45 100644 --- a/packages/cli-v3/src/commands/workers/run.ts +++ b/packages/cli-v3/src/commands/workers/run.ts @@ -44,7 +44,7 @@ export function configureWorkersRunCommand(program: Command) { .option("--network ", "The networking mode for the container", "host") .action(async (path, options) => { await handleTelemetry(async () => { - await printStandloneInitialBanner(true); + await printStandloneInitialBanner(true, options.profile); await workersRunCommand(path, options); }); }) diff --git a/packages/cli-v3/src/utilities/initialBanner.ts b/packages/cli-v3/src/utilities/initialBanner.ts index 20f4735597..c7a50c1dfe 100644 --- a/packages/cli-v3/src/utilities/initialBanner.ts +++ b/packages/cli-v3/src/utilities/initialBanner.ts @@ -11,8 +11,8 @@ import { } from "./configFiles.js"; import { CLOUD_API_URL } from "../consts.js"; -function getProfileInfo() { - const currentProfile = readAuthConfigCurrentProfileName(); +function getProfileInfo(profileOption?: string) { + const currentProfile = profileOption ?? readAuthConfigCurrentProfileName(); const profile = readAuthConfigProfile(currentProfile); if (currentProfile === DEFFAULT_PROFILE || !profile) { @@ -24,8 +24,8 @@ function getProfileInfo() { }`; } -export async function printInitialBanner(performUpdateCheck = true) { - const profileInfo = getProfileInfo(); +export async function printInitialBanner(performUpdateCheck = true, profileOption?: string) { + const profileInfo = getProfileInfo(profileOption); const text = `\n${logo()} ${chalkGrey(`(${VERSION})`)}${ profileInfo ? chalkGrey(` | ${profileInfo}`) : "" @@ -62,8 +62,8 @@ After installation, run Trigger.dev with \`npx trigger.dev\`.` } } -export async function printStandloneInitialBanner(performUpdateCheck = true) { - const profileInfo = getProfileInfo(); +export async function printStandloneInitialBanner(performUpdateCheck = true, profileOption?: string) { + const profileInfo = getProfileInfo(profileOption); const profileText = profileInfo ? chalkGrey(` | ${profileInfo}`) : ""; let versionText = `\n${logo()} ${chalkGrey(`(${VERSION})`)}`;