Repository navigation
feat(cli): add upgrade command that hands over to @crawlee/upgrade - #4496
Merged
Merged
Conversation
A bare `crawlee upgrade` in a v3 project resolves to the local v3 CLI, which did not know the command and ended with `Unknown argument: upgrade`. The new command runs `npx crawlee@4 upgrade` with all the remaining arguments forwarded and propagates its exit code.
The command has to keep working after the next stable releases, so it runs `npx crawlee@latest upgrade` instead of pinning `crawlee@4`. While `latest` is still v3, the spawned CLI is this same command, so the child gets a `CRAWLEE_UPGRADE_HANDOVER` marker and the command refuses to spawn again when it is already set.
upgrade command that hands over to the v4 CLIupgrade command that hands over to the latest CLI
The migration prompt moves to a standalone `@crawlee/upgrade` package, so the command runs `npx @crawlee/upgrade` with the forwarded arguments. That package can never resolve to the v3 CLI, so the `CRAWLEE_UPGRADE_HANDOVER` recursion guard is gone.
upgrade command that hands over to the latest CLIupgrade command that hands over to @crawlee/upgrade
3 of 20 tasks
Without the tag, `npx` can reuse a copy from its cache, which would later be an outdated one that only bundles the older migration guides.
vladfrangu
approved these changes
Dec 1, 2026
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.
A bare
crawlee upgradein a v3 project resolves to the local v3 CLI, which fails withUnknown argument: upgradeand dumps the whole help.The v3 CLI now has an
upgradecommand that just runsnpx @crawlee/upgrade@latest, forwards the remaining arguments and propagates the exit code. Nothing from the migration guides is bundled here. If the package can't be run, it prints a one-line hint to run it manually instead of the yargs help.Btw this depends on the
@crawlee/upgradepackage from #4497 being published.