Skip to content

Add a global --non-interactive flag #1451

Description

@patrikbraborec

Problem

Whether a command prompts is inferred from stdin. The prompt wrapper skips the prompt when ci-info reports CI or when stdin is a non-TTY with no data; create has its own rule (TTY and not CI). When an agent runs the CLI in a pseudo-terminal (IDE terminals, tmux-based harnesses), the prompt renders on stderr and waits until the harness times out, with nothing on stdout and no exit code. Verified on 1.10.0:

$ script -q /dev/null apify datasets rm <id>
? Are you sure you want to delete this Dataset? (Y/n)
(killed after 8 s, dataset still exists)

What we want

A global --non-interactive flag, with APIFY_CLI_NON_INTERACTIVE=1 as the env equivalent, that forces every prompt onto the skip path regardless of stdin. A skipped prompt with no answer fails fast and names the flag that answers it.

Requirements

P0

  • Flag in _buildParseArgsOption next to --help and --user-agent, plus the env var.
  • One resolver replacing the three decision points: _stdinCheckWrapper, the rule in create.ts, and detectIsInteractive in telemetry.
  • A skipped prompt without an answer exits non-zero with the exact flag to pass.

P1

  • Default to non-interactive under known agent env vars, once each variable is verified against a real session.
  • One line in apify help --skill: always pass --non-interactive.

Links

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-buildersIssues owned by the Builders team.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions