exenv
Execute a program with specified environment variables
TLDR
Display a list of installed versions
Use a specific version of Elixir across the whole system
Use a specific version of Elixir for the current application/project directory
Show the currently selected Elixir version
Install a version of Elixir (requires elixir-build plugin
SYNOPSIS
exenv [command] [arg1 [arg2 ...]]
exenv -v | --version | -h | --help
PARAMETERS
install version
Download and install specified Elixir version (e.g., 1.15.0)
uninstall version
Remove installed Elixir version
list [-k|-r]
List all available (-r remote) or known (-k) Elixir versions
versions [--bare|--plain]
Show installed Elixir versions (current marked with *)
version [VERSION|-]
Display or set local/global Elixir version
local [VERSION|-d|-u|-c]
Set or unset project-local Elixir version (.exenv-version file)
global [VERSION|-d|-u]
Set or unset user-wide default Elixir version
shell [VERSION]
Temporarily set Elixir version for current shell session
rehash
Regenerate exenv shims after installing executables
which command
Locate exenv shim path for command
whence [-p] command
List all exenv shims matching command (-p system paths)
-v, --version
Display exenv version
-h, --help
Show exenv help
DESCRIPTION
exenv is a lightweight command-line tool for managing multiple Elixir versions on Unix-like systems, including Linux. Inspired by rbenv and pyenv, it enables developers to install, switch, and run different Elixir releases without conflicting system-wide installations.
exenv works by inserting a set of shims into your PATH, which transparently delegate to the selected Elixir version. Use exenv install to download and compile Elixir from source (requires Erlang/OTP). Commands like exenv global, local, and shell set versions at project, user, or session levels. After installing packages, run exenv rehash to update shims.
It supports over 100 Elixir versions, lists remote/local installs, and integrates with Hex and Mix seamlessly. Ideal for teams or multi-project workflows, exenv avoids root privileges and Docker overhead. Setup involves cloning the repo to ~/.exenv, adding to shell profile, and restarting the terminal.
CAVEATS
Requires Git, build essentials (gcc, make), and Erlang/OTP pre-installed. Compiles from source (time/memory intensive). Modifies PATH and shell init files. Not compatible with asdf-vm. Use ~/.exenv/versions backed up before upgrades.
INSTALLATION
git clone https://github.com/uhub/exaenv.git ~/.exenv && echo 'export PATH="$HOME/.exenv/bin:$PATH"; eval "$(exenv init -)"' >> ~/.bashrc
Requires Erlang via kerl or asdf.
SHIMS EXPLAINED
exenv inserts ~/.exenv/shims into PATH. Executables like elixir resolve to version-specific binaries via exenv exec.
VERSION FILES
.exenv-version for local dirs; $EXENV_ROOT/version for global. Priority: shell > local > global.
HISTORY
exenv started in 2015 as a rbenv port for Elixir by @mhanberg, evolving from kiex limitations. Maintained by @uhub since 2016, it gained OTP integration and stable releases. Widely used in Elixir community for reproducible builds; v2.0+ supports Elixir 1.12+ and modern OTP.


