Skip to content

Tech spike: Evaluate the best way to decouple the CLI from the strict Serverpod version #4564

Open

Description

@marcelomendoncasoares

Problem to Solve

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

  1. Allow users to run serverpod commands on projects with different package versions.
  2. 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

Are you interested in working on a PR for this?

  • I want to work on this

Activity

  1. added
    enhancement
    area: cli
    on Jan 9, 2026
  2. moved this from Inbox 📫 to Next Up 🎯 in Serverpod Frameworkson Jan 9, 2026
  3. moved this from Next Up 🎯 to In Progress 🔥 in Serverpod Frameworkson Feb 12, 2026
  4. marcelomendoncasoares commented on Mar 27, 2026

    @marcelomendoncasoares
    CollaboratorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area: clienhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions