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
Problem
Whether a command prompts is inferred from stdin. The prompt wrapper skips the prompt when
ci-inforeports CI or when stdin is a non-TTY with no data;createhas 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:What we want
A global
--non-interactiveflag, withAPIFY_CLI_NON_INTERACTIVE=1as 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
_buildParseArgsOptionnext to--helpand--user-agent, plus the env var._stdinCheckWrapper, the rule increate.ts, anddetectIsInteractivein telemetry.P1
apify help --skill: always pass--non-interactive.Links
--confirmflag, same wrapper)apify agent setupconnects local coding agents to Apify plugins, skills, and MCP #1445 (agent setup needs the same headless mode)vercel --non-interactive,stripe login --non-interactive