Skip to content

[feature] Executor update/upgrade #2015

Description

@mynameistito

Problem

Executor already checks npm dist-tags and tells users when a newer version is available, but upgrading the CLI still requires manually running a package-manager-specific global install command.

The current update path also assumes npm:

npm i -g executor@latest

That isn't ideal when Executor was installed globally with Bun, pnpm, or Yarn.

There is already some package-manager detection in the CLI launcher, but it currently only distinguishes Bun from npm. pnpm and Yarn can therefore be misidentified.

Proposed solution

Add first-class self-update commands:

executor update
executor upgrade

They could be aliases for the same operation.

The command should detect which package manager installed the current Executor CLI and use that same package manager to perform the upgrade.

For example:

# npm
npm install -g executor@latest

# pnpm
pnpm add -g executor@latest

# bun
bun add -g executor@latest

# yarn
yarn global add executor@latest

The existing release-channel logic should also be respected, so a user currently running the beta channel upgrades using @beta rather than unexpectedly moving to @latest.

Package-manager detection

Ideally this should be shared functionality rather than introducing another independent detector.

Executor already has detectPackageManager() logic in apps/cli/src/build.ts, but it currently effectively behaves as:

bun -> bun
anything with npm_config_user_agent -> npm
otherwise -> unknown

It would be useful to expand this into a reusable detector for at least:

  • npm
  • pnpm
  • bun
  • yarn

Detection should preferably identify the package manager that actually owns the global Executor installation rather than simply picking whichever package manager happens to be available on PATH.

If ownership cannot be determined safely, the command should report that and print the appropriate manual upgrade commands rather than silently switching package managers.

Expected behaviour

$ executor upgrade

Current version: 1.6.8
Latest version:  1.6.9
Installed with:  bun

Upgrading Executor with bun...
1.6.8 -> 1.6.9

Executor is up to date.

If already current:

$ executor update

Executor 1.6.9 is already up to date.

After a successful upgrade, if the durable Executor service is installed/running, the command should restart or refresh it so the daemon and CLI don't remain on different versions.

The command should preserve all existing Executor configuration and data.

Related

This could also allow the existing CLI/web update notice to display the correct package-manager-specific command instead of always suggesting npm.

Where it belongs

CLI

Before you submit

  • I searched the open issues for a duplicate.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions