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.


Anchor version manager
 
USAGE:
    avm <SUBCOMMAND>
 
OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information
 
SUBCOMMANDS:
    help           Print this message or the help of the given subcommand(s)
    install        Install a version of Anchor
    list           List available versions of Anchor
    uninstall      Uninstall a version of Anchor
    update         Update to the latest Anchor version
    use            Use a specific version of Anchor
    solana         Resolve or install the Solana CLI for the current project
    platform-tools Inspect or manage the Solana platform-tools toolchain
    self-update    Update avm itself to the latest version

Install

avm install <VERSION_OR_COMMIT>

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:

avm install latest
avm install latest-pre-release

It's also possible to install based on a specific commit hash or a pre-release version tag:

# Specific pre-release
avm install 1.0.0-rc.3
 
# <VERSION>-<COMMIT>
avm install 0.30.1-cfe82aa682138f7c6c58bf7a78f48f7d63e9e466
 
# Full commit hash
avm install cfe82aa682138f7c6c58bf7a78f48f7d63e9e466
 
# Short commit hash
avm install cfe82aa

List

avm list [--pre-release]

List available versions. Pass --pre-release to include pre-release versions in the output:

avm list --pre-release

Uninstall

avm uninstall <version>

Update

avm update [--pre-release]

Update to the latest stable version. Pass --pre-release to allow updating to the latest pre-release instead:

avm update --pre-release

Use

avm use <version>

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:

avm use latest
avm use latest-pre-release

Solana

avm solana resolve
avm solana install [version] [--force]

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

avm platform-tools resolve
avm platform-tools install [version] [--force]
avm platform-tools list
avm platform-tools uninstall <version>

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

avm self-update [--pre-release] [--bleeding-edge]

Update avm itself. By default installs the latest stable release of avm.

FlagDescription
--pre-releaseUpdate to the latest pre-release version instead of the latest stable
--bleeding-edgeBuild and install from the latest commit on the master branch (conflicts with --pre-release)
# Update avm to latest stable
avm self-update
 
# Update avm to latest pre-release
avm self-update --pre-release
 
# Install from the tip of master
avm self-update --bleeding-edge

avm will also passively warn you when it detects that a newer version of itself is available.

On this page

GitHubEdit on GitHub