diff --git a/src/commands/init.ts b/src/commands/init.ts index 0588533fd..cdc10b053 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -27,7 +27,12 @@ import { warmOrgDetection } from "../lib/init/prefetch.js"; import { runWizard } from "../lib/init/wizard-runner.js"; import { validateResourceId } from "../lib/input-validation.js"; import { logger } from "../lib/logger.js"; -import { DRY_RUN_ALIASES, DRY_RUN_FLAG } from "../lib/mutate-command.js"; +import { + DRY_RUN_ALIASES, + DRY_RUN_FLAG, + YES_ALIASES, + YES_FLAG, +} from "../lib/mutate-command.js"; const log = logger.withTag("init"); @@ -205,11 +210,7 @@ export const initCommand = buildCommand< ], }, flags: { - yes: { - kind: "boolean", - brief: "Non-interactive mode (accept defaults)", - default: false, - }, + yes: { ...YES_FLAG, brief: "Non-interactive mode (accept defaults)" }, "dry-run": DRY_RUN_FLAG, features: { kind: "parsed", @@ -228,7 +229,7 @@ export const initCommand = buildCommand< }, aliases: { ...DRY_RUN_ALIASES, - y: "yes", + ...YES_ALIASES, t: "team", }, }, diff --git a/src/lib/mutate-command.ts b/src/lib/mutate-command.ts index 0abc58226..976f2890f 100644 --- a/src/lib/mutate-command.ts +++ b/src/lib/mutate-command.ts @@ -116,6 +116,16 @@ export const DESTRUCTIVE_ALIASES = { */ export const DRY_RUN_ALIASES = { n: "dry-run" } as const; +/** + * Alias map for `--yes` only: `-y` → `--yes`. + * + * Used by non-delete commands that need only the yes flag (not force): + * ```ts + * aliases: { ...YES_ALIASES, t: "team" } + * ``` + */ +export const YES_ALIASES = { y: "yes" } as const; + // --------------------------------------------------------------------------- // Level B: shared utilities // ---------------------------------------------------------------------------