Skip to content

Commit 74c8741

Browse files
committed
fix(cli): fix header profile display to use --profile option
According to @nicktrn's review: - Reverted unnecessary changes to whoami command (it was already working correctly) - Fixed the actual issue: header display in printInitialBanner() and printStandloneInitialBanner() - Now all commands pass their --profile option to the banner functions - Banner functions now correctly display the profile specified via --profile option This ensures the CLI header consistently shows the profile being used, whether it's the default or specified via --profile flag.
1 parent 7ea6c37 commit 74c8741

File tree

13 files changed

+30
-30
lines changed

13 files changed

+30
-30
lines changed

packages/cli-v3/src/commands/analyze.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { tryCatch } from "@trigger.dev/core";
1313
const AnalyzeOptions = CommonCommandOptions.pick({
1414
logLevel: true,
1515
skipTelemetry: true,
16+
profile: true,
1617
}).extend({
1718
verbose: z.boolean().optional().default(false),
1819
});
@@ -39,7 +40,7 @@ export function configureAnalyzeCommand(program: Command) {
3940

4041
export async function analyzeCommand(dir: string | undefined, options: unknown) {
4142
return await wrapCommandAction("analyze", AnalyzeOptions, options, async (opts) => {
42-
await printInitialBanner(false);
43+
await printInitialBanner(false, opts.profile);
4344
return await analyze(dir, opts);
4445
});
4546
}

packages/cli-v3/src/commands/deploy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export function configureDeployCommand(program: Command) {
145145
)
146146
.action(async (path, options) => {
147147
await handleTelemetry(async () => {
148-
await printStandloneInitialBanner(true);
148+
await printStandloneInitialBanner(true, options.profile);
149149
await deployCommand(path, options);
150150
});
151151
})

packages/cli-v3/src/commands/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ async function startDev(options: StartDevOptions) {
203203
logger.loggerLevel = options.logLevel;
204204
}
205205

206-
await printStandloneInitialBanner(true);
206+
await printStandloneInitialBanner(true, options.profile);
207207

208208
let displayedUpdateMessage = false;
209209

packages/cli-v3/src/commands/env.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export function configureEnvCommand(program: Command) {
7171
)
7272
).action(async (options) => {
7373
await handleTelemetry(async () => {
74-
await printInitialBanner(false);
74+
await printInitialBanner(false, options.profile);
7575
await envListCommand(options);
7676
});
7777
});
@@ -95,7 +95,7 @@ export function configureEnvCommand(program: Command) {
9595
).action(async (name, options) => {
9696
await handleTelemetry(async () => {
9797
if (!options.raw) {
98-
await printInitialBanner(false);
98+
await printInitialBanner(false, options.profile);
9999
}
100100
await envGetCommand({ ...options, name });
101101
});
@@ -120,7 +120,7 @@ export function configureEnvCommand(program: Command) {
120120
.option("--force", "Overwrite the output file if it exists")
121121
).action(async (options) => {
122122
await handleTelemetry(async () => {
123-
await printInitialBanner(false);
123+
await printInitialBanner(false, options.profile);
124124
await envPullCommand(options);
125125
});
126126
});

packages/cli-v3/src/commands/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function configureInitCommand(program: Command) {
9898
)
9999
.action(async (path, options) => {
100100
await handleTelemetry(async () => {
101-
await printStandloneInitialBanner(true);
101+
await printStandloneInitialBanner(true, options.profile);
102102
await initCommand(path, options);
103103
});
104104
});

packages/cli-v3/src/commands/login.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function configureLoginCommand(program: Command) {
5050
.version(VERSION, "-v, --version", "Display the version number")
5151
.action(async (options) => {
5252
await handleTelemetry(async () => {
53-
await printInitialBanner(false);
53+
await printInitialBanner(false, options.profile);
5454
await loginCommand(options);
5555
});
5656
});

packages/cli-v3/src/commands/logout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function configureLogoutCommand(program: Command) {
1818
return commonOptions(program.command("logout").description("Logout of Trigger.dev")).action(
1919
async (options) => {
2020
await handleTelemetry(async () => {
21-
await printInitialBanner(false);
21+
await printInitialBanner(false, options.profile);
2222
await logoutCommand(options);
2323
});
2424
}

packages/cli-v3/src/commands/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function configurePreviewCommand(program: Command) {
5353
)
5454
).action(async (path, options) => {
5555
await handleTelemetry(async () => {
56-
await printStandloneInitialBanner(true);
56+
await printStandloneInitialBanner(true, options.profile);
5757
await previewArchiveCommand(path, options);
5858
});
5959
});

packages/cli-v3/src/commands/promote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function configurePromoteCommand(program: Command) {
4949
)
5050
).action(async (version, options) => {
5151
await handleTelemetry(async () => {
52-
await printStandloneInitialBanner(true);
52+
await printStandloneInitialBanner(true, options.profile);
5353
await promoteCommand(version, options);
5454
});
5555
});

packages/cli-v3/src/commands/trigger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function configureTriggerTaskCommand(program: Command) {
4848

4949
export async function triggerTaskCommand(taskName: string, options: unknown) {
5050
return await wrapCommandAction("trigger", TriggerTaskOptions, options, async (opts) => {
51-
await printInitialBanner(false);
51+
await printInitialBanner(false, opts.profile);
5252
return await triggerTask(taskName, opts);
5353
});
5454
}

0 commit comments

Comments
 (0)