You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tech spike: Evaluate the best way to decouple the CLI from the strict Serverpod version #4564
The CLI version is currently tied to the Serverpod version due to dependencies for the code generation. This creates some frequent problems:
Developers need to reinstall the CLI when switching to work on projects with different Serverpod versions.
We are constrained to only release breaking changes to the CLI with major Serverpod upgrades.
Users need to upgrade their projects just to receive the improvements to the CLI.
The second point is specially painful now that we intend to improve the UX of using Serverpod - which largely resumes to the interaction with the CLI.
Proposal
If we move the generator part of the CLI into a serverpod_generator package, we could have this package depend on the serverpod version and have the CLI compatible with a range of the serverpod_generator (according to interface changes, just as with any normal packages).
The generate command (and others that depend on Serverpod) would delegate the execution to the serverpod_generator that is installed in the project environment - if compatible with the current CLI support range.
Use Case
Allow users to run serverpod commands on projects with different package versions.
Allow releasing UX improvements in a faster pace without pushing the need for users to upgrade their projects.
Alternatives
Continue as it is.
Additional context
This issue should evaluate the feasibility of such separation and which problems we might run into during the implementation.
How experienced are you with this library?
Expert - Experienced and comfortable with using this library in complex projects
The investigation highlighted a great complexity on the complete separation that can be made in steps. The first one would be to implement the cached compiled binaries to dispatch the execution of commands matching the version of the current project - a similar strategy to melos, that uses a project-local binary instead of the global version.
Such strategy will achieve mostly the same results as the complete separation of the CLI internals into another package, since current changes to the CLI are still a lot coupled to the other packages. And the greatest pain point would be solved: using Serverpod on projects with different versions without having to reinstall the CLI every time.
Activity
marcelomendoncasoares commentedon Mar 27, 2026
The investigation highlighted a great complexity on the complete separation that can be made in steps. The first one would be to implement the cached compiled binaries to dispatch the execution of commands matching the version of the current project - a similar strategy to
melos, that uses a project-local binary instead of the global version.Such strategy will achieve mostly the same results as the complete separation of the CLI internals into another package, since current changes to the CLI are still a lot coupled to the other packages. And the greatest pain point would be solved: using Serverpod on projects with different versions without having to reinstall the CLI every time.