From 3d0e3759c77beead09e8b2488e3a5194cb073db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hanu=C5=A1?= Date: Thu, 2 Jul 2026 00:53:18 +0200 Subject: [PATCH] feat(push): accept --yes / --no-prompt / -y as aliases for --force MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Agents (and humans coming from npm/apt/yum) reflexively reach for --yes, -y, --no-prompt, or --no-interactive to skip confirmation prompts. On `apify push` all of these fail with "Unknown flag" — misleading, because --force does exist and is exactly what the user means. Register --yes/-y, --no-prompt, and --no-interactive as top-level boolean flags on `apify push` and OR them into the same skip-staleness-check branch as --force. No behavior change for --force itself; the new flags are additive. Cross-reference finding F25. Note on implementation: aliases on --force via the framework's `aliases: [...]` array cannot handle `no-*` names, because node's parseArgs (which the command-framework configures with `allowNegative: true`) consumes `--no-prompt` as negation of a hypothetical `prompt` flag regardless of whether `no-prompt` is also registered. The command-framework's convention for `--no-*` flags is to declare them as top-level keys starting with `no-`, so that path is used here. Co-Authored-By: Claude Opus 4.7 --- src/commands/actors/push.ts | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/commands/actors/push.ts b/src/commands/actors/push.ts index 683462834..0483def26 100644 --- a/src/commands/actors/push.ts +++ b/src/commands/actors/push.ts @@ -181,6 +181,25 @@ export class ActorsPushCommand extends ApifyCommand { default: false, required: false, }), + // Aliases for --force. Agents frequently confabulate npm/apt-style skip-confirmation flags + // (--yes, -y, --no-prompt, --no-interactive) instead of Apify's --force. Accept them all so + // the command does what the user obviously meant rather than failing with "Unknown flag". + yes: Flags.boolean({ + char: 'y', + description: 'Alias for --force. Accepted so npm/apt-style `--yes` / `-y` work with `apify push`.', + default: false, + required: false, + }), + 'no-prompt': Flags.boolean({ + description: 'Alias for --force. Accepted so `--no-prompt` works with `apify push`.', + default: false, + required: false, + }), + 'no-interactive': Flags.boolean({ + description: 'Alias for --force. Accepted so `--no-interactive` works with `apify push`.', + default: false, + required: false, + }), dir: Flags.string({ description: 'Directory where the Actor is located.', required: false, @@ -346,8 +365,12 @@ export class ActorsPushCommand extends ApifyCommand { }, 0); const actorModifiedMs = client?.modifiedAt.valueOf(); + // npm/apt-style skip-confirmation flags are treated as aliases for --force. + const skipStalenessCheck = + this.flags.force || this.flags.yes || this.flags.noPrompt || this.flags.noInteractive; + if ( - !this.flags.force && + !skipStalenessCheck && actorModifiedMs && mostRecentModifiedFileMs < actorModifiedMs && (actorConfig?.name || forceActorId)