Skip to content

feat(cli): add upgrade command that hands over to @crawlee/upgrade - #4496

Merged
B4nan merged 4 commits into
3.xfrom
feat/cli-upgrade-command-v3
Dec 2, 2026
Merged

B4nan merged 4 commits into
3.xfrom
feat/cli-upgrade-command-v3

Conversation

@B4nan

@B4nan B4nan commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

A bare crawlee upgrade in a v3 project resolves to the local v3 CLI, which fails with Unknown argument: upgrade and dumps the whole help.

The v3 CLI now has an upgrade command that just runs npx @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/upgrade package from #4497 being published.

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.
@B4nan B4nan added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Nov 26, 2026
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.
@B4nan B4nan changed the title feat(cli): add upgrade command that hands over to the v4 CLI feat(cli): add upgrade command that hands over to the latest CLI Nov 26, 2026
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.
@B4nan B4nan changed the title feat(cli): add upgrade command that hands over to the latest CLI feat(cli): add upgrade command that hands over to @crawlee/upgrade Nov 26, 2026
@B4nan B4nan mentioned this pull request Dec 1, 2026
3 of 20 tasks
@B4nan
B4nan requested a review from vladfrangu December 1, 2026 09:38
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.
@B4nan
B4nan merged commit 434b20c into 3.x Dec 2, 2026
8 checks passed
@B4nan
B4nan deleted the feat/cli-upgrade-command-v3 branch December 2, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants