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.
vx upgrade1. vx upgrade installs the release and locks again
$ 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/demobun add v1.4.4 (38afee6c8)installed @vzn/vx@0.0.659 with binaries: - vxinstalled @vzn/vx-lockfile@0.0.659
[5.00ms] done✓ vx lock 2 project configs → .vx/projects.lock, .vx/dependencies.lockRead the first line: 0.0.658 → 0.0.659. The last line is vx lock, run for you.
2. Commit what changed
M bun.lock M package.json?? .vx/.gitignore?? .vx/dependencies.lock?? .vx/projects.lockpackage.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 # 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-dateOld key 409a4c89 on 0.0.658. One real build on 0.0.659, then a hit under the new key 3e19da81.
Upgrade in three steps
Section titled “Upgrade in three steps”-
Run
vx upgradein the workspace. It installs the release with your package manager, moves every@vznplugin to the same version, then runsvx lock. -
Open What changed in each release, pick your old version, and make each change it shows. Check yours with
vx --version. -
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.
Why every task runs once after
Section titled “Why every task runs once after”vx 0.0.658
└─ @demo/web#build ── (1ms) up-to-datevx 0.0.659
└─ @demo/web#build ── (260ms) successA 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
Pick a release
Section titled “Pick a release”vx upgrade takes a version. A lower one goes back:
vx upgrade 0.0.659 # or v0.0.659A global vx beside the project’s
Section titled “A global vx beside the project’s”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.
A registry mirror
Section titled “A registry mirror”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 samepackage.jsoninstalls 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
--versionwithin 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 printsvx 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.