Skip to content

feat(cli): --non-interactive flag; prompts fail fast with exit 4#8336

Open
DavidWells wants to merge 1 commit into
split/exit-codesfrom
split/non-interactive
Open

feat(cli): --non-interactive flag; prompts fail fast with exit 4#8336
DavidWells wants to merge 1 commit into
split/exit-codesfrom
split/non-interactive

Conversation

@DavidWells

Copy link
Copy Markdown
Contributor

Split from #8300 (8 of 9). Stacked on #8329 — merge that first; GitHub will retarget this to main.

What

New hidden global flag --non-interactive (CI detection already gated some prompts). Any would-be interactive prompt now exits 4 with the prompt named and the exact flags that answer it:

$ netlify link --non-interactive
 ›   Error: Cannot prompt for input in non-interactive mode (CI or --non-interactive).
 ›   Prompt: How do you want to link this folder to a project?
No project specified. In non-interactive mode, you must specify how to link:
  netlify link --id <project-id> ...

Covers authentication, link, and monorepo workspace selection (which also gains a --filter/--cwd remediation hint).

Why it helps agents

A hidden prompt in a headless session means an agent or CI job hangs forever with no diagnostic. Exit 4 is instant, diagnosable, and the message contains the self-correction.

Testing

  • New unit tests for the non-interactive detection and fail-fast helper; dev monorepo integration test updated to expect exit 4
  • typecheck ✓ lint ✓ 410 unit tests ✓

A hidden interactive prompt in a headless session hangs forever. With
--non-interactive (or existing CI detection), any would-be prompt exits
4 naming the prompt and the flags or env vars that would answer it.
Covers auth, link, and monorepo workspace selection.
@DavidWells DavidWells requested a review from a team as a code owner July 6, 2026 18:03
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f1f85659-8f70-4bae-a38c-ef23ba22c422

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch split/non-interactive

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant