Skip to content
GitHubBlueskydev.toRSS

08Extend vx

Upgrading vx

You, your team and your agents all run the same vx. One command keeps it current: it moves vx, and every @vzn plugin with it, to the newest release.

Terminal window
vx upgrade
Read
@demo moves from 0.0.658 to 0.0.659

1. vx upgrade installs the release and locks again

vx upgrade
$ vx upgrade
› vx upgrade 0.0.658 → 0.0.659
bun add @vzn/vx@0.0.659 @vzn/vx-lockfile@0.0.659 --dev in /work/demo
bun add v1.4.4 (38afee6c8)
installed @vzn/vx@0.0.659 with binaries:
- vx
installed @vzn/vx-lockfile@0.0.659
[5.00ms] done
✓ vx lock 2 project configs → .vx/projects.lock, .vx/dependencies.lock

Read the first line: 0.0.658 → 0.0.659. The last line is vx lock, run for you.

2. Commit what changed

git status --short
M bun.lock
M package.json
?? .vx/.gitignore
?? .vx/dependencies.lock
?? .vx/projects.lock

package.json and bun.lock pin the new vx. .vx/ holds the new lock and .vx/.gitignore, which the release adds: commit it too.

3. The first build runs again, once

vx run build, before and after
$ vx run build # on 0.0.658
┌─ @demo/web#build > up-to-date • 409a4c89
└─ @demo/web#build ── (1ms) up-to-date
$ vx run build # on 0.0.659: new key
┌─ @demo/web#build > success
└─ @demo/web#build ── (260ms) success
$ vx run build # on 0.0.659 again
┌─ @demo/web#build > up-to-date • 3e19da81
└─ @demo/web#build ── (3ms) up-to-date

Old key 409a4c89 on 0.0.658. One real build on 0.0.659, then a hit under the new key 3e19da81.

  1. Run vx upgrade in the workspace. It installs the release with your package manager, moves every @vzn plugin to the same version, then runs vx lock.

  2. Open What changed in each release, pick your old version, and make each change it shows. Check yours with vx --version.

  3. Commit package.json, your lockfile and .vx/. Everyone and CI then install the same vx.

Check yourself A teammate on 0.0.658 pulls your commit but does not install. What happens on their next vx run?

If the release changed the lock’s format, their vx refuses it: .vx/projects.lock was written by a newer vx … upgrade vx. One bun install gives them the pinned vx, and the run works.

You can now move a workspace to a new vx and keep the whole team on it.

vx 0.0.658

Terminal window
└─ @demo/web#build ── (1ms) up-to-date

vx 0.0.659

Terminal window
└─ @demo/web#build ── (260ms) success

A new vx means new keys, so nothing old is reused. Each task runs once and is stored again. A release never replays what an older vx stored.

You can now expect one full run after an upgrade, and know why it is safe.

PatternsCommon setups

vx upgrade takes a version. A lower one goes back:

Terminal window
vx upgrade 0.0.659 # or v0.0.659

Inside a project, a global vx upgrade moves both to one version: the project’s first, then the global. vx upgrade -g moves only the global one and never touches package.json.

vx installs from the registry your package manager already uses: @vzn:registry or registry in .npmrc, npm_config_registry, or bunfig.toml. Nothing extra to set.

CI installs what the lockfile pins, so a commit from step 3 is the whole CI upgrade. Its first run builds every task once, like yours did.

You can now pin a release, move a global vx, and upgrade behind a company mirror.

DetailsWhat vx upgrade does, exactly
Your vx was installed… vx upgrade runs
in a project its package manager’s add, same field: bun add @vzn/vx@<v> --dev
with bun add -g bun add -g @vzn/vx@<v>
with pnpm add -g pnpm add -g @vzn/vx@<v>
with npm install -g npm install -g --prefix <prefix> @vzn/vx@<v>
with yarn global add yarn global add @vzn/vx@<v>
as a binary, by hand downloads the release and replaces itself
  • Plugins move too. Every @vzn/vx-* plugin in the same package.json installs at the same version.
  • The download is checked. A hand-installed binary checks npm’s signature and the file’s hash first. Any mismatch refuses, and nothing is replaced.
  • A broken binary is undone. The new vx must answer --version within 10 s, or the old one comes back and the command exits 1.
  • The lock follows. After an install inside a workspace, the new vx runs vx lock. If that fails, it prints vx lock failed: run vx lock.
  • Already there. On the version you run, it prints already at <version> and downloads nothing.
Exit code When
0 installed, or already at that version
1 anything refused or undone: no network, a directory it cannot write, a bad signature, a binary that does not start, a failed install

Every message and edge rule: the vx upgrade reference.

NextWhat changed in each release →Pick your old version and see each change to make.
Turborepo, Nx and other product names are trademarks of their owners. vx is not affiliated with or endorsed by them.