Self-upgrade the Locus CLI. Check for updates, install the latest version, or target a specific version.
Check for and install updates to the Locus CLI. Fetches the latest version from the npm registry and upgrades the globally installed package.
Usage
locusupgrade [options]
Options
Flag
Description
--check
Check for available updates without installing
--target-version <version>
Install a specific version instead of the latest
Behavior
Default (upgrade to latest)
When called without flags, checks the npm registry for the latest version. If a newer version is available, it is installed globally.
locusupgrade
Steps:
Fetches the latest published version from npm.
Compares it with the currently installed version.
If already up to date, prints a confirmation and exits.
If an update is available, displays the version change and installs it.
Verifies the installation succeeded.
Check Only
Use --check to see if an update is available without installing it.
Displays the current version, the latest available version, and the npm install command to run manually.
Specific Version
Use --target-version to install a specific version (upgrade or downgrade).
Version Check
Locus performs a non-blocking background version check every 24 hours when you run any command (except upgrade itself). If a newer version is available, a notice is printed after the command completes.
# Upgrade to the latest version
locus upgrade
# Check for updates without installing
locus upgrade --check
# Install a specific version
locus upgrade --target-version 3.1.0
# Verify the current version
locus --version