Skip to content

Write interactive prompts to stderr by default - #8812

Merged
isaacroldan merged 6 commits into
mainfrom
codex/prompts-stderr-default
Oct 7, 2026
Merged

isaacroldan merged 6 commits into
mainfrom
codex/prompts-stderr-default

Conversation

@isaacroldan

@isaacroldan isaacroldan commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Interactive prompts write to stdout, which mixes prompt text and terminal control codes with command results.

WHAT is this pull request doing?

Default all shared prompts to stderr while keeping explicit output stream overrides. Require stdin and stderr to be terminals, so redirecting stdout still allows prompts and redirecting stderr disables them.

How to manually test your changes?

Run shopify kitchen-sink prompts > /tmp/shopify-prompt-results.txt in an interactive terminal and complete the example prompts. Prompts should remain visible and interactive, and the stdout file should stay empty.

Run shopify kitchen-sink prompts 2> /tmp/shopify-prompts.txt. It should fail before asking for input, even though stdout is still a terminal.

Validation

Focused prompt, system, and command tests pass. CLI kit lint, type checks, and build pass. Real terminal probes verify all five prompt types with stdout redirected, and verify that redirecting stderr blocks prompts even when stdout is a terminal.

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 (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset

@isaacroldan
isaacroldan requested a review from a team as a code owner October 7, 2026 09:44
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Oct 7, 2026
@isaacroldan
isaacroldan requested a review from a team as a code owner October 7, 2026 10:29
@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Built from 9e88552f7fa612f4c29e164e6efef456f11eb640. Workflow run.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261007110837

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

Comment thread packages/cli-kit/src/public/node/system.ts
# Conflicts:
#	packages/cli-kit/src/public/node/ui.test.ts
@github-actions

github-actions Bot commented Oct 7, 2026

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

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/system.d.ts
@@ -104,9 +104,9 @@ export declare function sleep(seconds: number): Promise<void>;
  */
 export declare function terminalSupportsHyperlinks(): boolean;
 /**
- * Check if the standard input and output streams support prompting.
+ * Check if standard input and standard error are terminals that support prompting.
  *
- * @returns True if the standard input and output streams support prompting.
+ * @returns True if standard input and standard error support prompting.
  */
 export declare function terminalSupportsPrompting(): boolean;
 /**

@isaacroldan
isaacroldan added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit ba2c512 Oct 7, 2026
28 of 30 checks passed
@isaacroldan
isaacroldan deleted the codex/prompts-stderr-default branch October 7, 2026 16:15
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.

3 participants