Rivet is a Foundry version manager that ensures the correct Foundry version is installed and used based on a .foundry-version file in your project root.
Homebrew installed foundry is not supported: Foundry installed via homebrew does not support version pinning, please uninstall it before using rivet.
- Version detection: Searches for a
.foundry-versionfile in the current directory and parent directories - Installation: Installs Foundry if it's not present
- Version management: Updates Foundry to the target version if there's a mismatch
- Command proxy: Acts as a wrapper for Foundry commands (forge, cast, anvil, chisel)
Install @ecp.eth/rivet as dev dependency in your project, then prefix the foundry commands with rivet:
{
"scripts": {
"build": "rivet forge build --sizes --skip test"
},
"devDependencies": {
"@ecp.eth/rivet": "*"
}
}