feat(push): accept --yes / --no-prompt / -y as aliases for --force#1249
Draft
DaveHanns wants to merge 1 commit into
Draft
feat(push): accept --yes / --no-prompt / -y as aliases for --force#1249DaveHanns wants to merge 1 commit into
DaveHanns wants to merge 1 commit into
Conversation
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 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apify pushalready has--forceto override the "your local files are older than the remote" check. But agents (and users coming from npm / apt / yum / most CLI ecosystems) reflexively type--yes,-y,--no-prompt, or--no-interactiveinstead — and today those all fail with "Unknown flag". That failure is misleading:--forceexists and is exactly what they meant. This PR accepts all four as aliases for--force, additive and behavior-preserving.Cross-reference: finding F25 in the agentic-actor-development sweep.
What changes
In
src/commands/actors/push.ts:yes(withchar: 'y'),no-prompt, andno-interactive. Each is documented as an alias for--force.run(), OR them together withthis.flags.forcewhen deciding whether to skip the "remote is newer than local" staleness check.--forceitself. Users who already pass--forcesee identical behavior.Why not
aliases: [...]on--force?The command-framework's
Flags.boolean({ aliases: [...] })does work — but only for names that don't start withno-. The framework configures node'sparseArgswithallowNegative: true, and node then consumes--no-promptas negation of a hypotheticalpromptflag before checking whetherno-promptwas registered as its own option. Verified with a small parseArgs smoke script. The command-framework's own convention for--no-*flags is to declare them as top-level keys literally starting withno-(the framework strips the prefix at registration time and re-inverts the value on read), so this PR follows that path.--yescould have been added as analiases: ['yes']entry on--force, but then it couldn't get its ownchar: 'y'short form. Keeping all four as sibling top-level flags is symmetric and keeps-yavailable.Test plan
apify push --yesbehaves the same asapify push --force(skips the "remote is newer" check).apify push -ybehaves the same asapify push --force.apify push --no-promptbehaves the same asapify push --force.apify push --no-interactivebehaves the same asapify push --force.apify push --forcecontinues to work unchanged.apify push --helprenders the new flags in the help output.tsc --noEmitandoxlint --type-awareclean on the changed file (verified locally).