Skip to content

Add --no-input to all commands - #8407

Draft
gonzaloriestra wants to merge 2 commits into
mainfrom
gonzalo/no-input
Draft

Add --no-input to all commands#8407
gonzaloriestra wants to merge 2 commits into
mainfrom
gonzalo/no-input

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Closes shop/issues-develop#23696

Scripts and agents need to disable interactive behavior independently from output format.

WHAT is this pull request doing?

  • Adds --no-input to every command.
  • Disables prompts, browser launches, keypress handling, and REPL input.
  • Returns actionable errors when required input is unavailable.
  • Keeps piped input available.

How to test your changes?

  1. Run shopify store auth --help and confirm --no-input is listed.
  2. Run shopify store auth --store <store> --scopes read_products --no-input and confirm it exits without opening a browser.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type and added a changeset

@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

packages/cli-kit/dist/public/node/no-input.d.ts
export declare const noInputFlag: {
    'no-input': import("@oclif/core/interfaces").BooleanFlag<boolean>;
};

Existing type declarations

packages/cli-kit/dist/public/node/base-command.d.ts
@@ -1,5 +1,5 @@
 import { Command } from '@oclif/core';
-import { OutputFlags, Input, ParserOutput, FlagInput, OutputArgs } from '@oclif/core/parser';
+import { OutputFlags, Input, ParserOutput, OutputArgs } from '@oclif/core/parser';
 export type ArgOutput = OutputArgs<any>;
 export type FlagOutput = OutputFlags<any>;
 export interface NonTTYFlagRequirement {
@@ -9,7 +9,9 @@ export interface NonTTYFlagRequirement {
     when?: (flags: FlagOutput) => boolean;
 }
 declare abstract class BaseCommand extends Command {
-    static baseFlags: FlagInput<{}>;
+    static baseFlags: {
+        'no-input': import("@oclif/core/interfaces").BooleanFlag<boolean>;
+    };
     static get requiresSyncAnalytics(): boolean;
     static nonTTYFlagRequirements(_flags: FlagOutput): NonTTYFlagRequirement[];
     static descriptionWithoutMarkdown(): string | undefined;
@@ -18,6 +20,7 @@ declare abstract class BaseCommand extends Command {
     catch(error: Error & {
         skipOclifErrorHandling: boolean;
     }): Promise<void>;
+    protected finally(error: Error | undefined): Promise<void>;
     protected init(): Promise<unknown>;
     protected showNpmFlagWarning(): void;
     protected exitWithTimestampWhenEnvVariablePresent(): void;
@@ -25,6 +28,7 @@ declare abstract class BaseCommand extends Command {
         path?: string;
         verbose?: boolean;
         'auth-alias'?: string;
+        'no-input'?: boolean;
     }, TGlobalFlags extends FlagOutput, TArgs extends ArgOutput>(options?: Input<TFlags, TGlobalFlags, TArgs>, argv?: string[]): Promise<ParserOutput<TFlags, TGlobalFlags, TArgs> & {
         argv: string[];
     }>;
packages/cli-kit/dist/public/node/global-context.d.ts
@@ -1,5 +1,6 @@
 export interface GlobalContext {
     currentCommandId: string;
+    inputDisabled: boolean;
 }
 /**
  * Get the current command ID.
@@ -12,4 +13,16 @@ export declare function getCurrentCommandId(): string;
  *
  * @param commandId - Command ID.
  */
-export declare function setCurrentCommandId(commandId: string): void;
\ No newline at end of file
+export declare function setCurrentCommandId(commandId: string): void;
+/**
+ * Returns whether the current command explicitly disabled user input.
+ *
+ * @returns True when `--no-input` is active.
+ */
+export declare function isInputDisabled(): boolean;
+/**
+ * Controls whether the current command may request user input.
+ *
+ * @param disabled - Whether user input is disabled.
+ */
+export declare function setInputDisabled(disabled: boolean): void;
\ No newline at end of file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant