On this page
obi upgrade
Install the latest obi, or a specific version, after you confirm.
obi upgrade replaces the obi you are running with the latest release, or
with the version you name.
obi upgrade [VERSION] [--yes]
It shows which version it would install and where, and asks before changing anything. It then downloads the build for your system, checks it against the release's published checksums, runs it once to make sure it is the version asked for, and swaps it into place. It never needs sudo: if obi sits in a folder you cannot write to, it says so instead.
obi upgrade # the latest release
obi upgrade 0.1.0 # a specific version, for example to go back
obi upgrade --yes # no question, for scripts
Without a terminal to ask at, obi upgrade changes nothing unless you pass
--yes.
Update notices
obi never upgrades itself. At most once a day, after a command, it prints one line when a newer release is out:
obi 0.2.0 is available (you have 0.1.0). Run "obi upgrade" to install it.
It stays quiet in CI, when its output goes to a pipe or a file, with
-o json or -o yaml, and when OBI_NO_UPDATE_CHECK=1 is set.
Installed with npm
If you installed obi globally with npm (or pnpm), obi upgrade upgrades it
with npm for you. It works out the new release the same way, shows the exact
command it will run, and asks first:
About to upgrade obi 0.1.2 to 0.2.0 by running: npm install -g https://api.obistack.com/v1/cli/obistack-cli-0.2.0.tgz. Continue? [y/N]
npm's own output appears as it runs. A pnpm global install gets
pnpm add -g instead.
When obi upgrade cannot run it for you, it changes nothing and prints the
exact command to run yourself. That happens when obi cannot tell it was a
global npm install (a project's own node_modules, npx, or yarn, say), on
Windows, and when npm does not start or fails, for example because it needs
permission to write to its global folder.