Lua environment manager built on top of hererocks and inspired by virtualenvwrapper.
- Bash
- Zsh
-
Install luamb using
pip
:pip install [--user] luamb
or
pipx
:pipx install luamb
-
Set up your shell — add the following to
~/.bashrc
or~/.zshrc
:source <(luamb shellsrc)
-
Install hererocks:
luamb update
luamb is configured via environment variables.
-
LUAMB_HOME
A directory where luamb stores its data (hererocks, environments, etc.). The default value is
$XDG_DATA_HOME/luamb
(usually~/.local/share/luamb
) on Linux and~/Library/Application Support/luamb
on macOS. -
LUAMB_ENVS_DIR
A directory where luamb stores environments. The default value is
$LUAMB_HOME/envs
. -
LUAMB_LUA_DEFAULT
A default Lua interpreter/version. The format is
interpreter version_specifier
, e.g.,lua 5.3
,luajit @v2.1
,moonjit /path/to
,raptorjit latest
. -
LUAMB_LUAROCKS_DEFAULT
A default LuaRocks version, e.g,
latest
,3.11.0
. -
LUAMB_DISABLE_COMPLETION
Set to
true
to disable shell completions. -
LUAMB_PYTHON_BIN
If the luamb executable is not in
PATH
, setLUAMB_PYTHON_BIN
to the Python executable with theluamb
package installed and change the shell initialization command:export LUAMB_PYTHON_BIN=/path/to/bin/python source <("$LUAMB_PYTHON_BIN" -m luamb shellsrc)
-
Create an environment 'myproject' with the latest Lua 5.2, the latest LuaRocks and associate it with /home/user/projects/myproject:
luamb mk myproject -l 5.2 -r latest -a /home/user/projects/myproject
-
Create an environment 'jittest' with LuaJIT 2.0.4, without LuaRocks and associate it with /home/user/projects/jitproj:
luamb mk jittest -j 2.0.4 -a /home/user/projects/jitproj
-
Set the latest LuaJIT 2.0 and the latest LuaRocks as default versions:
export LUAMB_LUA_DEFAULT='luajit 2.0' export LUAMB_LUAROCKS_DEFAULT=latest
-
Create an environment 'newenv' with the default versions and without associated project directory:
luamb mk newenv
-
Create an environment 'norocks' with the default Lua version and without LuaRocks (verbose mode):
luamb mk norocks --no-luarocks --verbose
-
Activate the 'newenv' environment:
luamb on newenv
-
Deactivate the current environment:
luamb off
-
Delete the 'myproject' environment (it will remove the environment directory only, not the project one):
luamb rm myproject
on
|enable
|activate
— activate an environmentoff
|disable
|deactivate
— deactivate the current environmentmk
|new
|create
— create a new environmentrm
|remove
|del
|delete
— remove an environmentinfo
|show
— Show the details for a single virtualenvls
|list
— list all of the environmentsupdate
— install/update thehererocks
scriptshellsrc
— print the shell initialization code
See CHANGELOG.md.
The MIT License.