Skip to content

Commit 449ee2d

Browse files
committed
docs: clarify profile resolution logic with detailed comments
Explains how profile resolution works: - No --profile: uses Zod default (readAuthConfigCurrentProfileName) - With --profile: trims whitespace, falls back to current if empty - Current profile defaults to 'default' when no config exists
1 parent 45c19a8 commit 449ee2d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ export async function whoAmI(
7474
embedded: boolean = false,
7575
silent: boolean = false
7676
): Promise<WhoAmIResult> {
77+
// When no --profile is passed, Zod schema defaults to readAuthConfigCurrentProfileName()
78+
// which returns the current profile from config or "default" if none exists.
79+
// If --profile is passed, we trim whitespace and fallback to current profile if empty.
7780
const profileToUse = options?.profile?.trim() || readAuthConfigCurrentProfileName();
7881

7982
if (!embedded) {

0 commit comments

Comments
 (0)