Anchor Version Manager
AVM reference documentation
Anchor Version Manager (avm) is provided to manage multiple installations of the anchor-cli binary. This may be required to produce verifiable builds, or if you'd prefer to work with an alternate version.
Install
Install the specified version of anchor-cli. The version argument should follow
semver versioning. It is also possible to use latest as the version argument
to install the latest stable version, or latest-pre-release for the latest
pre-release:
It's also possible to install based on a specific commit hash or a pre-release version tag:
List
List available versions. Pass --pre-release to include pre-release versions
in the output:
Uninstall
Update
Update to the latest stable version. Pass --pre-release to allow updating to
the latest pre-release instead:
Use
Use a specific version. This version will remain in use until you change it by
calling the same command again. Similarly to avm install, you can use
latest or latest-pre-release for the version argument:
Solana
Resolve or install the Solana CLI version for the current project. When no
version is passed to install, AVM first checks [toolchain] solana_version
in Anchor.toml, then the solana-program dependency in Cargo.toml. If the
project does not pin Solana directly, AVM resolves the Anchor version and maps
it to Anchor's recommended Solana version.
Project Solana versions are parsed as semver requirements. AVM chooses the
newest hosted Solana CLI installer that satisfies the requirement; use an exact
comparator such as =4.1.2 to require one specific hosted version.
When anchor is invoked through the AVM stub, AVM also ensures the resolved
Solana CLI version is active before spawning the selected anchor-cli binary.
Platform Tools
Resolve or manage the platform-tools version used by Solana's SBF toolchain.
When no version is passed to install, AVM uses the project-resolved Solana
version and the embedded platform-tools map. If the Solana version is a semver
requirement, AVM considers hosted Solana CLI versions satisfying that
requirement and prefers one whose platform-tools rustc can compile the locked
program dependency graph.
AVM also queries the latest platform-tools release at most once every 24 hours
and checks whether it is present in cargo build-sbf's cache. If it is
missing, AVM prints the exact cargo build-sbf --install-only command needed
to install it; it never installs the toolchain automatically.
Self-update
Update avm itself. By default installs the latest stable release of avm.
| Flag | Description |
|---|---|
--pre-release | Update to the latest pre-release version instead of the latest stable |
--bleeding-edge | Build and install from the latest commit on the master branch (conflicts with --pre-release) |
avm will also passively warn you when it detects that a newer version of
itself is available.