How to Update or Uninstall the Chainsaw CLI

Beginner 5 minutes Developers / Platform Engineers Getting Started

Update the Chainsaw CLI to a new version in place, pin a specific version, check what you're running, and cleanly uninstall — binary, shell hooks, PATH, and local state — all without sudo.

The Chainsaw CLI installs to a user-writable directory with no sudo and no system files (see Block Malicious and Typosquatted Packages). Updating and removing it are just as self-contained — this page covers both.

Check what you’re running

chainsaw version

This prints the version, the build commit, and the build date. chainsaw --version works too.

Update to a new version

The installer is also the updater. Re-run it and it replaces the binary in place — same install location, same SHA-256 verification against the published chainsaw-checksums.txt:

curl -fsSL https://chain305.com/install.sh | sh

Your shell hooks, PATH entry, config, token, and block history are untouched — only the binary is swapped. Confirm the new version with chainsaw version.

The installer downloads the matching OS+arch binary and verifies its SHA-256 before replacing anything. A checksum mismatch aborts the update and leaves your current binary in place.

Pin a specific version

By default the installer fetches the latest served set. To install (or roll back to) an exact version, set CHAINSAW_INSTALL_TAG:

curl -fsSL https://chain305.com/install.sh | CHAINSAW_INSTALL_TAG=<tag> sh

Where it installs (and how to override)

First match wins:

Env varEffect
CHAINSAW_INSTALL_DIRexplicit target directory
PREFIXinstall to $PREFIX/bin (must be writable; never escalates)
XDG_BIN_HOMEinstall to $XDG_BIN_HOME
(default)$HOME/.local/bin

Other knobs: CHAINSAW_NO_MODIFY_PATH=1 installs the binary but does not touch your shell rc files; CHAINSAW_HOST overrides the download host (default chain305.com).

Air-gapped environments

If you installed from an internal mirror rather than chain305.com, update the same way — re-fetch the new binary and its checksum from your mirror and replace the existing one. See Deploy Chainsaw in an Air-Gapped Environment.

Before upgrading a Chainsaw server (not the CLI)

The steps above update the CLI binary. If you also run the Chainsaw server, check upgrade safety first:

chainsaw doctor --upgrade-check

It exits 0 when it’s safe to upgrade and 2 when breaking changes are present (“DO NOT UPGRADE — resolve breaking findings first”). Review the findings and the migration notes before cutover.

Uninstall

The uninstaller is symmetric to the installer and reverses everything in the right order so nothing is left dangling:

curl -fsSL https://chain305.com/uninstall.sh | sh

It:

  1. Unwires the package-manager hooks (chainsaw uninstall-hook --all) while the binary still exists, restoring your .npmrc / pip.conf / etc. backups.
  2. Removes the guard activation line from your shell rc.
  3. Removes the PATH line the installer added (marked # added by chainsaw installer).
  4. Removes the binary.
  5. Removes per-user state at ~/.chainsaw (config, token, cached feed).

It is safe and idempotent: it only removes lines it can positively identify, backs up each rc file it edits to <rc>.chainsaw-uninstall.bak, and never uses sudo.

Keep some state

Env varEffect
CHAINSAW_KEEP_STATE=1keep ~/.chainsaw (config / token / cache)
CHAINSAW_KEEP_HOOKS=1skip the uninstall-hook --all step

Example — remove the binary but keep your config and token:

curl -fsSL https://chain305.com/uninstall.sh | CHAINSAW_KEEP_STATE=1 sh

If you installed to a non-default location, set the same CHAINSAW_INSTALL_DIR / PREFIX / XDG_BIN_HOME you used at install time so the uninstaller finds the binary.

Where to next