Skip to content

Commit eecaee5

Browse files
committed
fix: preserve signup flags in classic mode
resolveMode classifies a TTY classic run as 'interactive', causing buildSession to strip --auth-onboarding / --email / --accept-tos. Classic mode is interactive-but-not-TUI: it uses terminal prompts, not the Ink screens that own those decisions, and explicitly supports direct signup via CLI flags (runDirectSignupIfRequested in default.ts). Detect --classic / AMPLITUDE_WIZARD_CLASSIC=1 in buildSessionFromOptions and omit executionMode so buildSession honors the flags.
1 parent edd4df8 commit eecaee5

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/commands/helpers.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ export const buildSessionFromOptions = async (
101101
agent: Boolean(options.agent),
102102
isTTY: Boolean(process.stdout.isTTY),
103103
});
104+
// Classic mode is interactive-but-not-TUI: it uses terminal prompts, not
105+
// the Ink screens that own signup-flag decisions. `resolveMode` has no
106+
// knowledge of `--classic`, so a TTY classic run lands on `interactive`
107+
// and `buildSession` would strip `--auth-onboarding` / `--email` /
108+
// `--accept-tos`, breaking classic's direct-signup path. Omit
109+
// `executionMode` for classic so buildSession honors the flags as today.
110+
const isClassic =
111+
Boolean(options.classic) || process.env.AMPLITUDE_WIZARD_CLASSIC === '1';
112+
const effectiveMode = isClassic ? undefined : mode;
104113
const session = buildSession({
105114
debug: options.debug as boolean | undefined,
106115
verbose: options.verbose as boolean | undefined,
@@ -128,7 +137,7 @@ export const buildSessionFromOptions = async (
128137
// refers to the Amplitude project (formerly workspace), not the app.
129138
appId: options.appId as string | undefined,
130139
appName: options.appName as string | undefined,
131-
executionMode: mode,
140+
executionMode: effectiveMode,
132141
});
133142
bootstrapInstallDir(session.installDir);
134143
return session;

0 commit comments

Comments
 (0)