@@ -245,7 +245,14 @@ export const EnvironmentVariableNames = {
245245 * Other lifecycle scripts should not make assumptions about Rush's command line syntax
246246 * if Rush did not explicitly pass along command-line parameters to their process.
247247 */
248- RUSH_INVOKED_ARGS : 'RUSH_INVOKED_ARGS'
248+ RUSH_INVOKED_ARGS : 'RUSH_INVOKED_ARGS' ,
249+
250+ /**
251+ * When set to `1` or `true`, this environment variable is equivalent to passing the `--quiet` flag
252+ * to `rush`, `rushx`, and `install-run-rush.ts`. It suppresses informational startup messages
253+ * while preserving error output.
254+ */
255+ RUSH_QUIET_MODE : 'RUSH_QUIET_MODE'
249256} as const ;
250257
251258/**
@@ -293,6 +300,8 @@ export class EnvironmentConfiguration {
293300
294301 private static _tarBinaryPath : string | undefined ;
295302
303+ private static _quietMode : boolean = false ;
304+
296305 /**
297306 * If true, the environment configuration has been validated and initialized.
298307 */
@@ -456,6 +465,15 @@ export class EnvironmentConfiguration {
456465 return EnvironmentConfiguration . _tarBinaryPath ;
457466 }
458467
468+ /**
469+ * If `true`, Rush will suppress informational startup messages, equivalent to passing `--quiet`.
470+ * See {@link EnvironmentVariableNames.RUSH_QUIET_MODE}
471+ */
472+ public static get quietMode ( ) : boolean {
473+ EnvironmentConfiguration . _ensureValidated ( ) ;
474+ return EnvironmentConfiguration . _quietMode ;
475+ }
476+
459477 /**
460478 * The front-end RushVersionSelector relies on `RUSH_GLOBAL_FOLDER`, so its value must be read before
461479 * `EnvironmentConfiguration` is initialized (and actually before the correct version of `EnvironmentConfiguration`
@@ -606,6 +624,20 @@ export class EnvironmentConfiguration {
606624 break ;
607625 }
608626
627+ case EnvironmentVariableNames . RUSH_QUIET_MODE : {
628+ // Accept both "true"/"false" string values and the standard "1"/"0" values
629+ if ( value === 'true' || value === 'false' ) {
630+ EnvironmentConfiguration . _quietMode = value === 'true' ;
631+ } else {
632+ EnvironmentConfiguration . _quietMode =
633+ EnvironmentConfiguration . parseBooleanEnvironmentVariable (
634+ EnvironmentVariableNames . RUSH_QUIET_MODE ,
635+ value
636+ ) ?? false ;
637+ }
638+ break ;
639+ }
640+
609641 case EnvironmentVariableNames . RUSH_PARALLELISM :
610642 case EnvironmentVariableNames . RUSH_PREVIEW_VERSION :
611643 case EnvironmentVariableNames . RUSH_VARIANT :
@@ -661,7 +693,9 @@ export class EnvironmentConfiguration {
661693 */
662694 public static reset ( ) : void {
663695 EnvironmentConfiguration . _rushTempFolderOverride = undefined ;
664-
696+ EnvironmentConfiguration . _quietMode = false ;
697+ EnvironmentConfiguration . _gitBinaryPath = undefined ;
698+ EnvironmentConfiguration . _tarBinaryPath = undefined ;
665699 EnvironmentConfiguration . _hasBeenValidated = false ;
666700 }
667701
0 commit comments